[Horus] UI bugfix
This commit is contained in:
@@ -93,33 +93,37 @@ void registerLayout(const LayoutFactory * factory);
|
|||||||
class LayoutFactory
|
class LayoutFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LayoutFactory(const char * name, const char * bitmap):
|
LayoutFactory(const char * name):
|
||||||
name(name),
|
name(name)
|
||||||
bitmap(bitmap)
|
|
||||||
{
|
{
|
||||||
registerLayout(this);
|
registerLayout(this);
|
||||||
}
|
}
|
||||||
const char * getName() const { return name; }
|
const char * getName() const { return name; }
|
||||||
const char * getBitmap() const { return bitmap; }
|
virtual void drawThumb(uint16_t x, uint16_t y, uint32_t flags) = 0;
|
||||||
virtual const ZoneOption * getOptions() const = 0;
|
virtual const ZoneOption * getOptions() const = 0;
|
||||||
virtual Layout * create(Layout::PersistentData * persistentData) const = 0;
|
virtual Layout * create(Layout::PersistentData * persistentData) const = 0;
|
||||||
virtual Layout * load(Layout::PersistentData * persistentData) const = 0;
|
virtual Layout * load(Layout::PersistentData * persistentData) const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const char * name;
|
const char * name;
|
||||||
const char * bitmap;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class BaseLayoutFactory: public LayoutFactory
|
class BaseLayoutFactory: public LayoutFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BaseLayoutFactory(const char * name, const char * bitmap, const ZoneOption * options):
|
BaseLayoutFactory(const char * name, const uint8_t * bitmap, const ZoneOption * options):
|
||||||
LayoutFactory(name, bitmap),
|
LayoutFactory(name),
|
||||||
|
bitmap(bitmap),
|
||||||
options(options)
|
options(options)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void drawThumb(uint16_t x, uint16_t y, uint32_t flags)
|
||||||
|
{
|
||||||
|
extern void lcdDrawBitmapPattern(int x, int y, const uint8_t * bitmap, uint32_t flags, int width=0, int offset=0);
|
||||||
|
lcdDrawBitmapPattern(x, y, bitmap, flags);
|
||||||
|
}
|
||||||
virtual const ZoneOption * getOptions() const
|
virtual const ZoneOption * getOptions() const
|
||||||
{
|
{
|
||||||
return options;
|
return options;
|
||||||
@@ -140,6 +144,7 @@ class BaseLayoutFactory: public LayoutFactory
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
const uint8_t * bitmap;
|
||||||
const ZoneOption * options;
|
const ZoneOption * options;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -100,4 +100,4 @@ void Layout2P1::refresh(bool setup)
|
|||||||
Layout::refresh(setup);
|
Layout::refresh(setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseLayoutFactory<Layout2P1> layout2P1("Layout2P1", "", Layout2P1::options);
|
BaseLayoutFactory<Layout2P1> layout2P1("Layout2P1", NULL, Layout2P1::options);
|
||||||
|
|||||||
@@ -83,4 +83,4 @@ void Layout2x2::refresh(bool setup)
|
|||||||
Layout::refresh(setup);
|
Layout::refresh(setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseLayoutFactory<Layout2x2> layout2x2("Layout2x2", "", Layout2x2::options);
|
BaseLayoutFactory<Layout2x2> layout2x2("Layout2x2", NULL, Layout2x2::options);
|
||||||
|
|||||||
@@ -116,4 +116,4 @@ void Layout2x4::refresh(bool setup)
|
|||||||
Layout::refresh(setup);
|
Layout::refresh(setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseLayoutFactory<Layout2x4> layout2x4("Layout2x4", "", Layout2x4::options);
|
BaseLayoutFactory<Layout2x4> layout2x4("Layout2x4", NULL, Layout2x4::options);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ ZoneOptionValue editZoneOption(coord_t y, const ZoneOption * option, ZoneOptionV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (option->type == ZoneOption::String) {
|
else if (option->type == ZoneOption::String) {
|
||||||
editName(SCREENS_SETUP_2ND_COLUMN, y, value.stringValue, sizeof(value.stringValue), event, attr|EE_MODEL);
|
editName(SCREENS_SETUP_2ND_COLUMN, y, value.stringValue, sizeof(value.stringValue), event, attr);
|
||||||
}
|
}
|
||||||
else if (option->type == ZoneOption::TextSize) {
|
else if (option->type == ZoneOption::TextSize) {
|
||||||
lcdDrawTextAtIndex(SCREENS_SETUP_2ND_COLUMN, y, "\010StandardTiny\0 Small\0 Mid\0 Double", value.unsignedValue, attr);
|
lcdDrawTextAtIndex(SCREENS_SETUP_2ND_COLUMN, y, "\010StandardTiny\0 Small\0 Mid\0 Double", value.unsignedValue, attr);
|
||||||
|
|||||||
Reference in New Issue
Block a user