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:
co-authored by
Peter Feerick
Claude Sonnet 5
parent
c8499366a2
commit
b6e52f5ee3
@@ -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);
|
||||
|
||||
@@ -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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LCD Screen Contrast</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Values can be 20-45</span></p></body></html></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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LCD Screen Contrast</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Values can be 20-45</span></p></body></html></string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
|
||||
Reference in New Issue
Block a user