From 42a095de15649f0f00ef6c681268d6623205900c Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sat, 28 Mar 2009 10:35:49 -0600 Subject: Add a sticky button to the Window class The Minimap window uses this so you can froce it to always be open. The Minimap toggle button can be used to show or hide it temporarily, as warping will reset it's visibility based on the sticky state and weather the 'new' map has a minimap. --- src/gui/window.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/gui/window.h') diff --git a/src/gui/window.h b/src/gui/window.h index c41a4221..18a64532 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -144,17 +144,22 @@ class Window : public gcn::Window, gcn::WidgetListener */ void setShowTitle(bool flag) { mShowTitle = flag; } + /** + * Sets whether or not the window has a sticky button. + */ + void setStickyButton(bool flag); + /** * Sets whether the window is sticky. A sticky window will not have * its visibility set to false on a general setVisible(false) call. + * Use this to set the default before you call loadWindowState(). */ void setSticky(bool sticky); /** * Returns whether the window is sticky. */ - bool isSticky() const - { return mSticky; } + bool isSticky() const { return mSticky; } /** * Overloads window setVisible by Guichan to allow sticky window @@ -162,6 +167,12 @@ class Window : public gcn::Window, gcn::WidgetListener */ void setVisible(bool visible); + /** + * Overloads window setVisible by Guichan to allow sticky window + * handling, or not, if you force the sticky state. + */ + void setVisible(bool visible, bool forceSticky); + /** * Returns the parent window. * @@ -325,7 +336,8 @@ class Window : public gcn::Window, gcn::WidgetListener bool mShowTitle; /**< Window has a title bar */ bool mModal; /**< Window is modal */ bool mCloseButton; /**< Window has a close button */ - bool mSticky; /**< Window resists minimization */ + bool mStickyButton; /**< Window has a sticky button */ + bool mSticky; /**< Window resists hiding*/ int mMinWinWidth; /**< Minimum window width */ int mMinWinHeight; /**< Minimum window height */ int mMaxWinWidth; /**< Maximum window width */ -- cgit v1.2.3-70-g09d2