fix(v14): OLED brightness wraps above 235 (#7633)

Co-authored-by: Peter Feerick <5500713+pfeerick@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Peter Feerick
2026-08-12 07:25:11 +10:00
committed by GitHub
co-authored by Peter Feerick Claude Sonnet 5
parent c8499366a2
commit b6e52f5ee3
5 changed files with 21 additions and 21 deletions
+6 -2
View File
@@ -390,7 +390,9 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
IS_RADIOMASTER_ZORRO(board);
case MaxContrast:
if (IS_TARANIS_SMALL(board))
if (getCapability(board, LcdOLED))
return 254;
else if (IS_TARANIS_SMALL(board))
return 30;
else
return 45;
@@ -399,7 +401,9 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return 23;
case MinContrast:
if (IS_TARANIS_X9(board))
if (getCapability(board, LcdOLED))
return 2;
else if (IS_TARANIS_X9(board))
return 0;
else
return 10;
@@ -141,6 +141,15 @@ ui(new Ui::GeneralSetup)
ui->contrastSB->setMaximum(Boards::getCapability(board, Board::MaxContrast));
ui->contrastSB->setValue(generalSettings.contrast);
if (Boards::getCapability(board, Board::LcdOLED)) {
// OLED radios have no backlight - "contrast" is the panel brightness
ui->label_contrast->setText(tr("Brightness"));
ui->BLBright_SB->hide();
ui->BLBright_SB->setDisabled(true);
ui->label_BLBright->hide();
ui->blAlarm_LB->setText(tr("Flash display on alarm"));
}
ui->battwarningDSB->setValue((double)generalSettings.vBatWarn / 10);
ui->backlightautoSB->setValue(generalSettings.backlightDelay * 5);
ui->inactimerSB->setValue(generalSettings.inactivityTimer);
+2 -15
View File
@@ -327,9 +327,6 @@ Mode 4:
<height>0</height>
</size>
</property>
<property name="toolTip">
<string extracomment="Screen Contrast [20-45]"/>
</property>
<property name="text">
<string>Contrast</string>
</property>
@@ -659,12 +656,7 @@ p, li { white-space: pre-wrap; }
<string/>
</property>
<property name="whatsThis">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;LCD Screen Contrast&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Values can be 20-45&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string/>
</property>
<property name="suffix">
<string> ms</string>
@@ -1740,12 +1732,7 @@ p, li { white-space: pre-wrap; }
<string/>
</property>
<property name="whatsThis">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;LCD Screen Contrast&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;Values can be 20-45&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string/>
</property>
<property name="minimum">
<number>1</number>