Skip to content

Commit

Permalink
fix(cpn): screen colors in simulator for B&W OLED radios (#4779)
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz authored and pfeerick committed Mar 20, 2024
1 parent 64732d7 commit 0dda69c
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 187 deletions.
Binary file modified companion/src/images/simulator/JumperTPRO/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified companion/src/images/simulator/JumperTPRO/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified companion/src/images/simulator/JumperTPRO/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified companion/src/images/simulator/JumperTPRO/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified companion/src/images/simulator/LR3PRO/bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified companion/src/images/simulator/LR3PRO/top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions companion/src/simulation/simulateduiwidgetJumperT20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ SimulatedUIWidgetJumperT20::SimulatedUIWidgetJumperT20(SimulatorInterface *simul
m_backlightColors << QColor(255,195,151);
m_backlightColors << QColor(247,242,159);

ui->lcd->setBgDefaultColor(QColor(0, 0, 0));
ui->lcd->setFgDefaultColor(QColor(255, 255, 255));

setLcd(ui->lcd);

QString css = "#radioUiWidget {"
"background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1,"
"stop:0 rgba(255, 255, 255, 255),"
"stop:0.757062 rgba(241, 238, 238, 255),"
"stop:1 rgba(247, 245, 245, 255));"
"background-color: rgb(200, 200, 200);"
"}";

QTimer * tim = new QTimer(this);
Expand Down
11 changes: 7 additions & 4 deletions companion/src/simulation/simulateduiwidgetJumperTPRO.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetJumperTPRO.h"
#include "eeprominterface.h"

// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h

Expand Down Expand Up @@ -31,13 +32,15 @@ SimulatedUIWidgetJumperTPRO::SimulatedUIWidgetJumperTPRO(SimulatorInterface *sim
m_backlightColors << QColor(255,195,151);
m_backlightColors << QColor(247,242,159);

if (getCurrentBoard() == Board::BOARD_JUMPER_TPROV2) {
ui->lcd->setBgDefaultColor(QColor(0, 0, 0));
ui->lcd->setFgDefaultColor(QColor(255, 255, 255));
}

setLcd(ui->lcd);

QString css = "#radioUiWidget {"
"background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1,"
"stop:0 rgba(255, 255, 255, 255),"
"stop:0.757062 rgba(241, 238, 238, 255),"
"stop:1 rgba(247, 245, 245, 255));"
"background-color: rgb(167, 167, 167);"
"}";

QTimer * tim = new QTimer(this);
Expand Down
104 changes: 21 additions & 83 deletions companion/src/simulation/simulateduiwidgetJumperTPRO.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>725</width>
<height>389</height>
<width>726</width>
<height>368</height>
</rect>
</property>
<property name="sizePolicy">
Expand All @@ -18,14 +18,14 @@
</property>
<property name="minimumSize">
<size>
<width>725</width>
<height>389</height>
<width>726</width>
<height>368</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>501</width>
<height>310 </height>
<width>726</width>
<height>368</height>
</size>
</property>
<property name="windowTitle">
Expand All @@ -50,7 +50,7 @@
<property name="spacing">
<number>0</number>
</property>
<item row="1" column="0" rowspan="3">
<item row="0" column="0" rowspan="3">
<widget class="ButtonsWidget" name="leftbuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
Expand All @@ -75,7 +75,7 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="LcdWidget" name="lcd" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
Expand All @@ -86,21 +86,21 @@
<property name="minimumSize">
<size>
<width>256</width>
<height>231</height>
<height>128</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>256</width>
<height>231</height>
<height>128</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(215, 243, 255);</string>
</property>
</widget>
</item>
<item row="1" column="2" rowspan="3">
<item row="0" column="2" rowspan="3">
<widget class="ButtonsWidget" name="rightbuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
Expand All @@ -125,7 +125,7 @@
</property>
</widget>
</item>
<item row="1" column="1">
<item row="0" column="1">
<widget class="QWidget" name="top" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
Expand All @@ -135,22 +135,22 @@
</property>
<property name="minimumSize">
<size>
<width>255</width>
<height>85</height>
<width>256</width>
<height>97</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>255</width>
<height>85</height>
<width>256</width>
<height>97</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/JumperTPRO/top.png)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="2" column="1">
<widget class="ButtonsWidget" name="bottombuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
Expand All @@ -160,83 +160,21 @@
</property>
<property name="minimumSize">
<size>
<width>255</width>
<height>131</height>
<width>256</width>
<height>143</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>255</width>
<height>131</height>
<width>256</width>
<height>143</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/JumperTPRO/bottom.png)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>12</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>12</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>10</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(247, 245, 245);</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
Expand Down
3 changes: 3 additions & 0 deletions companion/src/simulation/simulateduiwidgetLR3PRO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ SimulatedUIWidgetLR3PRO::SimulatedUIWidgetLR3PRO(SimulatorInterface *simulator,
m_backlightColors << QColor(255,195,151);
m_backlightColors << QColor(247,242,159);

ui->lcd->setBgDefaultColor(QColor(0, 0, 0));
ui->lcd->setFgDefaultColor(QColor(255, 255, 255));

setLcd(ui->lcd);

QString css = "#radioUiWidget {"
Expand Down
Loading

0 comments on commit 0dda69c

Please sign in to comment.