Browse Source

Better integrate with internal Qt toolbar visibility state

Closes #1583

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.4.3
falkTX 2 years ago
parent
commit
7f8ae362af
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 13 additions and 1 deletions
  1. +1
    -1
      resources/ui/carla_host.ui
  2. +12
    -0
      source/frontend/carla_host.py

+ 1
- 1
resources/ui/carla_host.ui View File

@@ -571,7 +571,7 @@
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
<string>Tool Bar</string>
</property>
<property name="movable">
<bool>false</bool>


+ 12
- 0
source/frontend/carla_host.py View File

@@ -542,6 +542,7 @@ class HostWindow(QMainWindow):
self.ui.keyboard.noteOff.connect(self.slot_noteOff)

self.ui.tabWidget.currentChanged.connect(self.slot_tabChanged)
self.ui.toolBar.visibilityChanged.connect(self.slot_toolbarVisibilityChanged)

if withCanvas:
self.ui.act_canvas_show_internal.triggered.connect(self.slot_canvasShowInternal)
@@ -1919,8 +1920,10 @@ class HostWindow(QMainWindow):

showToolbar = settings.value("ShowToolbar", True, bool)
self.ui.act_settings_show_toolbar.setChecked(showToolbar)
self.ui.toolBar.blockSignals(True)
self.ui.toolBar.setEnabled(showToolbar)
self.ui.toolBar.setVisible(showToolbar)
self.ui.toolBar.blockSignals(False)

#if settings.contains("SplitterState"):
#self.ui.splitter.restoreState(settings.value("SplitterState", b""))
@@ -2035,8 +2038,10 @@ class HostWindow(QMainWindow):

@pyqtSlot(bool)
def slot_showToolbar(self, yesNo):
self.ui.toolBar.blockSignals(True)
self.ui.toolBar.setEnabled(yesNo)
self.ui.toolBar.setVisible(yesNo)
self.ui.toolBar.blockSignals(False)

@pyqtSlot(bool)
def slot_showCanvasMeters(self, yesNo):
@@ -2472,6 +2477,13 @@ class HostWindow(QMainWindow):
# --------------------------------------------------------------------------------------------------------
# Misc

@pyqtSlot(bool)
def slot_toolbarVisibilityChanged(self, visible):
self.ui.toolBar.blockSignals(True)
self.ui.toolBar.setEnabled(visible)
self.ui.toolBar.blockSignals(False)
self.ui.act_settings_show_toolbar.setChecked(visible)

@pyqtSlot(int)
def slot_tabChanged(self, index):
if index != 1:


Loading…
Cancel
Save