fix(color): Missing highlight of the Min/Max value in output editor (#2480)
* fix(gui): add missing highlight of the Min/Max value in output editor acccording to the input * change outputs min/max highlight * output min/max highlight the right way * chore: Bump `libopenui`
This commit is contained in:
@@ -83,13 +83,19 @@ void OutputEditWindow::checkEvents()
|
|||||||
value = newValue;
|
value = newValue;
|
||||||
|
|
||||||
int chanVal = calcRESXto100(channelOutputs[channel]);
|
int chanVal = calcRESXto100(channelOutputs[channel]);
|
||||||
minText->setBackgroundColor(chanVal < chanZero - 1 ? COLOR_THEME_ACTIVE
|
minText->setBackgroudOpacity(chanVal < chanZero - 1 ? LV_OPA_COVER : LV_OPA_TRANSP);
|
||||||
: 0U);
|
minText->setFont(chanVal < chanZero - 1 ? FONT(BOLD) : FONT(STD));
|
||||||
minText->invalidate();
|
minText->invalidate();
|
||||||
maxText->setBackgroundColor(chanVal > chanZero + 1 ? COLOR_THEME_ACTIVE
|
lv_obj_set_style_text_font(minEdit->getLvObj(), getFont(chanVal < chanZero - 1 ? FONT(BOLD) : FONT(STD)), 0);
|
||||||
: 0U);
|
minEdit->invalidate();
|
||||||
|
|
||||||
|
maxText->setBackgroudOpacity(chanVal > chanZero + 1 ? LV_OPA_COVER : LV_OPA_TRANSP);
|
||||||
|
maxText->setFont(chanVal > chanZero + 1 ? FONT(BOLD) : FONT(STD));
|
||||||
maxText->invalidate();
|
maxText->invalidate();
|
||||||
|
lv_obj_set_style_text_font(maxEdit->getLvObj(), getFont(chanVal > chanZero + 1 ? FONT(BOLD) : FONT(STD)), 0);
|
||||||
|
maxEdit->invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
Window::checkEvents();
|
Window::checkEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,13 +143,15 @@ void OutputEditWindow::buildBody(FormWindow* form)
|
|||||||
// Min
|
// Min
|
||||||
line = form->newLine(&grid);
|
line = form->newLine(&grid);
|
||||||
minText = new StaticText(line, rect_t{}, TR_MIN, 0, COLOR_THEME_PRIMARY1);
|
minText = new StaticText(line, rect_t{}, TR_MIN, 0, COLOR_THEME_PRIMARY1);
|
||||||
new GVarNumberEdit(line, rect_t{}, -limit, 0, GET_SET_DEFAULT(output->min),
|
minEdit = new GVarNumberEdit(line, rect_t{}, -limit, 0, GET_SET_DEFAULT(output->min),
|
||||||
PREC1, -LIMIT_STD_MAX);
|
PREC1, -LIMIT_STD_MAX);
|
||||||
|
minText->setBackgroundColor(COLOR_THEME_ACTIVE);
|
||||||
|
|
||||||
// Max
|
// Max
|
||||||
maxText = new StaticText(line, rect_t{}, TR_MAX, 0, COLOR_THEME_PRIMARY1);
|
maxText = new StaticText(line, rect_t{}, TR_MAX, 0, COLOR_THEME_PRIMARY1);
|
||||||
new GVarNumberEdit(line, rect_t{}, 0, +limit, GET_SET_DEFAULT(output->max),
|
maxEdit = new GVarNumberEdit(line, rect_t{}, 0, +limit, GET_SET_DEFAULT(output->max),
|
||||||
PREC1, +LIMIT_STD_MAX);
|
PREC1, +LIMIT_STD_MAX);
|
||||||
|
maxText->setBackgroundColor(COLOR_THEME_ACTIVE);
|
||||||
|
|
||||||
// Direction
|
// Direction
|
||||||
line = form->newLine(&grid);
|
line = form->newLine(&grid);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "page.h"
|
#include "page.h"
|
||||||
#include "form.h"
|
#include "form.h"
|
||||||
|
#include "gvar_numberedit.h"
|
||||||
#include "static.h"
|
#include "static.h"
|
||||||
|
|
||||||
class OutputEditStatusBar;
|
class OutputEditStatusBar;
|
||||||
@@ -37,7 +38,9 @@ class OutputEditWindow : public Page
|
|||||||
int value = 0;
|
int value = 0;
|
||||||
int chanZero = 0;
|
int chanZero = 0;
|
||||||
StaticText *minText;
|
StaticText *minText;
|
||||||
|
GVarNumberEdit* minEdit;
|
||||||
StaticText *maxText;
|
StaticText *maxText;
|
||||||
|
GVarNumberEdit* maxEdit;
|
||||||
OutputEditStatusBar *statusBar = nullptr;
|
OutputEditStatusBar *statusBar = nullptr;
|
||||||
|
|
||||||
void checkEvents() override;
|
void checkEvents() override;
|
||||||
|
|||||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 47441631c8...45c22ed5f3
Reference in New Issue
Block a user