diff options
author | peavey <peavey@inspircd.org> | 2009-05-10 22:26:39 +0200 |
---|---|---|
committer | peavey <peavey@inspircd.org> | 2009-05-10 22:26:39 +0200 |
commit | e6c1af6d47aa79f02e0bf20ade42158511f25c69 (patch) | |
tree | a34f3dea0c3978b4e65166bc3f879915449f133c /src | |
parent | 3c912139aef92a3e070ade966c91c297b7a5310c (diff) | |
download | mana-e6c1af6d47aa79f02e0bf20ade42158511f25c69.tar.gz mana-e6c1af6d47aa79f02e0bf20ade42158511f25c69.tar.bz2 mana-e6c1af6d47aa79f02e0bf20ade42158511f25c69.tar.xz mana-e6c1af6d47aa79f02e0bf20ade42158511f25c69.zip |
Fix visibility and stickyness so its saved correctly
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/minimap.cpp | 15 |
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) |