Browse Source

Small adjustments for better OSX behaviour

tags/1.9.4
falkTX 10 years ago
parent
commit
79944f194a
3 changed files with 14 additions and 6 deletions
  1. +9
    -1
      source/carla_host.py
  2. +1
    -4
      source/carla_shared.py
  3. +4
    -1
      source/carla_style.py

+ 9
- 1
source/carla_host.py View File

@@ -27,7 +27,7 @@ from carla_config import *
if config_UseQt5:
from PyQt5.QtCore import qCritical, QFileInfo, QModelIndex, QTimer
from PyQt5.QtGui import QPalette
from PyQt5.QtWidgets import QApplication, QFileSystemModel, QListWidgetItem, QMainWindow
from PyQt5.QtWidgets import QAction, QApplication, QFileSystemModel, QListWidgetItem, QMainWindow
else:
from PyQt4.QtCore import qCritical, QFileInfo, QModelIndex, QTimer
from PyQt4.QtGui import QApplication, QFileSystemModel, QListWidgetItem, QMainWindow, QPalette
@@ -175,6 +175,14 @@ class HostWindow(QMainWindow):
gCarla.host = Host("")
self.fContainer = CarlaDummyW(self)

if MACOS and config_UseQt5:
self.ui.act_file_quit.setMenuRole(QAction.QuitRole)
self.ui.act_settings_configure.setMenuRole(QAction.PreferencesRole)
self.ui.act_help_about.setMenuRole(QAction.AboutRole)
self.ui.act_help_about_qt.setMenuRole(QAction.AboutQtRole)
self.ui.menu_Settings.setTitle("Panels")
#self.ui.menu_Help.hide()

# -------------------------------------------------------------
# Set callback, TODO put somewhere else



+ 1
- 4
source/carla_shared.py View File

@@ -57,10 +57,7 @@ from carla_backend import *
# Platform specific stuff

if MACOS:
if config_UseQt5:
pass
#from PyQt5.QtGui import qt_mac_set_menubar_icons
else:
if not config_UseQt5:
from PyQt4.QtGui import qt_mac_set_menubar_icons
qt_mac_set_menubar_icons(False)



+ 4
- 1
source/carla_style.py View File

@@ -25,7 +25,7 @@ from carla_config import *
# Imports (Global)

if config_UseQt5:
from PyQt5.QtCore import QSettings
from PyQt5.QtCore import Qt, QSettings
from PyQt5.QtGui import QColor, QFont, QPalette
from PyQt5.QtWidgets import QApplication
else:
@@ -235,6 +235,9 @@ class CarlaApplication(object):
else:
self.fApp.setWindowIcon(QIcon(":/scalable/carla.svg"))

if MACOS and config_UseQt5:
self.fApp.setAttribute(Qt.AA_DontShowIconsInMenus)

def arguments(self):
return self.fApp.arguments()



Loading…
Cancel
Save