summaryrefslogtreecommitdiff
path: root/widget.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-12-15 23:33:04 +0000
committerdarkvater <darkvater@openttd.org>2004-12-15 23:33:04 +0000
commit83981e40b594af221abf78eab41aa41182003b52 (patch)
tree74df7f1875fe162b316df2d10c6bb505e11cea71 /widget.c
parentec94450aef385beb279e5b158389767611112f40 (diff)
downloadopenttd-83981e40b594af221abf78eab41aa41182003b52.tar.xz
(svn r1121) -Feature: Added sticky windows feature. A small pin allows the user to set the window as undeletable and can only be closed by hand. As an example the viewport window has been stickied (thanks to Neko-San)
-To use the feature add WDF_STICKY_BUTTON to the widget description and update all widget-ID's since sticky button will be widget 2.
Diffstat (limited to 'widget.c')
-rw-r--r--widget.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/widget.c b/widget.c
index 7ea268146..013083ef2 100644
--- a/widget.c
+++ b/widget.c
@@ -348,6 +348,12 @@ void DrawWindowWidgets(Window *w)
goto restore_dparam;
}
+ case WWT_STICKYBOX: {
+ DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (cur_click & 1) ? 0x20 : 0);
+ DrawSprite((cur_click & 1) ? SPR_PIN_UP :SPR_PIN_DOWN, r.left + 2, r.top + 3);
+ break;
+ }
+
case WWT_CAPTION: {
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0x10);
DrawFrameRect(r.left+1, r.top+1, r.right-1, r.bottom-1, wi->color, (w->caption_color == 0xFF) ? 0x60 : 0x70);