summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeavey <peavey@inspircd.org>2009-05-10 22:26:39 +0200
committerpeavey <peavey@inspircd.org>2009-05-10 22:26:39 +0200
commite6c1af6d47aa79f02e0bf20ade42158511f25c69 (patch)
treea34f3dea0c3978b4e65166bc3f879915449f133c
parent3c912139aef92a3e070ade966c91c297b7a5310c (diff)
downloadmana-client-e6c1af6d47aa79f02e0bf20ade42158511f25c69.tar.gz
mana-client-e6c1af6d47aa79f02e0bf20ade42158511f25c69.tar.bz2
mana-client-e6c1af6d47aa79f02e0bf20ade42158511f25c69.tar.xz
mana-client-e6c1af6d47aa79f02e0bf20ade42158511f25c69.zip
Fix visibility and stickyness so its saved correctly
-rw-r--r--src/gui/minimap.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index d939ea27..3dab63a3 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -56,20 +56,21 @@ Minimap::Minimap():
setResizable(false);
setDefaultVisible(true);
- setSaveVisible(true);
+ setSaveVisible(false);
setStickyButton(true);
setSticky(false);
loadWindowState();
+ setVisible(mShow);
}
Minimap::~Minimap()
{
+ config.setValue(getWindowName() + "Show", mShow);
+
if (mMapImage)
mMapImage->decRef();
-
- config.setValue(getWindowName() + "Show", mShow);
}
void Minimap::setMap(Map *map)
@@ -93,6 +94,9 @@ void Minimap::setMap(Map *map)
ResourceManager *resman = ResourceManager::getInstance();
mMapImage = resman->getImage(map->getProperty("minimap"));
+ if (!mShow)
+ return;
+
if (mMapImage)
{
const int offsetX = 2 * getPadding();
@@ -116,7 +120,7 @@ void Minimap::setMap(Map *map)
setDefaultSize(getX(), getY(), getWidth(), getHeight());
resetToDefaultSize();
- setVisible(mShow);
+ setVisible(true);
}
else
{
@@ -126,7 +130,8 @@ void Minimap::setMap(Map *map)
void Minimap::toggle()
{
- setVisible(!isVisible(), true);
+ setVisible(!mShow, isSticky());
+ mShow = isVisible();
}
void Minimap::draw(gcn::Graphics *graphics)