aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJohannes Schickel2006-04-18 18:50:07 +0000
committerJohannes Schickel2006-04-18 18:50:07 +0000
commita9431edca2f5ed3a8e6753662822393755bc69e6 (patch)
treed3425dc1cef9efd1ad27a56c94852ec5b6e26a9a /gui
parent1ae205a2412eb0503e2ed26245f653e7047af982 (diff)
downloadscummvm-rg350-a9431edca2f5ed3a8e6753662822393755bc69e6.tar.gz
scummvm-rg350-a9431edca2f5ed3a8e6753662822393755bc69e6.tar.bz2
scummvm-rg350-a9431edca2f5ed3a8e6753662822393755bc69e6.zip
- Fixed popup widget for --force-1x-overlay with new theme
- adds support for highlightened popupwidgets svn-id: r22012
Diffstat (limited to 'gui')
-rw-r--r--gui/PopUpWidget.cpp2
-rw-r--r--gui/PopUpWidget.h2
-rw-r--r--gui/ThemeNew.cpp11
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);