diff --git a/resources/bitmaps/dial_12.png b/resources/bitmaps/dial_12.png new file mode 100644 index 000000000..2bf1674c5 Binary files /dev/null and b/resources/bitmaps/dial_12.png differ diff --git a/resources/bitmaps/dial_12d.png b/resources/bitmaps/dial_12d.png new file mode 100644 index 000000000..6843e47b9 Binary files /dev/null and b/resources/bitmaps/dial_12d.png differ diff --git a/resources/bitmaps/dial_13.png b/resources/bitmaps/dial_13.png new file mode 100644 index 000000000..1da62431e Binary files /dev/null and b/resources/bitmaps/dial_13.png differ diff --git a/resources/bitmaps/dial_13d.png b/resources/bitmaps/dial_13d.png new file mode 100644 index 000000000..6843e47b9 Binary files /dev/null and b/resources/bitmaps/dial_13d.png differ diff --git a/resources/resources.qrc b/resources/resources.qrc index c026bd093..2b4c8e340 100644 --- a/resources/resources.qrc +++ b/resources/resources.qrc @@ -100,6 +100,10 @@ bitmaps/dial_10d.png bitmaps/dial_11.png bitmaps/dial_11d.png + bitmaps/dial_12.png + bitmaps/dial_12d.png + bitmaps/dial_13.png + bitmaps/dial_13d.png bitmaps/kbd_h_dark.png bitmaps/kbd_v_dark.png diff --git a/source/carla_skin.py b/source/carla_skin.py index c509e91a7..18a168d41 100644 --- a/source/carla_skin.py +++ b/source/carla_skin.py @@ -42,6 +42,7 @@ import ui_carla_plugin_zita import ui_carla_plugin_zynfx from carla_widgets import * +from digitalpeakmeter import DigitalPeakMeter from pixmapdial import PixmapDial # ------------------------------------------------------------------------------------------------------------ @@ -1081,36 +1082,73 @@ class PluginSlot_BasicFX(AbstractPluginSlot): # ------------------------------------------------------------------------------------------------------------ -class PluginSlot_OpenAV(AbstractPluginSlot): +class PluginSlot_Calf(AbstractPluginSlot): def __init__(self, parent, host, pluginId): AbstractPluginSlot.__init__(self, parent, host, pluginId) - self.ui = ui_carla_plugin_basic_fx.Ui_PluginWidget() + self.ui = ui_carla_plugin_calf.Ui_PluginWidget() self.ui.setupUi(self) + audioCount = self.host.get_audio_port_count_info(self.fPluginId) + midiCount = self.host.get_midi_port_count_info(self.fPluginId) + # ------------------------------------------------------------- - # Set-up GUI + # Internal stuff - QFontDatabase.addApplicationFont(":/fonts/uranium.ttf") + self.fButtonFont = self.ui.b_gui.font() + self.fButtonFont.setBold(False) + self.fButtonFont.setPointSize(8) - labelFont = QFont() - labelFont.setFamily("Uranium") - labelFont.setPointSize(13) - labelFont.setCapitalization(QFont.AllUppercase) - self.ui.label_name.setFont(labelFont) + # Use black for mono plugins + self.fBackgroundBlack = audioCount['ins'] == 1 + + self.fButtonColorOn = QColor( 18, 41, 87) + self.fButtonColorOff = QColor(150, 150, 150) + + # ------------------------------------------------------------- + # Set-up GUI self.setStyleSheet(""" - PluginSlot_OpenAV#PluginWidget { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #303030, stop: 0.35 #111111, stop: 1.0 #111111); + QLabel#label_name, QLabel#label_audio_in, QLabel#label_audio_out, QLabel#label_midi { + color: #BBB; } - """) + PluginSlot_Calf#PluginWidget { + background-image: url(:/bitmaps/background_calf_%s.png); + background-repeat: repeat-xy; + border: 2px; + } + """ % ("black" if self.fBackgroundBlack else "blue")) - self.ui.label_name.setStyleSheet("* { color: #FF5100; }") - #self.ui.line.setStyleSheet("* { background-color: #FF5100; color: #FF5100; }") + self.ui.b_gui.setPixmaps(":/bitmaps/button_calf2.png", ":/bitmaps/button_calf2_down.png", ":/bitmaps/button_calf2_hover.png") + self.ui.b_edit.setPixmaps(":/bitmaps/button_calf2.png", ":/bitmaps/button_calf2_down.png", ":/bitmaps/button_calf2_hover.png") + self.ui.b_remove.setPixmaps(":/bitmaps/button_calf1.png", ":/bitmaps/button_calf1_down.png", ":/bitmaps/button_calf1_hover.png") - self.ui.b_enable.setPixmaps(":/bitmaps/button_off.png", ":/bitmaps/button_on.png", ":/bitmaps/button_off.png") - self.ui.b_edit.setPixmaps(":/bitmaps/button_edit.png", ":/bitmaps/button_edit_down.png", ":/bitmaps/button_edit_hover.png") - self.ui.b_gui.setPixmaps(":/bitmaps/button_gui.png", ":/bitmaps/button_gui_down.png", ":/bitmaps/button_gui_hover.png") + self.ui.b_edit.setTopText(self.tr("Edit"), self.fButtonColorOn, self.fButtonFont) + self.ui.b_remove.setTopText(self.tr("Remove"), self.fButtonColorOn, self.fButtonFont) + + if self.fPluginInfo['hints'] & PLUGIN_HAS_CUSTOM_UI: + self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOn, self.fButtonFont) + else: + self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOff, self.fButtonFont) + + labelFont = self.ui.label_name.font() + labelFont.setBold(True) + labelFont.setPointSize(10) + self.ui.label_name.setFont(labelFont) + + if audioCount['ins'] == 0: + self.ui.label_audio_in.hide() + self.ui.peak_in.hide() + + if audioCount['outs'] > 0: + self.ui.peak_out.setMinimumWidth(200) + + if audioCount['outs'] == 0: + self.ui.label_audio_out.hide() + self.ui.peak_out.hide() + + if midiCount['ins'] == 0: + self.ui.label_midi.hide() + self.ui.led_midi.hide() # ------------------------------------------------------------- # Set-up parameters @@ -1118,8 +1156,9 @@ class PluginSlot_OpenAV(AbstractPluginSlot): parameterCount = self.host.get_parameter_count(self.fPluginId) index = 0 + limit = 7 if midiCount['ins'] == 0 else 6 for i in range(parameterCount): - if index >= 8: + if index >= limit: break paramInfo = self.host.get_parameter_info(self.fPluginId, i) @@ -1136,7 +1175,7 @@ class PluginSlot_OpenAV(AbstractPluginSlot): paramName = getParameterShortName(paramInfo['name']) widget = PixmapDial(self, i) - widget.setPixmap(11) + widget.setPixmap(7) widget.setLabel(paramName) widget.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT) widget.setMinimum(paramRanges['min']) @@ -1150,49 +1189,38 @@ class PluginSlot_OpenAV(AbstractPluginSlot): self.fParameterList.append([i, widget]) - self.ui.dial_drywet.setIndex(PARAMETER_DRYWET) - self.ui.dial_drywet.setPixmap(11) - self.ui.dial_drywet.setLabel("Dry/Wet") - self.ui.dial_drywet.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT) - self.ui.dial_drywet.setMinimum(0.0) - self.ui.dial_drywet.setMaximum(1.0) - self.ui.dial_drywet.setVisible(self.fPluginInfo['hints'] & PLUGIN_CAN_DRYWET) - - self.ui.dial_vol.setIndex(PARAMETER_VOLUME) - self.ui.dial_vol.setPixmap(11) - self.ui.dial_vol.setLabel("Volume") - self.ui.dial_vol.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT) - self.ui.dial_vol.setMinimum(0.0) - self.ui.dial_vol.setMaximum(1.27) - self.ui.dial_vol.setVisible(self.fPluginInfo['hints'] & PLUGIN_CAN_VOLUME) - - self.fParameterList.append([PARAMETER_DRYWET, self.ui.dial_drywet]) - self.fParameterList.append([PARAMETER_VOLUME, self.ui.dial_vol]) - # ------------------------------------------------------------- - self.b_enable = self.ui.b_enable self.b_gui = self.ui.b_gui self.b_edit = self.ui.b_edit + self.b_remove = self.ui.b_remove self.label_name = self.ui.label_name - - self.led_control = self.ui.led_control - self.led_midi = self.ui.led_midi - self.led_audio_in = self.ui.led_audio_in - self.led_audio_out = self.ui.led_audio_out + self.led_midi = self.ui.led_midi self.peak_in = self.ui.peak_in self.peak_out = self.ui.peak_out self.ready() + self.ui.led_midi.setColor(self.ui.led_midi.CALF) + self.customContextMenuRequested.connect(self.slot_showDefaultCustomMenu) #------------------------------------------------------------------ def getFixedHeight(self): - return 79 + return 88 + + #------------------------------------------------------------------ + + def pluginHintsChanged(self, hints): + if hints & PLUGIN_HAS_CUSTOM_UI: + self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOn, self.fButtonFont) + else: + self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOff, self.fButtonFont) + + AbstractPluginSlot.pluginHintsChanged(self, hints) #------------------------------------------------------------------ @@ -1200,83 +1228,49 @@ class PluginSlot_OpenAV(AbstractPluginSlot): painter = QPainter(self) painter.setBrush(Qt.transparent) - painter.setPen(QPen(QColor(42, 42, 42), 1)) - painter.drawRect(0, 1, self.width()-1, 79-3) + painter.setPen(QPen(QColor(20, 20, 20) if self.fBackgroundBlack else QColor(75, 86, 99), 1)) + painter.drawRect(0, 1, self.width()-1, 88-3) - painter.setPen(QPen(QColor(60, 60, 60), 1)) + painter.setPen(QPen(QColor(45, 45, 45) if self.fBackgroundBlack else QColor(86, 99, 114), 1)) painter.drawLine(0, 0, self.width(), 0) AbstractPluginSlot.paintEvent(self, event) # ------------------------------------------------------------------------------------------------------------ -class PluginSlot_Calf(AbstractPluginSlot): +class PluginSlot_OpenAV(AbstractPluginSlot): def __init__(self, parent, host, pluginId): AbstractPluginSlot.__init__(self, parent, host, pluginId) - self.ui = ui_carla_plugin_calf.Ui_PluginWidget() + self.ui = ui_carla_plugin_basic_fx.Ui_PluginWidget() self.ui.setupUi(self) - audioCount = self.host.get_audio_port_count_info(self.fPluginId) - midiCount = self.host.get_midi_port_count_info(self.fPluginId) - - # ------------------------------------------------------------- - # Internal stuff - - self.fButtonFont = self.ui.b_gui.font() - self.fButtonFont.setBold(False) - self.fButtonFont.setPointSize(8) - - # Use black for mono plugins - self.fBackgroundBlack = audioCount['ins'] == 1 - - self.fButtonColorOn = QColor( 18, 41, 87) - self.fButtonColorOff = QColor(150, 150, 150) - # ------------------------------------------------------------- # Set-up GUI - self.setStyleSheet(""" - QLabel#label_name, QLabel#label_audio_in, QLabel#label_audio_out, QLabel#label_midi { - color: #BBB; - } - PluginSlot_Calf#PluginWidget { - background-image: url(:/bitmaps/background_calf_%s.png); - background-repeat: repeat-xy; - border: 2px; - } - """ % ("black" if self.fBackgroundBlack else "blue")) - - self.ui.b_gui.setPixmaps(":/bitmaps/button_calf2.png", ":/bitmaps/button_calf2_down.png", ":/bitmaps/button_calf2_hover.png") - self.ui.b_edit.setPixmaps(":/bitmaps/button_calf2.png", ":/bitmaps/button_calf2_down.png", ":/bitmaps/button_calf2_hover.png") - self.ui.b_remove.setPixmaps(":/bitmaps/button_calf1.png", ":/bitmaps/button_calf1_down.png", ":/bitmaps/button_calf1_hover.png") - - self.ui.b_edit.setTopText(self.tr("Edit"), self.fButtonColorOn, self.fButtonFont) - self.ui.b_remove.setTopText(self.tr("Remove"), self.fButtonColorOn, self.fButtonFont) - - if self.fPluginInfo['hints'] & PLUGIN_HAS_CUSTOM_UI: - self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOn, self.fButtonFont) - else: - self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOff, self.fButtonFont) + QFontDatabase.addApplicationFont(":/fonts/uranium.ttf") - labelFont = self.ui.label_name.font() - labelFont.setBold(True) - labelFont.setPointSize(10) + labelFont = QFont() + labelFont.setFamily("Uranium") + labelFont.setPointSize(13) + labelFont.setCapitalization(QFont.AllUppercase) self.ui.label_name.setFont(labelFont) - if audioCount['ins'] == 0: - self.ui.label_audio_in.hide() - self.ui.peak_in.hide() + self.setStyleSheet(""" + PluginSlot_OpenAV#PluginWidget { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #303030, stop: 0.35 #111111, stop: 1.0 #111111); + } + """) - if audioCount['outs'] > 0: - self.ui.peak_out.setMinimumWidth(200) + self.ui.label_name.setStyleSheet("* { color: #FF5100; }") + #self.ui.line.setStyleSheet("* { background-color: #FF5100; color: #FF5100; }") - if audioCount['outs'] == 0: - self.ui.label_audio_out.hide() - self.ui.peak_out.hide() + self.ui.peak_in.setMeterStyle(DigitalPeakMeter.STYLE_OPENAV) + self.ui.peak_out.setMeterStyle(DigitalPeakMeter.STYLE_OPENAV) - if midiCount['ins'] == 0: - self.ui.label_midi.hide() - self.ui.led_midi.hide() + self.ui.b_enable.setPixmaps(":/bitmaps/button_off.png", ":/bitmaps/button_on.png", ":/bitmaps/button_off.png") + self.ui.b_edit.setPixmaps(":/bitmaps/button_edit.png", ":/bitmaps/button_edit_down.png", ":/bitmaps/button_edit_hover.png") + self.ui.b_gui.setPixmaps(":/bitmaps/button_gui.png", ":/bitmaps/button_gui_down.png", ":/bitmaps/button_gui_hover.png") # ------------------------------------------------------------- # Set-up parameters @@ -1284,9 +1278,8 @@ class PluginSlot_Calf(AbstractPluginSlot): parameterCount = self.host.get_parameter_count(self.fPluginId) index = 0 - limit = 7 if midiCount['ins'] == 0 else 6 for i in range(parameterCount): - if index >= limit: + if index >= 8: break paramInfo = self.host.get_parameter_info(self.fPluginId, i) @@ -1303,7 +1296,7 @@ class PluginSlot_Calf(AbstractPluginSlot): paramName = getParameterShortName(paramInfo['name']) widget = PixmapDial(self, i) - widget.setPixmap(7) + widget.setPixmap(11) widget.setLabel(paramName) widget.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT) widget.setMinimum(paramRanges['min']) @@ -1317,38 +1310,49 @@ class PluginSlot_Calf(AbstractPluginSlot): self.fParameterList.append([i, widget]) + self.ui.dial_drywet.setIndex(PARAMETER_DRYWET) + self.ui.dial_drywet.setPixmap(13) + self.ui.dial_drywet.setLabel("Dry/Wet") + self.ui.dial_drywet.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT) + self.ui.dial_drywet.setMinimum(0.0) + self.ui.dial_drywet.setMaximum(1.0) + self.ui.dial_drywet.setVisible(self.fPluginInfo['hints'] & PLUGIN_CAN_DRYWET) + + self.ui.dial_vol.setIndex(PARAMETER_VOLUME) + self.ui.dial_vol.setPixmap(12) + self.ui.dial_vol.setLabel("Volume") + self.ui.dial_vol.setCustomPaintMode(PixmapDial.CUSTOM_PAINT_MODE_NO_GRADIENT) + self.ui.dial_vol.setMinimum(0.0) + self.ui.dial_vol.setMaximum(1.27) + self.ui.dial_vol.setVisible(self.fPluginInfo['hints'] & PLUGIN_CAN_VOLUME) + + self.fParameterList.append([PARAMETER_DRYWET, self.ui.dial_drywet]) + self.fParameterList.append([PARAMETER_VOLUME, self.ui.dial_vol]) + # ------------------------------------------------------------- + self.b_enable = self.ui.b_enable self.b_gui = self.ui.b_gui self.b_edit = self.ui.b_edit - self.b_remove = self.ui.b_remove self.label_name = self.ui.label_name - self.led_midi = self.ui.led_midi + + self.led_control = self.ui.led_control + self.led_midi = self.ui.led_midi + self.led_audio_in = self.ui.led_audio_in + self.led_audio_out = self.ui.led_audio_out self.peak_in = self.ui.peak_in self.peak_out = self.ui.peak_out self.ready() - self.ui.led_midi.setColor(self.ui.led_midi.CALF) - self.customContextMenuRequested.connect(self.slot_showDefaultCustomMenu) #------------------------------------------------------------------ def getFixedHeight(self): - return 88 - - #------------------------------------------------------------------ - - def pluginHintsChanged(self, hints): - if hints & PLUGIN_HAS_CUSTOM_UI: - self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOn, self.fButtonFont) - else: - self.ui.b_gui.setTopText(self.tr("GUI"), self.fButtonColorOff, self.fButtonFont) - - AbstractPluginSlot.pluginHintsChanged(self, hints) + return 79 #------------------------------------------------------------------ @@ -1356,10 +1360,10 @@ class PluginSlot_Calf(AbstractPluginSlot): painter = QPainter(self) painter.setBrush(Qt.transparent) - painter.setPen(QPen(QColor(20, 20, 20) if self.fBackgroundBlack else QColor(75, 86, 99), 1)) - painter.drawRect(0, 1, self.width()-1, 88-3) + painter.setPen(QPen(QColor(42, 42, 42), 1)) + painter.drawRect(0, 1, self.width()-1, 79-3) - painter.setPen(QPen(QColor(45, 45, 45) if self.fBackgroundBlack else QColor(86, 99, 114), 1)) + painter.setPen(QPen(QColor(60, 60, 60), 1)) painter.drawLine(0, 0, self.width(), 0) AbstractPluginSlot.paintEvent(self, event) @@ -1595,6 +1599,9 @@ class PluginSlot_ZynFX(AbstractPluginSlot): presetFont.setPointSize(8) self.ui.label_presets.setFont(presetFont) + self.ui.peak_in.setMeterStyle(DigitalPeakMeter.STYLE_OPENAV) + self.ui.peak_out.setMeterStyle(DigitalPeakMeter.STYLE_OPENAV) + # ------------------------------------------------------------- # Set-up parameters @@ -1764,7 +1771,7 @@ class PluginSlot_ZynFX(AbstractPluginSlot): #------------------------------------------------------------------ def getFixedHeight(self): - return 74 + return 75 #------------------------------------------------------------------ diff --git a/source/widgets/digitalpeakmeter.py b/source/widgets/digitalpeakmeter.py index 1e6f51a5c..9fd9a049d 100644 --- a/source/widgets/digitalpeakmeter.py +++ b/source/widgets/digitalpeakmeter.py @@ -44,6 +44,10 @@ class DigitalPeakMeter(QWidget): GREEN = 1 BLUE = 2 + # enum Style + STYLE_DEFAULT = 0 + STYLE_OPENAV = 1 + def __init__(self, parent): QWidget.__init__(self, parent) @@ -55,6 +59,8 @@ class DigitalPeakMeter(QWidget): self.fColorBackground = QColor("#111111") self.fGradientMeter = QLinearGradient(0, 0, 1, 1) + self.fMeterStyle = self.STYLE_DEFAULT + self.setChannels(0) self.setColor(self.GREEN) @@ -104,13 +110,22 @@ class DigitalPeakMeter(QWidget): self.setOrientation(self.fOrientation) + def setMeterStyle(self, style): + self.fMeterStyle = style + self.setOrientation(self.fOrientation) + def setLinesEnabled(self, yesNo): self.fDrawLines = yesNo def setOrientation(self, orientation): - self.fOrientation = orientation + self.fOrientation = orientation + self.fGradientMeter = QLinearGradient(0, 0, 1, 1) - if self.fOrientation == self.HORIZONTAL: + if self.fMeterStyle == self.STYLE_OPENAV: + self.fGradientMeter.setColorAt(0.0, self.fColorBase) + self.fGradientMeter.setColorAt(1.0, self.fColorBase) + + elif self.fOrientation == self.HORIZONTAL: self.fGradientMeter.setColorAt(0.0, self.fColorBase) self.fGradientMeter.setColorAt(0.2, self.fColorBase) self.fGradientMeter.setColorAt(0.4, self.fColorBase) @@ -166,14 +181,29 @@ class DigitalPeakMeter(QWidget): painter = QPainter(self) event.accept() - painter.setPen(Qt.black) - painter.setBrush(Qt.black) + if self.fMeterStyle == self.STYLE_OPENAV: + painter.setPen(QColor("#1A1A1A")) + painter.setBrush(QColor("#1A1A1A")) + else: + painter.setPen(Qt.black) + painter.setBrush(Qt.black) + painter.drawRect(0, 0, self.fWidth, self.fHeight) - meterX = 0 + meterX = 0 + startX = -1 if self.fMeterStyle == self.STYLE_OPENAV else 0 + padding = 2 if self.fMeterStyle == self.STYLE_OPENAV else 0 + painter.setPen(self.fColorBackground) painter.setBrush(self.fGradientMeter) + if self.fMeterStyle == self.STYLE_OPENAV: + color = self.fGradientMeter.stops()[0][1] + painter.setPen(color) + color.setAlphaF(0.5) + painter.setBrush(color) + del color + for i in range(self.fChannels): level = self.fChannelsData[i] @@ -185,7 +215,7 @@ class DigitalPeakMeter(QWidget): value = 0.0 if self.fOrientation == self.HORIZONTAL: - painter.drawRect(0, meterX, int(value), self.fSizeMeter) + painter.drawRect(startX, meterX+padding, int(value), self.fSizeMeter-padding*(1 if self.fChannels > 1 else 2)) elif self.fOrientation == self.VERTICAL: painter.drawRect(meterX, int(value), self.fSizeMeter, self.fHeight) @@ -201,46 +231,61 @@ class DigitalPeakMeter(QWidget): lsmall = float(self.fWidth) lfull = float(self.fHeight - 1) - # Base - painter.setPen(self.fColorBaseAlt) - painter.drawLine(lsmall * 0.25, 2, lsmall * 0.25, lfull-2.0) - painter.drawLine(lsmall * 0.50, 2, lsmall * 0.50, lfull-2.0) + if self.fMeterStyle == self.STYLE_OPENAV: + painter.setPen(QColor(37, 37, 37, 100)) + painter.drawLine(lsmall * 0.25, 2, lsmall * 0.25, lfull-2.0) + painter.drawLine(lsmall * 0.50, 2, lsmall * 0.50, lfull-2.0) + painter.drawLine(lsmall * 0.75, 2, lsmall * 0.75, lfull-2.0) - # Yellow - painter.setPen(QColor(110, 110, 15, 100)) - painter.drawLine(lsmall * 0.70, 2, lsmall * 0.70, lfull-2.0) - painter.drawLine(lsmall * 0.83, 2, lsmall * 0.83, lfull-2.0) + if self.fChannels > 1: + painter.drawLine(1, lfull/2, lsmall-1, lfull/2) + + else: + # Base + painter.setPen(self.fColorBaseAlt) + painter.drawLine(lsmall * 0.25, 2, lsmall * 0.25, lfull-2.0) + painter.drawLine(lsmall * 0.50, 2, lsmall * 0.50, lfull-2.0) - # Orange - painter.setPen(QColor(180, 110, 15, 100)) - painter.drawLine(lsmall * 0.90, 2, lsmall * 0.90, lfull-2.0) + # Yellow + painter.setPen(QColor(110, 110, 15, 100)) + painter.drawLine(lsmall * 0.70, 2, lsmall * 0.70, lfull-2.0) + painter.drawLine(lsmall * 0.83, 2, lsmall * 0.83, lfull-2.0) - # Red - painter.setPen(QColor(110, 15, 15, 100)) - painter.drawLine(lsmall * 0.96, 2, lsmall * 0.96, lfull-2.0) + # Orange + painter.setPen(QColor(180, 110, 15, 100)) + painter.drawLine(lsmall * 0.90, 2, lsmall * 0.90, lfull-2.0) + + # Red + painter.setPen(QColor(110, 15, 15, 100)) + painter.drawLine(lsmall * 0.96, 2, lsmall * 0.96, lfull-2.0) elif self.fOrientation == self.VERTICAL: # Variables lsmall = float(self.fHeight) lfull = float(self.fWidth - 1) - # Base - painter.setPen(self.fColorBaseAlt) - painter.drawLine(2, lsmall - (lsmall * 0.25), lfull-2.0, lsmall - (lsmall * 0.25)) - painter.drawLine(2, lsmall - (lsmall * 0.50), lfull-2.0, lsmall - (lsmall * 0.50)) - - # Yellow - painter.setPen(QColor(110, 110, 15, 100)) - painter.drawLine(2, lsmall - (lsmall * 0.70), lfull-2.0, lsmall - (lsmall * 0.70)) - painter.drawLine(2, lsmall - (lsmall * 0.82), lfull-2.0, lsmall - (lsmall * 0.82)) + if self.fMeterStyle == self.STYLE_OPENAV: + # TODO + pass - # Orange - painter.setPen(QColor(180, 110, 15, 100)) - painter.drawLine(2, lsmall - (lsmall * 0.90), lfull-2.0, lsmall - (lsmall * 0.90)) - - # Red - painter.setPen(QColor(110, 15, 15, 100)) - painter.drawLine(2, lsmall - (lsmall * 0.96), lfull-2.0, lsmall - (lsmall * 0.96)) + else: + # Base + painter.setPen(self.fColorBaseAlt) + painter.drawLine(2, lsmall - (lsmall * 0.25), lfull-2.0, lsmall - (lsmall * 0.25)) + painter.drawLine(2, lsmall - (lsmall * 0.50), lfull-2.0, lsmall - (lsmall * 0.50)) + + # Yellow + painter.setPen(QColor(110, 110, 15, 100)) + painter.drawLine(2, lsmall - (lsmall * 0.70), lfull-2.0, lsmall - (lsmall * 0.70)) + painter.drawLine(2, lsmall - (lsmall * 0.82), lfull-2.0, lsmall - (lsmall * 0.82)) + + # Orange + painter.setPen(QColor(180, 110, 15, 100)) + painter.drawLine(2, lsmall - (lsmall * 0.90), lfull-2.0, lsmall - (lsmall * 0.90)) + + # Red + painter.setPen(QColor(110, 15, 15, 100)) + painter.drawLine(2, lsmall - (lsmall * 0.96), lfull-2.0, lsmall - (lsmall * 0.96)) def resizeEvent(self, event): self.updateSizes()