[Scummvm-cvs-logs] SF.net SVN: scummvm: [22012] scummvm/trunk/gui
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Tue Apr 18 11:51:03 CEST 2006
Revision: 22012
Author: lordhoto
Date: 2006-04-18 11:50:07 -0700 (Tue, 18 Apr 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22012&view=rev
Log Message:
-----------
- Fixed popup widget for --force-1x-overlay with new theme
- adds support for highlightened popupwidgets
Modified Paths:
--------------
scummvm/trunk/gui/PopUpWidget.cpp
scummvm/trunk/gui/PopUpWidget.h
scummvm/trunk/gui/ThemeNew.cpp
Modified: scummvm/trunk/gui/PopUpWidget.cpp
===================================================================
--- scummvm/trunk/gui/PopUpWidget.cpp 2006-04-18 18:40:33 UTC (rev 22011)
+++ scummvm/trunk/gui/PopUpWidget.cpp 2006-04-18 18:50:07 UTC (rev 22012)
@@ -416,7 +416,7 @@
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
Modified: scummvm/trunk/gui/PopUpWidget.h
===================================================================
--- scummvm/trunk/gui/PopUpWidget.h 2006-04-18 18:40:33 UTC (rev 22011)
+++ scummvm/trunk/gui/PopUpWidget.h 2006-04-18 18:50:07 UTC (rev 22012)
@@ -77,6 +77,8 @@
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);
};
Modified: scummvm/trunk/gui/ThemeNew.cpp
===================================================================
--- scummvm/trunk/gui/ThemeNew.cpp 2006-04-18 18:40:33 UTC (rev 22011)
+++ scummvm/trunk/gui/ThemeNew.cpp 2006-04-18 18:50:07 UTC (rev 22012)
@@ -637,13 +637,18 @@
(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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list