Browse Source

Make the knobs and rack buttons more white-theme friendly

tags/v1.9.11
falkTX 6 years ago
parent
commit
737a814ea0
29 changed files with 90 additions and 38 deletions
  1. BIN
      resources/bitmaps/button_distrho-black.png
  2. +0
    -0
      resources/bitmaps/button_distrho-white.png
  3. BIN
      resources/bitmaps/button_distrho_down-black.png
  4. +0
    -0
      resources/bitmaps/button_distrho_down-white.png
  5. BIN
      resources/bitmaps/button_distrho_hover-black.png
  6. +0
    -0
      resources/bitmaps/button_distrho_hover-white.png
  7. BIN
      resources/bitmaps/button_edit-black.png
  8. +0
    -0
      resources/bitmaps/button_edit-white.png
  9. BIN
      resources/bitmaps/button_edit_down-black.png
  10. +0
    -0
      resources/bitmaps/button_edit_down-white.png
  11. BIN
      resources/bitmaps/button_edit_hover-black.png
  12. +0
    -0
      resources/bitmaps/button_edit_hover-white.png
  13. BIN
      resources/bitmaps/button_file-black.png
  14. +0
    -0
      resources/bitmaps/button_file-white.png
  15. BIN
      resources/bitmaps/button_file_down-black.png
  16. +0
    -0
      resources/bitmaps/button_file_down-white.png
  17. BIN
      resources/bitmaps/button_file_hover-black.png
  18. +0
    -0
      resources/bitmaps/button_file_hover-white.png
  19. BIN
      resources/bitmaps/button_gui-black.png
  20. +0
    -0
      resources/bitmaps/button_gui-white.png
  21. BIN
      resources/bitmaps/button_gui_down-black.png
  22. +0
    -0
      resources/bitmaps/button_gui_down-white.png
  23. BIN
      resources/bitmaps/button_gui_hover-black.png
  24. +0
    -0
      resources/bitmaps/button_gui_hover-white.png
  25. +24
    -12
      resources/resources.qrc
  26. +6
    -6
      resources/ui/carla_about.ui
  27. +51
    -17
      source/frontend/carla_skin.py
  28. +4
    -3
      source/frontend/carla_widgets.py
  29. +5
    -0
      source/frontend/widgets/pixmapdial.py

BIN
resources/bitmaps/button_distrho-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 513B

resources/bitmaps/button_distrho.png → resources/bitmaps/button_distrho-white.png View File


BIN
resources/bitmaps/button_distrho_down-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 735B

resources/bitmaps/button_distrho_down.png → resources/bitmaps/button_distrho_down-white.png View File


BIN
resources/bitmaps/button_distrho_hover-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 947B

resources/bitmaps/button_distrho_hover.png → resources/bitmaps/button_distrho_hover-white.png View File


BIN
resources/bitmaps/button_edit-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 447B

resources/bitmaps/button_edit.png → resources/bitmaps/button_edit-white.png View File


BIN
resources/bitmaps/button_edit_down-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 489B

resources/bitmaps/button_edit_down.png → resources/bitmaps/button_edit_down-white.png View File


BIN
resources/bitmaps/button_edit_hover-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 691B

resources/bitmaps/button_edit_hover.png → resources/bitmaps/button_edit_hover-white.png View File


BIN
resources/bitmaps/button_file-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 283B

resources/bitmaps/button_file.png → resources/bitmaps/button_file-white.png View File


BIN
resources/bitmaps/button_file_down-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 375B

resources/bitmaps/button_file_down.png → resources/bitmaps/button_file_down-white.png View File


BIN
resources/bitmaps/button_file_hover-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 729B

resources/bitmaps/button_file_hover.png → resources/bitmaps/button_file_hover-white.png View File


BIN
resources/bitmaps/button_gui-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 505B

resources/bitmaps/button_gui.png → resources/bitmaps/button_gui-white.png View File


BIN
resources/bitmaps/button_gui_down-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 661B

resources/bitmaps/button_gui_down.png → resources/bitmaps/button_gui_down-white.png View File


BIN
resources/bitmaps/button_gui_hover-black.png View File

Before After
Width: 22  |  Height: 22  |  Size: 865B

resources/bitmaps/button_gui_hover.png → resources/bitmaps/button_gui_hover-white.png View File


+ 24
- 12
resources/resources.qrc View File

@@ -68,18 +68,30 @@
<file>bitmaps/button_calf3_down.png</file>
<file>bitmaps/button_calf1_hover.png</file>
<file>bitmaps/button_calf2_hover.png</file>
<file>bitmaps/button_distrho.png</file>
<file>bitmaps/button_distrho_down.png</file>
<file>bitmaps/button_distrho_hover.png</file>
<file>bitmaps/button_edit.png</file>
<file>bitmaps/button_edit_down.png</file>
<file>bitmaps/button_edit_hover.png</file>
<file>bitmaps/button_file.png</file>
<file>bitmaps/button_file_down.png</file>
<file>bitmaps/button_file_hover.png</file>
<file>bitmaps/button_gui.png</file>
<file>bitmaps/button_gui_down.png</file>
<file>bitmaps/button_gui_hover.png</file>
<file>bitmaps/button_distrho-black.png</file>
<file>bitmaps/button_distrho-white.png</file>
<file>bitmaps/button_distrho_down-black.png</file>
<file>bitmaps/button_distrho_down-white.png</file>
<file>bitmaps/button_distrho_hover-black.png</file>
<file>bitmaps/button_distrho_hover-white.png</file>
<file>bitmaps/button_edit-black.png</file>
<file>bitmaps/button_edit-white.png</file>
<file>bitmaps/button_edit_down-black.png</file>
<file>bitmaps/button_edit_down-white.png</file>
<file>bitmaps/button_edit_hover-black.png</file>
<file>bitmaps/button_edit_hover-white.png</file>
<file>bitmaps/button_file-black.png</file>
<file>bitmaps/button_file-white.png</file>
<file>bitmaps/button_file_down-black.png</file>
<file>bitmaps/button_file_down-white.png</file>
<file>bitmaps/button_file_hover-black.png</file>
<file>bitmaps/button_file_hover-white.png</file>
<file>bitmaps/button_gui-black.png</file>
<file>bitmaps/button_gui-white.png</file>
<file>bitmaps/button_gui_down-black.png</file>
<file>bitmaps/button_gui_down-white.png</file>
<file>bitmaps/button_gui_hover-black.png</file>
<file>bitmaps/button_gui_hover-white.png</file>
<file>bitmaps/button_off.png</file>
<file>bitmaps/button_on.png</file>



+ 6
- 6
resources/ui/carla_about.ui View File

@@ -281,7 +281,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_21">
<widget class="QLabel" name="ico_example_gui">
<property name="minimumSize">
<size>
<width>22</width>
@@ -298,12 +298,12 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="../resources.qrc">:/bitmaps/button_gui_down.png</pixmap>
<pixmap resource="../resources.qrc">:/bitmaps/button_gui_down-white.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_17">
<widget class="QLabel" name="ico_example_edit">
<property name="minimumSize">
<size>
<width>22</width>
@@ -320,12 +320,12 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="../resources.qrc">:/bitmaps/button_edit_down.png</pixmap>
<pixmap resource="../resources.qrc">:/bitmaps/button_edit_down-white.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_22">
<widget class="QLabel" name="ico_example_file">
<property name="minimumSize">
<size>
<width>22</width>
@@ -342,7 +342,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="../resources.qrc">:/bitmaps/button_file_down.png</pixmap>
<pixmap resource="../resources.qrc">:/bitmaps/button_file_down-white.png</pixmap>
</property>
</widget>
</item>


+ 51
- 17
source/frontend/carla_skin.py View File

@@ -168,7 +168,7 @@ def getColorFromCategory(category):
# ------------------------------------------------------------------------------------------------------------
#

def setPixmapDialStyle(widget, parameterId, parameterCount, skinStyle):
def setPixmapDialStyle(widget, parameterId, parameterCount, darkStyle, skinStyle):
if skinStyle.startswith("calf"):
widget.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT)
widget.setPixmap(7)
@@ -185,8 +185,10 @@ def setPixmapDialStyle(widget, parameterId, parameterCount, skinStyle):
else:
if parameterId == PARAMETER_DRYWET:
widget.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_CARLA_WET)

elif parameterId == PARAMETER_VOLUME:
widget.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_CARLA_VOL)

else:
_r = 255 - int((float(parameterId)/float(parameterCount))*200.0)
_g = 55 + int((float(parameterId)/float(parameterCount))*200.0)
@@ -194,8 +196,15 @@ def setPixmapDialStyle(widget, parameterId, parameterCount, skinStyle):
widget.setCustomPaintColor(QColor(_r, _g, _b))
widget.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_COLOR)

if darkStyle:
colorEnabled = QColor("#BBB")
colorDisabled = QColor("#555")
else:
colorEnabled = QColor("#111")
colorDisabled = QColor("#AAA")

widget.setLabelColor(colorEnabled, colorDisabled)
widget.setPixmap(3)
widget.forceWhiteLabelGradientText()

# ------------------------------------------------------------------------------------------------------------
# Abstract plugin slot
@@ -218,6 +227,7 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta):
self.fPluginInfo = host.get_plugin_info(self.fPluginId)
self.fSkinColor = skinColor
self.fSkinStyle = skinStyle
self.fDarkStyle = QColor(skinColor[0], skinColor[1], skinColor[2]).blackF() > 0.4

# -------------------------------------------------------------
# Internal stuff
@@ -347,37 +357,54 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta):
def ready(self):
self.fIsActive = bool(self.host.get_internal_parameter_value(self.fPluginId, PARAMETER_ACTIVE) >= 0.5)

isCalfSkin = self.fSkinStyle.startswith("calf") and not isinstance(self, PluginSlot_Compact)
isCalfSkin = self.fSkinStyle.startswith("calf") and not isinstance(self, PluginSlot_Compact)
imageSuffix = "white" if self.fDarkStyle else "black"

if self.b_enable is not None:
self.b_enable.setChecked(self.fIsActive)
self.b_enable.clicked.connect(self.slot_enableClicked)

if isCalfSkin:
self.b_enable.setPixmaps(":/bitmaps/button_calf3.png", ":/bitmaps/button_calf3_down.png", ":/bitmaps/button_calf3.png")
self.b_enable.setPixmaps(":/bitmaps/button_calf3.png",
":/bitmaps/button_calf3_down.png",
":/bitmaps/button_calf3.png")
else:
self.b_enable.setPixmaps(":/bitmaps/button_off.png", ":/bitmaps/button_on.png", ":/bitmaps/button_off.png")
self.b_enable.setPixmaps(":/bitmaps/button_off.png",
":/bitmaps/button_on.png",
":/bitmaps/button_off.png")

if self.b_gui is not None:
self.b_gui.clicked.connect(self.slot_showCustomUi)
self.b_gui.setEnabled(bool(self.fPluginInfo['hints'] & PLUGIN_HAS_CUSTOM_UI))

if isCalfSkin:
self.b_gui.setPixmaps(":/bitmaps/button_calf2.png", ":/bitmaps/button_calf2_down.png", ":/bitmaps/button_calf2_hover.png")
self.b_gui.setPixmaps(":/bitmaps/button_calf2.png",
":/bitmaps/button_calf2_down.png",
":/bitmaps/button_calf2_hover.png")
elif self.fPluginInfo['iconName'] == "distrho" or self.fSkinStyle in ("3bandeq","3bandsplitter","pingpongpan", "nekobi"):
self.b_gui.setPixmaps(":/bitmaps/button_distrho.png", ":/bitmaps/button_distrho_down.png", ":/bitmaps/button_distrho_hover.png")
self.b_gui.setPixmaps(":/bitmaps/button_distrho-{}.png",
":/bitmaps/button_distrho_down-{}.png",
":/bitmaps/button_distrho_hover-{}.png")
elif self.fPluginInfo['iconName'] == "file":
self.b_gui.setPixmaps(":/bitmaps/button_file.png", ":/bitmaps/button_file_down.png", ":/bitmaps/button_file_hover.png")
self.b_gui.setPixmaps(":/bitmaps/button_file-{}.png".format(imageSuffix),
":/bitmaps/button_file_down-{}.png".format(imageSuffix),
":/bitmaps/button_file_hover-{}.png".format(imageSuffix))
else:
self.b_gui.setPixmaps(":/bitmaps/button_gui.png", ":/bitmaps/button_gui_down.png", ":/bitmaps/button_gui_hover.png")
self.b_gui.setPixmaps(":/bitmaps/button_gui-{}.png".format(imageSuffix),
":/bitmaps/button_gui_down-{}.png".format(imageSuffix),
":/bitmaps/button_gui_hover-{}.png".format(imageSuffix))

if self.b_edit is not None:
self.b_edit.clicked.connect(self.slot_showEditDialog)

if isCalfSkin:
self.b_edit.setPixmaps(":/bitmaps/button_calf2.png", ":/bitmaps/button_calf2_down.png", ":/bitmaps/button_calf2_hover.png")
self.b_edit.setPixmaps(":/bitmaps/button_calf2.png".format(imageSuffix),
":/bitmaps/button_calf2_down.png".format(imageSuffix),
":/bitmaps/button_calf2_hover.png".format(imageSuffix))
else:
self.b_edit.setPixmaps(":/bitmaps/button_edit.png", ":/bitmaps/button_edit_down.png", ":/bitmaps/button_edit_hover.png")
self.b_edit.setPixmaps(":/bitmaps/button_edit-{}.png".format(imageSuffix),
":/bitmaps/button_edit_down-{}.png".format(imageSuffix),
":/bitmaps/button_edit_hover-{}.png".format(imageSuffix))

else:
# Edit button *must* be available
@@ -494,6 +521,13 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta):
styleSheet2 = "background-color: rgb(%i, %i, %i);" % self.fSkinColor
styleSheet2 += "background-image: url(:/bitmaps/background_noise1.png);"

if self.fDarkStyle:
colorEnabled = "#BBB"
colorDisabled = "#555"
else:
colorEnabled = "#111"
colorDisabled = "#AAA"

styleSheet = """
QFrame#PluginWidget {
%s
@@ -503,9 +537,9 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta):
QLabel#label_audio_in,
QLabel#label_audio_out,
QLabel#label_midi,
QLabel#label_presets { color: #BBB; }
QLabel#label_name:disabled { color: #555; }
""" % styleSheet2
QLabel#label_presets { color: %s; }
QLabel#label_name:disabled { color: %s; }
""" % (styleSheet2, colorEnabled, colorDisabled)

styleSheet += """
QComboBox#cb_presets,
@@ -560,7 +594,7 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta):
if isInteger:
widget.setPrecision(paramRanges['max']-paramRanges['min'], True)

setPixmapDialStyle(widget, i, parameterCount, self.fSkinStyle)
setPixmapDialStyle(widget, i, parameterCount, self.fDarkStyle, self.fSkinStyle)

index += 1
self.fParameterList.append([i, widget])
@@ -571,7 +605,7 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta):
widget.setLabel("Dry/Wet")
widget.setMinimum(0.0)
widget.setMaximum(1.0)
setPixmapDialStyle(widget, PARAMETER_DRYWET, 0, self.fSkinStyle)
setPixmapDialStyle(widget, PARAMETER_DRYWET, 0, self.fDarkStyle, self.fSkinStyle)

self.fParameterList.append([PARAMETER_DRYWET, widget])
self.w_knobs_right.layout().addWidget(widget)
@@ -581,7 +615,7 @@ class AbstractPluginSlot(QFrame, PluginEditParentMeta):
widget.setLabel("Volume")
widget.setMinimum(0.0)
widget.setMaximum(1.27)
setPixmapDialStyle(widget, PARAMETER_VOLUME, 0, self.fSkinStyle)
setPixmapDialStyle(widget, PARAMETER_VOLUME, 0, self.fDarkStyle, self.fSkinStyle)

self.fParameterList.append([PARAMETER_VOLUME, widget])
self.w_knobs_right.layout().addWidget(widget)


+ 4
- 3
source/frontend/carla_widgets.py View File

@@ -79,10 +79,11 @@ class CarlaAboutW(QDialog):
"<br>Copyright (C) 2011-2018 falkTX<br>"
"" % (VERSION, extraInfo)))

if self.ui.about.palette().color(QPalette.Background).blackF() > 0.5:
self.ui.l_icons.setPixmap(QPixmap(":/bitmaps/carla_about_white.png"))
else:
if self.ui.about.palette().color(QPalette.Background).blackF() < 0.5:
self.ui.l_icons.setPixmap(QPixmap(":/bitmaps/carla_about_black.png"))
self.ui.ico_example_edit.setPixmap(QPixmap(":/bitmaps/button_file-black.png"))
self.ui.ico_example_file.setPixmap(QPixmap(":/bitmaps/button_edit-black.png"))
self.ui.ico_example_gui.setPixmap(QPixmap(":/bitmaps/button_gui-black.png"))

if host.isControl:
self.ui.l_extended.hide()


+ 5
- 0
source/frontend/widgets/pixmapdial.py View File

@@ -140,6 +140,11 @@ class PixmapDial(QDial):
self.fLabelGradientColor2 = QColor(0, 0, 0, 0)
self.fLabelGradientColorT = [Qt.white, Qt.darkGray]

def setLabelColor(self, enabled, disabled):
self.fLabelGradientColor1 = QColor(0, 0, 0, 255)
self.fLabelGradientColor2 = QColor(0, 0, 0, 0)
self.fLabelGradientColorT = [enabled, disabled]

def updateSizes(self):
self.fPixmapWidth = self.fPixmap.width()
self.fPixmapHeight = self.fPixmap.height()


Loading…
Cancel
Save