diff --git a/resources/ui/carla_settings.ui b/resources/ui/carla_settings.ui index a69746a8b..4bf63a846 100644 --- a/resources/ui/carla_settings.ui +++ b/resources/ui/carla_settings.ui @@ -261,6 +261,71 @@ + + + + Interface + + + + + + ms + + + 10 + + + 1000 + + + 250 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 130 + 10 + + + + + + + + Interface refresh interval: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Make plugin UIs appear on top of Carla (needs restart) + + + + + + + Use custom plugin slot skins + + + + + + @@ -323,64 +388,6 @@ - - - - Misc - - - - - - GUI Refresh interval: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - ms - - - 10 - - - 1000 - - - 250 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 130 - 10 - - - - - - - - Use custom plugin slot skins - - - - - - diff --git a/source/carla_backend.py b/source/carla_backend.py index 00c17a7d2..dfa72d30b 100644 --- a/source/carla_backend.py +++ b/source/carla_backend.py @@ -1216,6 +1216,7 @@ class CarlaHostMeta(object): self.preferPluginBridges = False self.preferUIBridges = False self.preventBadBehaviour = False + self.manageUIs = False self.uisAlwaysOnTop = False self.maxParameters = 0 self.uiBridgesTimeout = 0 diff --git a/source/carla_host.py b/source/carla_host.py index 853b6f54f..efa66326e 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -1842,7 +1842,7 @@ class HostWindow(QMainWindow): QMainWindow.showEvent(self, event) # set our gui as parent for all plugins UIs - if not (self.host.isControl or self.host.isPlugin): + if self.host.manageUIs and not (self.host.isControl or self.host.isPlugin): winIdStr = "%x" % self.winId() self.host.set_engine_option(ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr) @@ -2241,6 +2241,16 @@ def loadHostSettings(host): settings = QSettings("falkTX", "Carla2") # bool values + try: + host.manageUIs = settings.value(CARLA_KEY_MAIN_MANAGE_UIS, CARLA_DEFAULT_MAIN_MANAGE_UIS, type=bool) + except: + host.manageUIs = CARLA_DEFAULT_MAIN_MANAGE_UIS + + try: + host.uisAlwaysOnTop = settings.value(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, CARLA_DEFAULT_UIS_ALWAYS_ON_TOP, type=bool) + except: + host.uisAlwaysOnTop = CARLA_DEFAULT_UIS_ALWAYS_ON_TOP + try: host.forceStereo = settings.value(CARLA_KEY_ENGINE_FORCE_STEREO, CARLA_DEFAULT_FORCE_STEREO, type=bool) except: @@ -2256,11 +2266,6 @@ def loadHostSettings(host): except: host.preferUIBridges = CARLA_DEFAULT_PREFER_UI_BRIDGES - try: - host.uisAlwaysOnTop = settings.value(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, CARLA_DEFAULT_UIS_ALWAYS_ON_TOP, type=bool) - except: - host.uisAlwaysOnTop = CARLA_DEFAULT_UIS_ALWAYS_ON_TOP - # int values try: host.maxParameters = settings.value(CARLA_KEY_ENGINE_MAX_PARAMETERS, CARLA_DEFAULT_MAX_PARAMETERS, type=int) diff --git a/source/carla_settings.py b/source/carla_settings.py index 5be728bf8..a374d8a81 100755 --- a/source/carla_settings.py +++ b/source/carla_settings.py @@ -238,6 +238,10 @@ class CarlaSettingsW(QDialog): self.ui.group_main_theme.setEnabled(False) self.ui.group_main_theme.setVisible(False) + if MACOS or WINDOWS: + self.ui.ch_main_manage_uis.setEnabled(False) + self.ui.ch_main_manage_uis.setVisible(False) + if host.isControl: self.ui.lw_page.hideRow(self.TAB_INDEX_CANVAS) self.ui.lw_page.hideRow(self.TAB_INDEX_ENGINE) @@ -320,11 +324,14 @@ class CarlaSettingsW(QDialog): # ---------------------------------------------------------------------------------------------------- # Main + self.ui.ch_main_manage_uis.setChecked(self.host.manageUIs) + self.ui.ch_engine_uis_always_on_top.setChecked(self.host.uisAlwaysOnTop) + self.ui.le_main_proj_folder.setText(settings.value(CARLA_KEY_MAIN_PROJECT_FOLDER, CARLA_DEFAULT_MAIN_PROJECT_FOLDER, type=str)) self.ui.ch_main_theme_pro.setChecked(settings.value(CARLA_KEY_MAIN_USE_PRO_THEME, CARLA_DEFAULT_MAIN_USE_PRO_THEME, type=bool) and self.ui.group_main_theme.isEnabled()) self.ui.cb_main_theme_color.setCurrentIndex(self.ui.cb_main_theme_color.findText(settings.value(CARLA_KEY_MAIN_PRO_THEME_COLOR, CARLA_DEFAULT_MAIN_PRO_THEME_COLOR, type=str))) self.ui.sb_main_refresh_interval.setValue(settings.value(CARLA_KEY_MAIN_REFRESH_INTERVAL, CARLA_DEFAULT_MAIN_REFRESH_INTERVAL, type=int)) - self.ui.cb_main_use_custom_skins.setChecked(settings.value(CARLA_KEY_MAIN_USE_CUSTOM_SKINS, CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS, type=bool)) + self.ui.ch_main_use_custom_skins.setChecked(settings.value(CARLA_KEY_MAIN_USE_CUSTOM_SKINS, CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS, type=bool)) # ---------------------------------------------------------------------------------------------------- # Canvas @@ -374,7 +381,6 @@ class CarlaSettingsW(QDialog): self.ui.cb_engine_process_mode_other.setCurrentIndex(0) self.ui.sb_engine_max_params.setValue(self.host.maxParameters) - self.ui.ch_engine_uis_always_on_top.setChecked(self.host.uisAlwaysOnTop) self.ui.ch_engine_prefer_ui_bridges.setChecked(self.host.preferUIBridges) self.ui.sb_engine_ui_bridges_timeout.setValue(self.host.uiBridgesTimeout) self.ui.ch_engine_force_stereo.setChecked(self.host.forceStereo or not self.ui.ch_engine_force_stereo.isEnabled()) @@ -442,11 +448,17 @@ class CarlaSettingsW(QDialog): # ---------------------------------------------------------------------------------------------------- # Main + self.host.manageUIs = self.ui.ch_main_manage_uis.isChecked() + self.host.uisAlwaysOnTop = self.ui.ch_engine_uis_always_on_top.isChecked() + settings.setValue(CARLA_KEY_MAIN_PROJECT_FOLDER, self.ui.le_main_proj_folder.text()) settings.setValue(CARLA_KEY_MAIN_USE_PRO_THEME, self.ui.ch_main_theme_pro.isChecked()) settings.setValue(CARLA_KEY_MAIN_PRO_THEME_COLOR, self.ui.cb_main_theme_color.currentText()) settings.setValue(CARLA_KEY_MAIN_REFRESH_INTERVAL, self.ui.sb_main_refresh_interval.value()) - settings.setValue(CARLA_KEY_MAIN_USE_CUSTOM_SKINS, self.ui.cb_main_use_custom_skins.isChecked()) + settings.setValue(CARLA_KEY_MAIN_USE_CUSTOM_SKINS, self.ui.ch_main_use_custom_skins.isChecked()) + + settings.setValue(CARLA_KEY_MAIN_MANAGE_UIS, self.host.manageUIs) + settings.setValue(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, self.host.uisAlwaysOnTop) # ---------------------------------------------------------------------------------------------------- # Canvas @@ -484,7 +496,6 @@ class CarlaSettingsW(QDialog): self.host.forceStereo = self.ui.ch_engine_force_stereo.isChecked() self.host.preferPluginBridges = self.ui.ch_engine_prefer_plugin_bridges.isChecked() self.host.preferUIBridges = self.ui.ch_engine_prefer_ui_bridges.isChecked() - self.host.uisAlwaysOnTop = self.ui.ch_engine_uis_always_on_top.isChecked() self.host.maxParameters = self.ui.sb_engine_max_params.value() self.host.uiBridgesTimeout = self.ui.sb_engine_ui_bridges_timeout.value() @@ -502,7 +513,6 @@ class CarlaSettingsW(QDialog): settings.setValue(CARLA_KEY_ENGINE_PREFER_PLUGIN_BRIDGES, self.host.preferPluginBridges) settings.setValue(CARLA_KEY_ENGINE_PREFER_UI_BRIDGES, self.host.preferUIBridges) - settings.setValue(CARLA_KEY_ENGINE_UIS_ALWAYS_ON_TOP, self.host.uisAlwaysOnTop) settings.setValue(CARLA_KEY_ENGINE_MAX_PARAMETERS, self.host.maxParameters) settings.setValue(CARLA_KEY_ENGINE_UI_BRIDGES_TIMEOUT, self.host.uiBridgesTimeout) @@ -572,7 +582,8 @@ class CarlaSettingsW(QDialog): self.ui.ch_main_theme_pro.setChecked(CARLA_DEFAULT_MAIN_USE_PRO_THEME and self.ui.group_main_theme.isEnabled()) self.ui.cb_main_theme_color.setCurrentIndex(self.ui.cb_main_theme_color.findText(CARLA_DEFAULT_MAIN_PRO_THEME_COLOR)) self.ui.sb_main_refresh_interval.setValue(CARLA_DEFAULT_MAIN_REFRESH_INTERVAL) - self.ui.cb_main_use_custom_skins.setChecked(CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS) + self.ui.ch_main_use_custom_skins.setChecked(CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS) + self.ui.ch_main_manage_uis.setChecked(CARLA_DEFAULT_MAIN_MANAGE_UIS) # ---------------------------------------------------------------------------------------------------- # Canvas diff --git a/source/carla_shared.py b/source/carla_shared.py index 25a7a2a66..22c3a9c6a 100644 --- a/source/carla_shared.py +++ b/source/carla_shared.py @@ -192,6 +192,7 @@ CARLA_KEY_MAIN_USE_PRO_THEME = "Main/UseProTheme" # bool CARLA_KEY_MAIN_PRO_THEME_COLOR = "Main/ProThemeColor" # str CARLA_KEY_MAIN_REFRESH_INTERVAL = "Main/RefreshInterval" # int CARLA_KEY_MAIN_USE_CUSTOM_SKINS = "Main/UseCustomSkins" # bool +CARLA_KEY_MAIN_MANAGE_UIS = "Main/ManageUIs" # bool CARLA_KEY_CANVAS_THEME = "Canvas/Theme" # str CARLA_KEY_CANVAS_SIZE = "Canvas/Size" # str "NxN" @@ -235,6 +236,7 @@ CARLA_DEFAULT_MAIN_USE_PRO_THEME = True CARLA_DEFAULT_MAIN_PRO_THEME_COLOR = "Black" CARLA_DEFAULT_MAIN_REFRESH_INTERVAL = 20 CARLA_DEFAULT_MAIN_USE_CUSTOM_SKINS = True +CARLA_DEFAULT_MAIN_MANAGE_UIS = True # Canvas CARLA_DEFAULT_CANVAS_THEME = "Modern Dark" diff --git a/source/native-plugins/resources/carla-plugin b/source/native-plugins/resources/carla-plugin index fad40d31d..e274b5d0c 100755 --- a/source/native-plugins/resources/carla-plugin +++ b/source/native-plugins/resources/carla-plugin @@ -533,8 +533,9 @@ class CarlaEmbedW(QEmbedWidget): QEmbedWidget.showEvent(self, event) # set our gui as parent for all plugins UIs - winIdStr = "%x" % self.fWinId - self.host.set_engine_option(ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr) + if self.host.manageUIs: + winIdStr = "%x" % self.fWinId + self.host.set_engine_option(ENGINE_OPTION_FRONTEND_WIN_ID, 0, winIdStr) def hideEvent(self, event): # disable parent