@@ -56,7 +56,7 @@ class Layout2x4: public Layout
|
|||||||
getOptionValue(OPTION_PANEL1_BACKGROUND)->boolValue = true;
|
getOptionValue(OPTION_PANEL1_BACKGROUND)->boolValue = true;
|
||||||
getOptionValue(OPTION_PANEL1_COLOR)->unsignedValue = RGB(77,112,203);
|
getOptionValue(OPTION_PANEL1_COLOR)->unsignedValue = RGB(77,112,203);
|
||||||
getOptionValue(OPTION_PANEL2_BACKGROUND)->boolValue = true;
|
getOptionValue(OPTION_PANEL2_BACKGROUND)->boolValue = true;
|
||||||
getOptionValue(OPTION_PANEL2_COLOR)->unsignedValue = RGB(77,112,203);
|
getOptionValue(OPTION_PANEL2_COLOR)->unsignedValue = RGB(7,1,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int getZonesCount() const override
|
unsigned int getZonesCount() const override
|
||||||
@@ -79,6 +79,25 @@ class Layout2x4: public Layout
|
|||||||
|
|
||||||
return zone;
|
return zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void paint(BitmapBuffer * dc) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void Layout2x4::paint(BitmapBuffer* dc)
|
||||||
|
{
|
||||||
|
rect_t fullScreen = Layout::getMainZone();
|
||||||
|
fullScreen.w /=2;
|
||||||
|
if (getOptionValue(OPTION_PANEL1_BACKGROUND)->boolValue) {
|
||||||
|
lcdSetColor(getOptionValue(OPTION_PANEL1_COLOR)->unsignedValue);
|
||||||
|
dc->drawSolidFilledRect(fullScreen.x, fullScreen.y, fullScreen.w, fullScreen.h, CUSTOM_COLOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getOptionValue(OPTION_PANEL2_BACKGROUND)->boolValue) {
|
||||||
|
fullScreen.x += fullScreen.w;
|
||||||
|
lcdSetColor(getOptionValue(OPTION_PANEL2_COLOR)->unsignedValue);
|
||||||
|
dc->drawSolidFilledRect(fullScreen.x, fullScreen.y, fullScreen.w, fullScreen.h, CUSTOM_COLOR);
|
||||||
|
}
|
||||||
|
Layout::paint(dc);
|
||||||
|
}
|
||||||
|
|
||||||
BaseLayoutFactory<Layout2x4> layout2x4("Layout2x4", "2 x 4", LBM_LAYOUT_2x4, OPTIONS_LAYOUT_2x4);
|
BaseLayoutFactory<Layout2x4> layout2x4("Layout2x4", "2 x 4", LBM_LAYOUT_2x4, OPTIONS_LAYOUT_2x4);
|
||||||
|
|||||||
@@ -97,7 +97,12 @@ class ModelBitmapWidget: public Widget
|
|||||||
TRACE("could not load bitmap '%s'", filename.c_str());
|
TRACE("could not load bitmap '%s'", filename.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
buffer->drawScaledBitmap(bitmap.get(), 0, 38, width(), height() - 38);
|
|
||||||
|
if (rect.h >= 96 && rect.w >= 120) {
|
||||||
|
buffer->drawScaledBitmap(bitmap.get(), 0, 38, width(), height() - 38);
|
||||||
|
} else {
|
||||||
|
buffer->drawScaledBitmap(bitmap.get(), 0, 0, width(), height());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user