diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/PopUpWidget.cpp | 2 | ||||
-rw-r--r-- | gui/PopUpWidget.h | 2 | ||||
-rw-r--r-- | gui/ThemeNew.cpp | 11 |
3 files changed, 11 insertions, 4 deletions
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp index c04d3d7767..859d7f0ba8 100644 --- a/gui/PopUpWidget.cpp +++ b/gui/PopUpWidget.cpp @@ -416,7 +416,7 @@ void PopUpWidget::drawWidget(bool hilite) { Common::String sel = ""; if (_selectedItem >= 0) sel = _entries[_selectedItem].name; - g_gui.theme()->drawPopUpWidget(Common::Rect(x, _y, x+w, _y+_h), sel, _leftPadding, isEnabled() ? Theme::kStateEnabled : Theme::kStateDisabled, g_gui.theme()->convertAligment(kTextAlignLeft)); + g_gui.theme()->drawPopUpWidget(Common::Rect(x, _y, x+w, _y+_h), sel, _leftPadding, isEnabled() ? (hilite ? Theme::kStateHighlight : Theme::kStateEnabled) : Theme::kStateDisabled, g_gui.theme()->convertAligment(kTextAlignLeft)); } } // End of namespace GUI diff --git a/gui/PopUpWidget.h b/gui/PopUpWidget.h index 471e5c9154..786f3461f8 100644 --- a/gui/PopUpWidget.h +++ b/gui/PopUpWidget.h @@ -77,6 +77,8 @@ public: uint32 getSelectedTag() const { return (_selectedItem >= 0) ? _entries[_selectedItem].tag : (uint32)-1; } const String& getSelectedString() const { return (_selectedItem >= 0) ? _entries[_selectedItem].name : String::emptyString; } + void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); draw(); } + void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); draw(); } protected: void drawWidget(bool hilite); }; diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp index 51080d160f..60b160b03a 100644 --- a/gui/ThemeNew.cpp +++ b/gui/ThemeNew.cpp @@ -637,13 +637,18 @@ void ThemeNew::drawPopUpWidget(const Common::Rect &r, const Common::String &sel, (state == kStateDisabled) ? -30 : 256, start, end, _gradientFactors[kPopUpWidgetFactor]); const Graphics::Surface *arrow = surface(kWidgetArrow); - Common::Rect arrowRect(r.right - 4 - arrow->w, r.top + 4, r.right - 4, r.top + 4 + arrow->h); + + int yOff = r.height() / 2 - arrow->h; + if (yOff < 0) + yOff = 0; + + Common::Rect arrowRect(r.right - 4 - arrow->w, r.top + yOff, r.right - 4, r.top + yOff + arrow->h); arrowRect.clip(r); drawSurface(arrowRect, arrow, false, false, (state == kStateDisabled) ? -30 : 256); - arrowRect.top += arrow->h + 1; - arrowRect.bottom += arrow->h + 1; + arrowRect.top += arrow->h; + arrowRect.bottom += arrow->h; arrowRect.clip(r); drawSurface(arrowRect, arrow, true, false, (state == kStateDisabled) ? -30 : 256); |