Some fixes to value widget
This commit is contained in:
@@ -23,6 +23,8 @@
|
|||||||
#include "widget_settings.h"
|
#include "widget_settings.h"
|
||||||
#include "libopenui.h"
|
#include "libopenui.h"
|
||||||
|
|
||||||
|
#define SET_DIRTY() storageDirty(EE_MODEL)
|
||||||
|
|
||||||
static const rect_t widgetSettingsDialogRect = {
|
static const rect_t widgetSettingsDialogRect = {
|
||||||
LCD_W / 10, // x
|
LCD_W / 10, // x
|
||||||
LCD_H / 4, // y
|
LCD_H / 4, // y
|
||||||
@@ -118,12 +120,14 @@ WidgetSettings::WidgetSettings(Window * parent, Widget * widget) :
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ZoneOption::Color:
|
case ZoneOption::Color:
|
||||||
|
for (uint8_t part = 0; part < 3; part++)
|
||||||
new ColorEdit(form, grid.getFieldSlot(),
|
new ColorEdit(form, grid.getFieldSlot(),
|
||||||
[=]() -> int { // getValue
|
[=]() -> int { // getValue
|
||||||
return (int) widget->getOptionValue(optIdx)->unsignedValue;
|
return (int) widget->getOptionValue(optIdx)->unsignedValue;
|
||||||
},
|
},
|
||||||
[=](int newValue) { // setValue
|
[=](int newValue) { // setValue
|
||||||
widget->getOptionValue(optIdx)->unsignedValue = (uint32_t) newValue;
|
widget->getOptionValue(optIdx)->unsignedValue = (uint32_t) newValue;
|
||||||
|
SET_DIRTY();
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ class ValueWidget: public Widget
|
|||||||
|
|
||||||
void paint(BitmapBuffer * dc) override
|
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]
|
// get source from options[0]
|
||||||
mixsrc_t field = persistentData->options[0].value.unsignedValue;
|
mixsrc_t field = persistentData->options[0].value.unsignedValue;
|
||||||
|
|
||||||
@@ -51,8 +47,8 @@ class ValueWidget: public Widget
|
|||||||
yValue = 14;
|
yValue = 14;
|
||||||
xLabel = 0;
|
xLabel = 0;
|
||||||
yLabel = 0;
|
yLabel = 0;
|
||||||
attrValue = LEFT | NO_UNIT | FONT(XS);
|
attrValue = LEFT | NO_UNIT | FONT(L);
|
||||||
attrLabel = FONT(XS);
|
attrLabel = LEFT;
|
||||||
}
|
}
|
||||||
else if (height() < 50) {
|
else if (height() < 50) {
|
||||||
xValue = width() - NUMBERS_PADDING;
|
xValue = width() - NUMBERS_PADDING;
|
||||||
|
|||||||
Reference in New Issue
Block a user