Browse Source

Add option to use classic skin by default

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.4.0
falkTX 2 years ago
parent
commit
8907e1143b
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
6 changed files with 56 additions and 23 deletions
  1. +4
    -0
      .github/workflows/build.yml
  2. +26
    -19
      resources/ui/carla_settings.ui
  3. +11
    -1
      source/frontend/carla_host.py
  4. +7
    -0
      source/frontend/carla_settings.py
  5. +2
    -0
      source/frontend/carla_shared.py
  6. +6
    -3
      source/frontend/widgets/racklistwidget.py

+ 4
- 0
.github/workflows/build.yml View File

@@ -101,6 +101,8 @@ jobs:
run: make features
- name: make
run: make -j $(nproc)
- name: make wine32
run: make wine32

ubuntu-mingw-win64:
runs-on: ubuntu-20.04
@@ -120,3 +122,5 @@ jobs:
run: make features
- name: make
run: make -j $(nproc)
- name: make wine64
run: make wine64

+ 26
- 19
resources/ui/carla_settings.ui View File

@@ -386,7 +386,30 @@
<string>Interface</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="3" column="0">
<item row="4" column="2">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>130</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="cb_main_classic_skin_default">
<property name="text">
<string>Use &quot;Classic&quot; as default rack skin</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_main_refresh_interval">
<property name="text">
<string>Interface refresh interval:</string>
@@ -396,7 +419,7 @@
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QSpinBox" name="sb_main_refresh_interval">
<property name="suffix">
<string> ms</string>
@@ -412,22 +435,6 @@
</property>
</widget>
</item>
<item row="3" column="2">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>130</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="ch_main_show_logs">
<property name="text">
@@ -435,7 +442,7 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="ch_main_confirm_exit">
<property name="text">
<string>Show a confirmation dialog before quitting</string>


+ 11
- 1
source/frontend/carla_host.py View File

@@ -1439,7 +1439,7 @@ class HostWindow(QMainWindow):
pitem.recreateWidget()
return

pitem = self.ui.listWidget.createItem(pluginId)
pitem = self.ui.listWidget.createItem(pluginId, self.fSavedSettings[CARLA_KEY_MAIN_CLASSIC_SKIN])
self.fPluginList.append(pitem)
self.fPluginCount += 1

@@ -1953,10 +1953,12 @@ class HostWindow(QMainWindow):
QTimer.singleShot(100, self.slot_restoreCanvasScrollbarValues)

# TODO - complete this
oldSettings = self.fSavedSettings

self.fSavedSettings = {
CARLA_KEY_MAIN_PROJECT_FOLDER: settings.value(CARLA_KEY_MAIN_PROJECT_FOLDER, CARLA_DEFAULT_MAIN_PROJECT_FOLDER, str),
CARLA_KEY_MAIN_CONFIRM_EXIT: settings.value(CARLA_KEY_MAIN_CONFIRM_EXIT, CARLA_DEFAULT_MAIN_CONFIRM_EXIT, bool),
CARLA_KEY_MAIN_CLASSIC_SKIN: settings.value(CARLA_KEY_MAIN_CLASSIC_SKIN, CARLA_DEFAULT_MAIN_CLASSIC_SKIN, bool),
CARLA_KEY_MAIN_REFRESH_INTERVAL: settings.value(CARLA_KEY_MAIN_REFRESH_INTERVAL, CARLA_DEFAULT_MAIN_REFRESH_INTERVAL, int),
CARLA_KEY_MAIN_SYSTEM_ICONS: settings.value(CARLA_KEY_MAIN_SYSTEM_ICONS, CARLA_DEFAULT_MAIN_SYSTEM_ICONS, bool),
CARLA_KEY_MAIN_EXPERIMENTAL: settings.value(CARLA_KEY_MAIN_EXPERIMENTAL, CARLA_DEFAULT_MAIN_EXPERIMENTAL, bool),
@@ -1993,6 +1995,14 @@ class HostWindow(QMainWindow):
setEngineSettings(self.host)
self.restartTimersIfNeeded()

if oldSettings.get(CARLA_KEY_MAIN_CLASSIC_SKIN, None) not in (self.fSavedSettings[CARLA_KEY_MAIN_CLASSIC_SKIN], None):
newSkin = "classic" if self.fSavedSettings[CARLA_KEY_MAIN_CLASSIC_SKIN] else None

for pitem in self.fPluginList:
if pitem is None:
continue
pitem.recreateWidget(newSkin = newSkin)

return settings

# --------------------------------------------------------------------------------------------------------


+ 7
- 0
source/frontend/carla_settings.py View File

@@ -54,6 +54,7 @@ from carla_shared import (
CARLA_KEY_MAIN_PRO_THEME_COLOR,
CARLA_KEY_MAIN_REFRESH_INTERVAL,
CARLA_KEY_MAIN_CONFIRM_EXIT,
CARLA_KEY_MAIN_CLASSIC_SKIN,
CARLA_KEY_MAIN_SHOW_LOGS,
CARLA_KEY_MAIN_SYSTEM_ICONS,
CARLA_KEY_MAIN_EXPERIMENTAL,
@@ -113,6 +114,7 @@ from carla_shared import (
CARLA_DEFAULT_MAIN_PRO_THEME_COLOR,
CARLA_DEFAULT_MAIN_REFRESH_INTERVAL,
CARLA_DEFAULT_MAIN_CONFIRM_EXIT,
CARLA_DEFAULT_MAIN_CLASSIC_SKIN,
CARLA_DEFAULT_MAIN_SHOW_LOGS,
CARLA_DEFAULT_MAIN_SYSTEM_ICONS,
#CARLA_DEFAULT_MAIN_EXPERIMENTAL,
@@ -666,6 +668,9 @@ class CarlaSettingsW(QDialog):
self.ui.ch_main_confirm_exit.setChecked(
settings.value(CARLA_KEY_MAIN_CONFIRM_EXIT, CARLA_DEFAULT_MAIN_CONFIRM_EXIT, bool))

self.ui.cb_main_classic_skin_default.setChecked(
settings.value(CARLA_KEY_MAIN_CLASSIC_SKIN, CARLA_DEFAULT_MAIN_CLASSIC_SKIN, bool))

self.ui.ch_main_system_icons.setChecked(
settings.value(CARLA_KEY_MAIN_SYSTEM_ICONS, CARLA_DEFAULT_MAIN_SYSTEM_ICONS, bool))

@@ -931,6 +936,7 @@ class CarlaSettingsW(QDialog):

settings.setValue(CARLA_KEY_MAIN_PROJECT_FOLDER, self.ui.le_main_proj_folder.text())
settings.setValue(CARLA_KEY_MAIN_CONFIRM_EXIT, self.ui.ch_main_confirm_exit.isChecked())
settings.setValue(CARLA_KEY_MAIN_CLASSIC_SKIN, self.ui.cb_main_classic_skin_default.isChecked())
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())
@@ -1120,6 +1126,7 @@ class CarlaSettingsW(QDialog):
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.ch_main_confirm_exit.setChecked(CARLA_DEFAULT_MAIN_CONFIRM_EXIT)
self.ui.cb_main_classic_skin_default(CARLA_DEFAULT_MAIN_CLASSIC_SKIN)
self.ui.ch_main_show_logs.setChecked(CARLA_DEFAULT_MAIN_SHOW_LOGS)

# -------------------------------------------------------------------------------------------------------------


+ 2
- 0
source/frontend/carla_shared.py View File

@@ -183,6 +183,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_CONFIRM_EXIT = "Main/ConfirmExit" # bool
CARLA_KEY_MAIN_CLASSIC_SKIN = "Main/ClassicSkin" # bool
CARLA_KEY_MAIN_SHOW_LOGS = "Main/ShowLogs" # bool
CARLA_KEY_MAIN_SYSTEM_ICONS = "Main/SystemIcons" # bool
CARLA_KEY_MAIN_EXPERIMENTAL = "Main/Experimental" # bool
@@ -259,6 +260,7 @@ CARLA_DEFAULT_MAIN_USE_PRO_THEME = True
CARLA_DEFAULT_MAIN_PRO_THEME_COLOR = "Black"
CARLA_DEFAULT_MAIN_REFRESH_INTERVAL = 20
CARLA_DEFAULT_MAIN_CONFIRM_EXIT = True
CARLA_DEFAULT_MAIN_CLASSIC_SKIN = False
CARLA_DEFAULT_MAIN_SHOW_LOGS = bool(not WINDOWS)
CARLA_DEFAULT_MAIN_SYSTEM_ICONS = False
CARLA_DEFAULT_MAIN_EXPERIMENTAL = False


+ 6
- 3
source/frontend/widgets/racklistwidget.py View File

@@ -42,7 +42,7 @@ class RackListItem(QListWidgetItem):
kRackItemType = QListWidgetItem.UserType + 1
kMinimumWidth = 620

def __init__(self, parent, pluginId):
def __init__(self, parent, pluginId, useClassicSkin):
QListWidgetItem.__init__(self, parent, self.kRackItemType)
self.host = parent.host

@@ -68,6 +68,9 @@ class RackListItem(QListWidgetItem):
else:
color = None

if useClassicSkin and not skin:
skin = "classic"

self.fOptions = {
'color' : color,
'skin' : skin,
@@ -234,8 +237,8 @@ class RackListWidget(QListWidget):

# --------------------------------------------------------------------------------------------------------

def createItem(self, pluginId):
return RackListItem(self, pluginId)
def createItem(self, pluginId, useClassicSkin):
return RackListItem(self, pluginId, useClassicSkin)

def getPluginCount(self):
return self.fParent.getPluginCount()


Loading…
Cancel
Save