[Scummvm-cvs-logs] SF.net SVN: scummvm:[33264] scummvm/branches/gsoc2008-gui/gui
Tanoku at users.sourceforge.net
Tanoku at users.sourceforge.net
Thu Jul 24 20:40:37 CEST 2008
Revision: 33264
http://scummvm.svn.sourceforge.net/scummvm/?rev=33264&view=rev
Author: Tanoku
Date: 2008-07-24 18:40:36 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
Scrollbars. Work in progress.
Modified Paths:
--------------
scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp
scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h
Modified: scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp 2008-07-24 10:31:37 UTC (rev 33263)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeDefaultXML.cpp 2008-07-24 18:40:36 UTC (rev 33264)
@@ -54,7 +54,7 @@
"<defaults fill = 'gradient' fg_color = '255, 255, 255' />"
"<drawdata id = 'text_selection' cache = false>"
- "<drawstep func = 'square' fill = 'foreground' fg_color = '255, 255, 255' />"
+ "<drawstep func = 'roundedsq' radius = 4 fill = 'foreground' fg_color = '255, 255, 255' />"
"</drawdata>"
"<drawdata id = 'mainmenu_bg' cache = false>"
@@ -66,9 +66,27 @@
"</drawdata>"
"<drawdata id = 'scrollbar_base' cache = false>"
- "<drawstep func = 'roundedsq' stroke = 1 radius = 4 fill = 'none' fg_color = '255, 255, 255' />"
+ "<drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'background' fg_color = '120, 120, 120' bg_color = '255, 243, 206' />"
"</drawdata>"
+ "<drawdata id = 'scrollbar_handle_hover' cache = false>"
+ "<drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'gradient' fg_color = '255, 255, 255' gradient_start = '206, 121, 99' gradient_end = '173, 40, 8' />"
+ "</drawdata>"
+
+ "<drawdata id = 'scrollbar_handle_idle' cache = false>"
+ "<drawstep func = 'roundedsq' stroke = 1 radius = 6 fill = 'background' fg_color = '120, 120, 120' bg_color = '255, 255, 255' />"
+ "</drawdata>"
+
+ "<drawdata id = 'scrollbar_button_idle' cache = false>"
+ "<drawstep func = 'roundedsq' radius = '4' fill = 'none' fg_color = '120, 120, 120' stroke = 1 />"
+ "<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = '9' height = '7' xpos = 'center' ypos = 'center' orientation = 'top' />"
+ "</drawdata>"
+
+ "<drawdata id = 'scrollbar_button_hover' cache = false>"
+ "<drawstep func = 'roundedsq' radius = '4' fill = 'background' fg_color = '120, 120, 120' bg_color = '206, 121, 99' stroke = 1 />"
+ "<drawstep func = 'triangle' fg_color = '0, 0, 0' fill = 'foreground' width = '9' height = '7' xpos = 'center' ypos = 'center' orientation = 'top' />"
+ "</drawdata>"
+
"<drawdata id = 'tab_active' cache = false>"
"<text font = 'text_default' vertical_align = 'center' horizontal_align = 'center' />"
"<drawstep func = 'tab' radius = '4' stroke = '2' fill = 'gradient' gradient_end = '255, 231, 140' gradient_start = '255, 243, 206' shadow = 3 />"
Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp 2008-07-24 10:31:37 UTC (rev 33263)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.cpp 2008-07-24 18:40:36 UTC (rev 33264)
@@ -64,7 +64,12 @@
{kDDTabInactive, "tab_inactive", true, kDDNone},
{kDDScrollbarBase, "scrollbar_base", true, kDDNone},
- {kDDScrollbarHandle, "scrollbar_handle", false, kDDScrollbarBase},
+
+ {kDDScrollbarButtonIdle, "scrollbar_button_idle", true, kDDNone},
+ {kDDScrollbarButtonHover, "scrollbar_button_hover", false, kDDScrollbarButtonIdle},
+
+ {kDDScrollbarHandleIdle, "scrollbar_handle_idle", false, kDDNone},
+ {kDDScrollbarHandleHover, "scrollbar_handle_hover", false, kDDScrollbarBase},
{kDDPopUpIdle, "popup_idle", true, kDDNone},
{kDDPopUpHover, "popup_hover", false, kDDPopUpIdle},
@@ -461,12 +466,27 @@
queueDD(kDDSliderFull, r2);
}
-void ThemeRenderer::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState sb_state, WidgetStateInfo state) {
+void ThemeRenderer::drawScrollbar(const Common::Rect &r, int sliderY, int sliderHeight, ScrollbarState scrollState, WidgetStateInfo state) {
if (!ready())
return;
queueDD(kDDScrollbarBase, r);
- // TODO: Need to find a scrollbar in the GUI for testing... :p
+
+ Common::Rect r2 = r;
+ const int buttonExtra = (r.width() * 120) / 100;
+
+ r2.bottom = r2.top + buttonExtra;
+ queueDD(scrollState == kScrollbarStateUp ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2);
+
+ r2.translate(0, r.height() - r2.height());
+ queueDD(scrollState == kScrollbarStateDown ? kDDScrollbarButtonHover : kDDScrollbarButtonIdle, r2);
+
+ r2 = r;
+ r2.left += 1;
+ r2.right -= 1;
+ r2.top += sliderY;
+ r2.bottom = r2.top + sliderHeight - 1;
+ queueDD(scrollState == kScrollbarStateSlider ? kDDScrollbarHandleHover : kDDScrollbarHandleIdle, r2);
}
void ThemeRenderer::drawDialogBackground(const Common::Rect &r, uint16 hints, WidgetStateInfo state) {
Modified: scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h 2008-07-24 10:31:37 UTC (rev 33263)
+++ scummvm/branches/gsoc2008-gui/gui/ThemeRenderer.h 2008-07-24 18:40:36 UTC (rev 33264)
@@ -125,7 +125,10 @@
kDDTabInactive,
kDDScrollbarBase,
- kDDScrollbarHandle,
+ kDDScrollbarButtonIdle,
+ kDDScrollbarButtonHover,
+ kDDScrollbarHandleIdle,
+ kDDScrollbarHandleHover,
kDDPopUpIdle,
kDDPopUpHover,
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