summaryrefslogtreecommitdiff
path: root/src/gui/window.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-28 10:35:49 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-28 10:35:49 -0600
commit42a095de15649f0f00ef6c681268d6623205900c (patch)
tree1f7d509f088208fd5349e9a77d208637354636f3 /src/gui/window.h
parentef2e1bafa7c5f19b0353e0bf01a7ad9d7f8cddf5 (diff)
downloadmana-client-42a095de15649f0f00ef6c681268d6623205900c.tar.gz
mana-client-42a095de15649f0f00ef6c681268d6623205900c.tar.bz2
mana-client-42a095de15649f0f00ef6c681268d6623205900c.tar.xz
mana-client-42a095de15649f0f00ef6c681268d6623205900c.zip
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.
Diffstat (limited to 'src/gui/window.h')
-rw-r--r--src/gui/window.h18
1 files changed, 15 insertions, 3 deletions
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
@@ -145,16 +145,21 @@ 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
@@ -163,6 +168,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.
*
* @return The parent window or <code>NULL</code> if there is none.
@@ -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 */