GUI: Use clipping everywhere
This commit is contained in:
parent
dc9b32e620
commit
3d636617d0
7 changed files with 117 additions and 20 deletions
|
@ -1067,6 +1067,13 @@ void ThemeEngine::drawLineSeparator(const Common::Rect &r, WidgetStateInfo state
|
||||||
queueDD(kDDSeparator, r);
|
queueDD(kDDSeparator, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThemeEngine::drawLineSeparatorClip(const Common::Rect &r, const Common::Rect &clippingRect, WidgetStateInfo state) {
|
||||||
|
if (!ready())
|
||||||
|
return;
|
||||||
|
|
||||||
|
queueDDClip(kDDSeparator, r, clippingRect);
|
||||||
|
}
|
||||||
|
|
||||||
void ThemeEngine::drawCheckbox(const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state) {
|
void ThemeEngine::drawCheckbox(const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state) {
|
||||||
if (!ready())
|
if (!ready())
|
||||||
return;
|
return;
|
||||||
|
@ -1093,6 +1100,32 @@ void ThemeEngine::drawCheckbox(const Common::Rect &r, const Common::String &str,
|
||||||
queueDDText(getTextData(dd), getTextColor(dd), r2, str, true, false, _widgets[kDDCheckboxDefault]->_textAlignH, _widgets[dd]->_textAlignV);
|
queueDDText(getTextData(dd), getTextColor(dd), r2, str, true, false, _widgets[kDDCheckboxDefault]->_textAlignH, _widgets[dd]->_textAlignV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThemeEngine::drawCheckboxClip(const Common::Rect &r, const Common::Rect &clip, const Common::String &str, bool checked, WidgetStateInfo state) {
|
||||||
|
if (!ready())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Common::Rect r2 = r;
|
||||||
|
DrawData dd = kDDCheckboxDefault;
|
||||||
|
|
||||||
|
if (checked)
|
||||||
|
dd = kDDCheckboxSelected;
|
||||||
|
|
||||||
|
if (state == kStateDisabled)
|
||||||
|
dd = kDDCheckboxDisabled;
|
||||||
|
|
||||||
|
const int checkBoxSize = MIN((int)r.height(), getFontHeight());
|
||||||
|
|
||||||
|
r2.bottom = r2.top + checkBoxSize;
|
||||||
|
r2.right = r2.left + checkBoxSize;
|
||||||
|
|
||||||
|
queueDDClip(dd, r2, clip);
|
||||||
|
|
||||||
|
r2.left = r2.right + checkBoxSize;
|
||||||
|
r2.right = r.right;
|
||||||
|
|
||||||
|
queueDDTextClip(getTextData(dd), getTextColor(dd), r2, clip, str, true, false, _widgets[kDDCheckboxDefault]->_textAlignH, _widgets[dd]->_textAlignV);
|
||||||
|
}
|
||||||
|
|
||||||
void ThemeEngine::drawRadiobutton(const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state) {
|
void ThemeEngine::drawRadiobutton(const Common::Rect &r, const Common::String &str, bool checked, WidgetStateInfo state) {
|
||||||
if (!ready())
|
if (!ready())
|
||||||
return;
|
return;
|
||||||
|
@ -1119,6 +1152,32 @@ void ThemeEngine::drawRadiobutton(const Common::Rect &r, const Common::String &s
|
||||||
queueDDText(getTextData(dd), getTextColor(dd), r2, str, true, false, _widgets[kDDRadiobuttonDefault]->_textAlignH, _widgets[dd]->_textAlignV);
|
queueDDText(getTextData(dd), getTextColor(dd), r2, str, true, false, _widgets[kDDRadiobuttonDefault]->_textAlignH, _widgets[dd]->_textAlignV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThemeEngine::drawRadiobuttonClip(const Common::Rect &r, const Common::Rect &clippingRect, const Common::String &str, bool checked, WidgetStateInfo state) {
|
||||||
|
if (!ready())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Common::Rect r2 = r;
|
||||||
|
DrawData dd = kDDRadiobuttonDefault;
|
||||||
|
|
||||||
|
if (checked)
|
||||||
|
dd = kDDRadiobuttonSelected;
|
||||||
|
|
||||||
|
if (state == kStateDisabled)
|
||||||
|
dd = kDDRadiobuttonDisabled;
|
||||||
|
|
||||||
|
const int checkBoxSize = MIN((int)r.height(), getFontHeight());
|
||||||
|
|
||||||
|
r2.bottom = r2.top + checkBoxSize;
|
||||||
|
r2.right = r2.left + checkBoxSize;
|
||||||
|
|
||||||
|
queueDDClip(dd, r2, clippingRect);
|
||||||
|
|
||||||
|
r2.left = r2.right + checkBoxSize;
|
||||||
|
r2.right = r.right;
|
||||||
|
|
||||||
|
queueDDTextClip(getTextData(dd), getTextColor(dd), r2, clippingRect, str, true, false, _widgets[kDDRadiobuttonDefault]->_textAlignH, _widgets[dd]->_textAlignV);
|
||||||
|
}
|
||||||
|
|
||||||
void ThemeEngine::drawSlider(const Common::Rect &r, int width, WidgetStateInfo state) {
|
void ThemeEngine::drawSlider(const Common::Rect &r, int width, WidgetStateInfo state) {
|
||||||
if (!ready())
|
if (!ready())
|
||||||
return;
|
return;
|
||||||
|
@ -1139,6 +1198,26 @@ void ThemeEngine::drawSlider(const Common::Rect &r, int width, WidgetStateInfo s
|
||||||
queueDD(dd, r2);
|
queueDD(dd, r2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThemeEngine::drawSliderClip(const Common::Rect &r, const Common::Rect &clip, int width, WidgetStateInfo state) {
|
||||||
|
if (!ready())
|
||||||
|
return;
|
||||||
|
|
||||||
|
DrawData dd = kDDSliderFull;
|
||||||
|
|
||||||
|
if (state == kStateHighlight)
|
||||||
|
dd = kDDSliderHover;
|
||||||
|
else if (state == kStateDisabled)
|
||||||
|
dd = kDDSliderDisabled;
|
||||||
|
|
||||||
|
Common::Rect r2 = r;
|
||||||
|
r2.setWidth(MIN((int16)width, r.width()));
|
||||||
|
// r2.top++; r2.bottom--; r2.left++; r2.right--;
|
||||||
|
|
||||||
|
drawWidgetBackgroundClip(r, clip, 0, kWidgetBackgroundSlider, kStateEnabled);
|
||||||
|
|
||||||
|
queueDDClip(dd, r2, clip);
|
||||||
|
}
|
||||||
|
|
||||||
void ThemeEngine::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState scrollState, WidgetStateInfo state) {
|
void ThemeEngine::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState scrollState, WidgetStateInfo state) {
|
||||||
if (!ready())
|
if (!ready())
|
||||||
return;
|
return;
|
||||||
|
@ -1582,6 +1661,21 @@ void ThemeEngine::drawChar(const Common::Rect &r, byte ch, const Graphics::Font
|
||||||
addDirtyRect(charArea);
|
addDirtyRect(charArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThemeEngine::drawCharClip(const Common::Rect &r, const Common::Rect &clip, byte ch, const Graphics::Font *font, WidgetStateInfo state, FontColor color) {
|
||||||
|
if (!ready())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Common::Rect charArea = r;
|
||||||
|
charArea.clip(_screen.w, _screen.h);
|
||||||
|
if (!clip.isEmpty()) charArea.clip(clip);
|
||||||
|
|
||||||
|
uint32 rgbColor = _overlayFormat.RGBToColor(_textColors[color]->r, _textColors[color]->g, _textColors[color]->b);
|
||||||
|
|
||||||
|
restoreBackground(charArea);
|
||||||
|
font->drawChar(&_screen, ch, charArea.left, charArea.top, rgbColor);
|
||||||
|
addDirtyRect(charArea);
|
||||||
|
}
|
||||||
|
|
||||||
void ThemeEngine::debugWidgetPosition(const char *name, const Common::Rect &r) {
|
void ThemeEngine::debugWidgetPosition(const char *name, const Common::Rect &r) {
|
||||||
_font->drawString(&_screen, name, r.left, r.top, r.width(), 0xFFFF, Graphics::kTextAlignRight, 0, true);
|
_font->drawString(&_screen, name, r.left, r.top, r.width(), 0xFFFF, Graphics::kTextAlignRight, 0, true);
|
||||||
_screen.hLine(r.left, r.top, r.right, 0xFFFF);
|
_screen.hLine(r.left, r.top, r.right, 0xFFFF);
|
||||||
|
|
|
@ -340,30 +340,33 @@ public:
|
||||||
|
|
||||||
void drawWidgetBackground(const Common::Rect &r, uint16 hints,
|
void drawWidgetBackground(const Common::Rect &r, uint16 hints,
|
||||||
WidgetBackground background = kWidgetBackgroundPlain, WidgetStateInfo state = kStateEnabled);
|
WidgetBackground background = kWidgetBackgroundPlain, WidgetStateInfo state = kStateEnabled);
|
||||||
|
|
||||||
void drawWidgetBackgroundClip(const Common::Rect &r, const Common::Rect &clippingArea, uint16 hints,
|
void drawWidgetBackgroundClip(const Common::Rect &r, const Common::Rect &clippingArea, uint16 hints,
|
||||||
WidgetBackground background = kWidgetBackgroundPlain, WidgetStateInfo state = kStateEnabled);
|
WidgetBackground background = kWidgetBackgroundPlain, WidgetStateInfo state = kStateEnabled);
|
||||||
|
|
||||||
void drawButton(const Common::Rect &r, const Common::String &str,
|
void drawButton(const Common::Rect &r, const Common::String &str,
|
||||||
WidgetStateInfo state = kStateEnabled, uint16 hints = 0);
|
WidgetStateInfo state = kStateEnabled, uint16 hints = 0);
|
||||||
|
|
||||||
void drawButtonClip(const Common::Rect &r, const Common::Rect &clippingRect, const Common::String &str,
|
void drawButtonClip(const Common::Rect &r, const Common::Rect &clippingRect, const Common::String &str,
|
||||||
WidgetStateInfo state = kStateEnabled, uint16 hints = 0);
|
WidgetStateInfo state = kStateEnabled, uint16 hints = 0);
|
||||||
|
|
||||||
void drawSurface(const Common::Rect &r, const Graphics::Surface &surface,
|
void drawSurface(const Common::Rect &r, const Graphics::Surface &surface,
|
||||||
WidgetStateInfo state = kStateEnabled, int alpha = 255, bool themeTrans = false);
|
WidgetStateInfo state = kStateEnabled, int alpha = 255, bool themeTrans = false);
|
||||||
|
|
||||||
void drawSurfaceClip(const Common::Rect &r, const Common::Rect &clippingRect, const Graphics::Surface &surface,
|
void drawSurfaceClip(const Common::Rect &r, const Common::Rect &clippingRect, const Graphics::Surface &surface,
|
||||||
WidgetStateInfo state = kStateEnabled, int alpha = 255, bool themeTrans = false);
|
WidgetStateInfo state = kStateEnabled, int alpha = 255, bool themeTrans = false);
|
||||||
|
|
||||||
void drawSlider(const Common::Rect &r, int width,
|
void drawSlider(const Common::Rect &r, int width,
|
||||||
WidgetStateInfo state = kStateEnabled);
|
WidgetStateInfo state = kStateEnabled);
|
||||||
|
void drawSliderClip(const Common::Rect &r, const Common::Rect &clippingRect, int width,
|
||||||
|
WidgetStateInfo state = kStateEnabled);
|
||||||
|
|
||||||
void drawCheckbox(const Common::Rect &r, const Common::String &str,
|
void drawCheckbox(const Common::Rect &r, const Common::String &str,
|
||||||
bool checked, WidgetStateInfo state = kStateEnabled);
|
bool checked, WidgetStateInfo state = kStateEnabled);
|
||||||
|
void drawCheckboxClip(const Common::Rect &r, const Common::Rect &clippingRect, const Common::String &str,
|
||||||
|
bool checked, WidgetStateInfo state = kStateEnabled);
|
||||||
|
|
||||||
void drawRadiobutton(const Common::Rect &r, const Common::String &str,
|
void drawRadiobutton(const Common::Rect &r, const Common::String &str,
|
||||||
bool checked, WidgetStateInfo state = kStateEnabled);
|
bool checked, WidgetStateInfo state = kStateEnabled);
|
||||||
|
void drawRadiobuttonClip(const Common::Rect &r, const Common::Rect &clippingRect, const Common::String &str,
|
||||||
|
bool checked, WidgetStateInfo state = kStateEnabled);
|
||||||
|
|
||||||
void drawTab(const Common::Rect &r, int tabHeight, int tabWidth,
|
void drawTab(const Common::Rect &r, int tabHeight, int tabWidth,
|
||||||
const Common::Array<Common::String> &tabs, int active, uint16 hints,
|
const Common::Array<Common::String> &tabs, int active, uint16 hints,
|
||||||
|
@ -384,20 +387,20 @@ public:
|
||||||
|
|
||||||
void drawCaret(const Common::Rect &r, bool erase,
|
void drawCaret(const Common::Rect &r, bool erase,
|
||||||
WidgetStateInfo state = kStateEnabled);
|
WidgetStateInfo state = kStateEnabled);
|
||||||
|
|
||||||
void drawCaretClip(const Common::Rect &r, const Common::Rect &clip, bool erase,
|
void drawCaretClip(const Common::Rect &r, const Common::Rect &clip, bool erase,
|
||||||
WidgetStateInfo state = kStateEnabled);
|
WidgetStateInfo state = kStateEnabled);
|
||||||
|
|
||||||
void drawLineSeparator(const Common::Rect &r, WidgetStateInfo state = kStateEnabled);
|
void drawLineSeparator(const Common::Rect &r, WidgetStateInfo state = kStateEnabled);
|
||||||
|
void drawLineSeparatorClip(const Common::Rect &r, const Common::Rect &clippingArea, WidgetStateInfo state = kStateEnabled);
|
||||||
|
|
||||||
void drawDialogBackground(const Common::Rect &r, DialogBackground type, WidgetStateInfo state = kStateEnabled);
|
void drawDialogBackground(const Common::Rect &r, DialogBackground type, WidgetStateInfo state = kStateEnabled);
|
||||||
void drawDialogBackgroundClip(const Common::Rect &r, const Common::Rect &clip, DialogBackground type, WidgetStateInfo state = kStateEnabled);
|
void drawDialogBackgroundClip(const Common::Rect &r, const Common::Rect &clip, DialogBackground type, WidgetStateInfo state = kStateEnabled);
|
||||||
|
|
||||||
void drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state = kStateEnabled, Graphics::TextAlign align = Graphics::kTextAlignCenter, TextInversionState inverted = kTextInversionNone, int deltax = 0, bool useEllipsis = true, FontStyle font = kFontStyleBold, FontColor color = kFontColorNormal, bool restore = true, const Common::Rect &drawableTextArea = Common::Rect(0, 0, 0, 0));
|
void drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state = kStateEnabled, Graphics::TextAlign align = Graphics::kTextAlignCenter, TextInversionState inverted = kTextInversionNone, int deltax = 0, bool useEllipsis = true, FontStyle font = kFontStyleBold, FontColor color = kFontColorNormal, bool restore = true, const Common::Rect &drawableTextArea = Common::Rect(0, 0, 0, 0));
|
||||||
|
|
||||||
void drawTextClip(const Common::Rect &r, const Common::Rect &clippingArea, const Common::String &str, WidgetStateInfo state = kStateEnabled, Graphics::TextAlign align = Graphics::kTextAlignCenter, TextInversionState inverted = kTextInversionNone, int deltax = 0, bool useEllipsis = true, FontStyle font = kFontStyleBold, FontColor color = kFontColorNormal, bool restore = true, const Common::Rect &drawableTextArea = Common::Rect(0, 0, 0, 0));
|
void drawTextClip(const Common::Rect &r, const Common::Rect &clippingArea, const Common::String &str, WidgetStateInfo state = kStateEnabled, Graphics::TextAlign align = Graphics::kTextAlignCenter, TextInversionState inverted = kTextInversionNone, int deltax = 0, bool useEllipsis = true, FontStyle font = kFontStyleBold, FontColor color = kFontColorNormal, bool restore = true, const Common::Rect &drawableTextArea = Common::Rect(0, 0, 0, 0));
|
||||||
|
|
||||||
void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state = kStateEnabled, FontColor color = kFontColorNormal);
|
void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state = kStateEnabled, FontColor color = kFontColorNormal);
|
||||||
|
void drawCharClip(const Common::Rect &r, const Common::Rect &clippingArea, byte ch, const Graphics::Font *font, WidgetStateInfo state = kStateEnabled, FontColor color = kFontColorNormal);
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ void Widget::draw() {
|
||||||
|
|
||||||
// Draw border
|
// Draw border
|
||||||
if (_flags & WIDGET_BORDER) {
|
if (_flags & WIDGET_BORDER) {
|
||||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), 0, ThemeEngine::kWidgetBackgroundBorder);
|
g_gui.theme()->drawWidgetBackgroundClip(Common::Rect(_x, _y, _x+_w, _y+_h), getBossClipRect(), 0, ThemeEngine::kWidgetBackgroundBorder);
|
||||||
_x += 4;
|
_x += 4;
|
||||||
_y += 4;
|
_y += 4;
|
||||||
_w -= 8;
|
_w -= 8;
|
||||||
|
@ -424,7 +424,7 @@ void PicButtonWidget::setGfx(int w, int h, int r, int g, int b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PicButtonWidget::drawWidget() {
|
void PicButtonWidget::drawWidget() {
|
||||||
g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), "", _state, getFlags());
|
g_gui.theme()->drawButtonClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), "", _state, getFlags());
|
||||||
|
|
||||||
if (_gfx.getPixels()) {
|
if (_gfx.getPixels()) {
|
||||||
// Check whether the set up surface needs to be converted to the GUI
|
// Check whether the set up surface needs to be converted to the GUI
|
||||||
|
@ -437,7 +437,7 @@ void PicButtonWidget::drawWidget() {
|
||||||
const int x = _x + (_w - _gfx.w) / 2;
|
const int x = _x + (_w - _gfx.w) / 2;
|
||||||
const int y = _y + (_h - _gfx.h) / 2;
|
const int y = _y + (_h - _gfx.h) / 2;
|
||||||
|
|
||||||
g_gui.theme()->drawSurface(Common::Rect(x, y, x + _gfx.w, y + _gfx.h), _gfx, _state, _alpha, _transparency);
|
g_gui.theme()->drawSurfaceClip(Common::Rect(x, y, x + _gfx.w, y + _gfx.h), getBossClipRect(), _gfx, _state, _alpha, _transparency);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,7 +472,7 @@ void CheckboxWidget::setState(bool state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckboxWidget::drawWidget() {
|
void CheckboxWidget::drawWidget() {
|
||||||
g_gui.theme()->drawCheckbox(Common::Rect(_x, _y, _x+_w, _y+_h), _label, _state, Widget::_state);
|
g_gui.theme()->drawCheckboxClip(Common::Rect(_x, _y, _x+_w, _y+_h), getBossClipRect(), _label, _state, Widget::_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
@ -541,7 +541,7 @@ void RadiobuttonWidget::setState(bool state, bool setGroup) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadiobuttonWidget::drawWidget() {
|
void RadiobuttonWidget::drawWidget() {
|
||||||
g_gui.theme()->drawRadiobutton(Common::Rect(_x, _y, _x+_w, _y+_h), _label, _state, Widget::_state);
|
g_gui.theme()->drawRadiobuttonClip(Common::Rect(_x, _y, _x+_w, _y+_h), getBossClipRect(), _label, _state, Widget::_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
@ -609,7 +609,7 @@ void SliderWidget::handleMouseWheel(int x, int y, int direction) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SliderWidget::drawWidget() {
|
void SliderWidget::drawWidget() {
|
||||||
g_gui.theme()->drawSlider(Common::Rect(_x, _y, _x + _w, _y + _h), valueToBarWidth(_value), _state);
|
g_gui.theme()->drawSliderClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), valueToBarWidth(_value), _state);
|
||||||
}
|
}
|
||||||
|
|
||||||
int SliderWidget::valueToBarWidth(int value) {
|
int SliderWidget::valueToBarWidth(int value) {
|
||||||
|
@ -723,7 +723,7 @@ void ContainerWidget::removeWidget(Widget *widget) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContainerWidget::drawWidget() {
|
void ContainerWidget::drawWidget() {
|
||||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0, ThemeEngine::kWidgetBackgroundBorder);
|
g_gui.theme()->drawWidgetBackgroundClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), 0, ThemeEngine::kWidgetBackgroundBorder);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace GUI
|
} // End of namespace GUI
|
||||||
|
|
|
@ -303,7 +303,7 @@ void EditableWidget::drawCaret(bool erase) {
|
||||||
// possible glitches due to different methods used.
|
// possible glitches due to different methods used.
|
||||||
width = MIN(editRect.width() - caretOffset, width);
|
width = MIN(editRect.width() - caretOffset, width);
|
||||||
if (width > 0) {
|
if (width > 0) {
|
||||||
g_gui.theme()->drawText(Common::Rect(x, y, x + width, y + editRect.height()), character, _state, Graphics::kTextAlignLeft, _inversion, 0, false, _font, ThemeEngine::kFontColorNormal, true, _textDrawableArea);
|
g_gui.theme()->drawTextClip(Common::Rect(x, y, x + width, y + editRect.height()), getBossClipRect(), character, _state, Graphics::kTextAlignLeft, _inversion, 0, false, _font, ThemeEngine::kFontColorNormal, true, _textDrawableArea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ void EditTextWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditTextWidget::drawWidget() {
|
void EditTextWidget::drawWidget() {
|
||||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x+_w, _y+_h), 0, ThemeEngine::kWidgetBackgroundEditText);
|
g_gui.theme()->drawWidgetBackgroundClip(Common::Rect(_x, _y, _x+_w, _y+_h), getBossClipRect(), 0, ThemeEngine::kWidgetBackgroundEditText);
|
||||||
|
|
||||||
// Draw the text
|
// Draw the text
|
||||||
adjustOffset();
|
adjustOffset();
|
||||||
|
@ -105,7 +105,7 @@ void EditTextWidget::drawWidget() {
|
||||||
const Common::Rect &r = Common::Rect(_x + 2 + _leftPadding, _y + 2, _x + _leftPadding + getEditRect().width() + 8, _y + _h);
|
const Common::Rect &r = Common::Rect(_x + 2 + _leftPadding, _y + 2, _x + _leftPadding + getEditRect().width() + 8, _y + _h);
|
||||||
setTextDrawableArea(r);
|
setTextDrawableArea(r);
|
||||||
|
|
||||||
g_gui.theme()->drawText(Common::Rect(_x + 2 + _leftPadding, _y + 2, _x + _leftPadding + getEditRect().width() + 2, _y + _h), _editString, _state, Graphics::kTextAlignLeft, ThemeEngine::kTextInversionNone, -_editScrollOffset, false, _font, ThemeEngine::kFontColorNormal, true, _textDrawableArea);
|
g_gui.theme()->drawTextClip(Common::Rect(_x + 2 + _leftPadding, _y + 2, _x + _leftPadding + getEditRect().width() + 2, _y + _h), getBossClipRect(), _editString, _state, Graphics::kTextAlignLeft, ThemeEngine::kTextInversionNone, -_editScrollOffset, false, _font, ThemeEngine::kFontColorNormal, true, _textDrawableArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::Rect EditTextWidget::getEditRect() const {
|
Common::Rect EditTextWidget::getEditRect() const {
|
||||||
|
|
|
@ -488,7 +488,7 @@ void ListWidget::drawWidget() {
|
||||||
Common::String buffer;
|
Common::String buffer;
|
||||||
|
|
||||||
// Draw a thin frame around the list.
|
// Draw a thin frame around the list.
|
||||||
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), 0, ThemeEngine::kWidgetBackgroundBorder);
|
g_gui.theme()->drawWidgetBackgroundClip(Common::Rect(_x, _y, _x + _w, _y + _h), getBossClipRect(), 0, ThemeEngine::kWidgetBackgroundBorder);
|
||||||
const int scrollbarW = (_scrollBar && _scrollBar->isVisible()) ? _scrollBarWidth : 0;
|
const int scrollbarW = (_scrollBar && _scrollBar->isVisible()) ? _scrollBarWidth : 0;
|
||||||
|
|
||||||
// Draw the list items
|
// Draw the list items
|
||||||
|
@ -507,7 +507,7 @@ void ListWidget::drawWidget() {
|
||||||
// If in numbering mode, we first print a number prefix
|
// If in numbering mode, we first print a number prefix
|
||||||
if (_numberingMode != kListNumberingOff) {
|
if (_numberingMode != kListNumberingOff) {
|
||||||
buffer = Common::String::format("%2d. ", (pos + _numberingMode));
|
buffer = Common::String::format("%2d. ", (pos + _numberingMode));
|
||||||
g_gui.theme()->drawText(Common::Rect(_x, y, _x + r.left + _leftPadding, y + fontHeight - 2),
|
g_gui.theme()->drawTextClip(Common::Rect(_x, y, _x + r.left + _leftPadding, y + fontHeight - 2), getBossClipRect(),
|
||||||
buffer, _state, Graphics::kTextAlignLeft, inverted, _leftPadding, true);
|
buffer, _state, Graphics::kTextAlignLeft, inverted, _leftPadding, true);
|
||||||
pad = 0;
|
pad = 0;
|
||||||
}
|
}
|
||||||
|
@ -528,12 +528,12 @@ void ListWidget::drawWidget() {
|
||||||
color = _editColor;
|
color = _editColor;
|
||||||
adjustOffset();
|
adjustOffset();
|
||||||
width = _w - r.left - _hlRightPadding - _leftPadding - scrollbarW;
|
width = _w - r.left - _hlRightPadding - _leftPadding - scrollbarW;
|
||||||
g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2), buffer, _state,
|
g_gui.theme()->drawTextClip(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2), getBossClipRect(), buffer, _state,
|
||||||
Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
|
Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
|
||||||
} else {
|
} else {
|
||||||
buffer = _list[pos];
|
buffer = _list[pos];
|
||||||
width = _w - r.left - scrollbarW;
|
width = _w - r.left - scrollbarW;
|
||||||
g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2), buffer, _state,
|
g_gui.theme()->drawTextClip(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2), getBossClipRect(), buffer, _state,
|
||||||
Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
|
Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ void ScrollContainerWidget::reflowLayout() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollContainerWidget::drawWidget() {
|
void ScrollContainerWidget::drawWidget() {
|
||||||
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x + _w, _y + getHeight() - 1), ThemeEngine::kDialogBackgroundDefault);
|
g_gui.theme()->drawDialogBackgroundClip(Common::Rect(_x, _y, _x + _w, _y + getHeight() - 1), getBossClipRect(), ThemeEngine::kDialogBackgroundDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget *ScrollContainerWidget::findWidget(int x, int y) {
|
Widget *ScrollContainerWidget::findWidget(int x, int y) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue