Some fixes to value widget

This commit is contained in:
3djc
2021-04-18 14:29:30 +02:00
parent 5932c4c5a8
commit 8c49a07242
2 changed files with 6 additions and 6 deletions
@@ -23,6 +23,8 @@
#include "widget_settings.h"
#include "libopenui.h"
#define SET_DIRTY() storageDirty(EE_MODEL)
static const rect_t widgetSettingsDialogRect = {
LCD_W / 10, // x
LCD_H / 4, // y
@@ -118,12 +120,14 @@ WidgetSettings::WidgetSettings(Window * parent, Widget * widget) :
break;
case ZoneOption::Color:
for (uint8_t part = 0; part < 3; part++)
new ColorEdit(form, grid.getFieldSlot(),
[=]() -> int { // getValue
return (int) widget->getOptionValue(optIdx)->unsignedValue;
},
[=](int newValue) { // setValue
widget->getOptionValue(optIdx)->unsignedValue = (uint32_t) newValue;
SET_DIRTY();
});
break;
}
+2 -6
View File
@@ -33,10 +33,6 @@ class ValueWidget: public Widget
void paint(BitmapBuffer * dc) override
{
// draw the background and border
dc->clear(DEFAULT_BGCOLOR);
dc->drawFilledRect(0,0, width(), height(), SOLID, MAINVIEW_PANES_COLOR | OPACITY(5));
// get source from options[0]
mixsrc_t field = persistentData->options[0].value.unsignedValue;
@@ -51,8 +47,8 @@ class ValueWidget: public Widget
yValue = 14;
xLabel = 0;
yLabel = 0;
attrValue = LEFT | NO_UNIT | FONT(XS);
attrLabel = FONT(XS);
attrValue = LEFT | NO_UNIT | FONT(L);
attrLabel = LEFT;
}
else if (height() < 50) {
xValue = width() - NUMBERS_PADDING;