mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 00:45:10 +00:00
Widget backgrounds
svn-id: r33005
This commit is contained in:
parent
a90be07c3e
commit
e64711378e
@ -61,11 +61,12 @@ bool ThemeRenderer::loadDefaultXML() {
|
||||
"</drawdata>"
|
||||
|
||||
"<drawdata id = 'checkbox_disabled' cache = false>"
|
||||
"<text vertical_align = 'center' horizontal_align = 'center' color = '255, 0, 0' />"
|
||||
"<text vertical_align = 'top' horizontal_align = 'left' color = '255, 255, 255' />"
|
||||
"<drawstep func = 'square' fill = 'gradient' gradient_start = '206, 121, 99' gradient_end = '173, 40, 8' size = 'auto' shadow = 0 />"
|
||||
"</drawdata>"
|
||||
|
||||
"<drawdata id = 'checkbox_enabled' cache = false>"
|
||||
"<text vertical_align = 'top' horizontal_align = 'left' color = '255, 255, 255' />"
|
||||
"<drawstep func = 'square' fill = 'gradient' gradient_start = '206, 121, 99' gradient_end = '173, 40, 8' size = 'auto' shadow = 0 />"
|
||||
"<drawstep func = 'circle' radius = 'auto' fill = 'foreground' />"
|
||||
"</drawdata>"
|
||||
|
@ -323,18 +323,17 @@ void ThemeRenderer::drawCheckbox(const Common::Rect &r, const Common::String &st
|
||||
return;
|
||||
|
||||
Common::Rect r2 = r;
|
||||
int checkBoxSize = getFontHeight();
|
||||
|
||||
if (checkBoxSize > r.height())
|
||||
checkBoxSize = r.height();
|
||||
const int checkBoxSize = MIN((int)r.height(), getFontHeight());
|
||||
|
||||
r2.bottom = r2.top + checkBoxSize;
|
||||
r2.right = r2.left + checkBoxSize;
|
||||
|
||||
drawDD(checked ? kDDCheckboxEnabled : kDDCheckboxDisabled, r2);
|
||||
|
||||
// TODO: text drawing
|
||||
// getFont()->drawString(&_screen, str, r2.left, r2.top, r2.width(), getColor(state), Graphics::kTextAlignLeft, 0, false);
|
||||
|
||||
r2.left = r2.right + checkBoxSize;
|
||||
r2.right = r.right;
|
||||
|
||||
drawDDText(checked ? kDDCheckboxEnabled : kDDCheckboxDisabled, r2, str);
|
||||
|
||||
addDirtyRect(r);
|
||||
debugWidgetPosition(r);
|
||||
@ -365,7 +364,16 @@ void ThemeRenderer::drawScrollbar(const Common::Rect &r, int sliderY, int slider
|
||||
void ThemeRenderer::drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state) {
|
||||
if (!ready())
|
||||
return;
|
||||
|
||||
|
||||
if (hints & THEME_HINT_MAIN_DIALOG)
|
||||
drawDD(kDDMainDialogBackground, r);
|
||||
else if (hints & THEME_HINT_SPECIAL_COLOR)
|
||||
drawDD(kDDSpecialColorBackground, r);
|
||||
else if (hints & THEME_HINT_PLAIN_COLOR)
|
||||
drawDD(kDDPlainColorBackground, r);
|
||||
else
|
||||
drawDD(kDDDefaultBackground, r);
|
||||
|
||||
debugWidgetPosition(r);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
kDDMainDialogBackground,
|
||||
kDDSpecialColorBackground,
|
||||
kDDPlainColorBackground,
|
||||
kDDDefaulBackground,
|
||||
kDDDefaultBackground,
|
||||
|
||||
kDDButtonIdle,
|
||||
kDDButtonHover,
|
||||
|
Loading…
x
Reference in New Issue
Block a user