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: if config_UseQt5:
from PyQt5.QtCore import qCritical, QFileInfo, QModelIndex, QTimer from PyQt5.QtCore import qCritical, QFileInfo, QModelIndex, QTimer
from PyQt5.QtGui import QPalette from PyQt5.QtGui import QPalette
from PyQt5.QtWidgets import QApplication, QFileSystemModel, QListWidgetItem, QMainWindow
from PyQt5.QtWidgets import QAction, QApplication, QFileSystemModel, QListWidgetItem, QMainWindow
else: else:
from PyQt4.QtCore import qCritical, QFileInfo, QModelIndex, QTimer from PyQt4.QtCore import qCritical, QFileInfo, QModelIndex, QTimer
from PyQt4.QtGui import QApplication, QFileSystemModel, QListWidgetItem, QMainWindow, QPalette from PyQt4.QtGui import QApplication, QFileSystemModel, QListWidgetItem, QMainWindow, QPalette
@@ -175,6 +175,14 @@ class HostWindow(QMainWindow):
gCarla.host = Host("") gCarla.host = Host("")
self.fContainer = CarlaDummyW(self) 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 # 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 # Platform specific stuff


if MACOS: 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 from PyQt4.QtGui import qt_mac_set_menubar_icons
qt_mac_set_menubar_icons(False) qt_mac_set_menubar_icons(False)




+ 4
- 1
source/carla_style.py View File

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


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


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

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




Loading…
Cancel
Save