From ebefed376b4858e8638f97cf36e95f6e8c047f24 Mon Sep 17 00:00:00 2001 From: peavey Date: Mon, 11 May 2009 00:26:14 +0200 Subject: Fix a few states on minimap that I missed. mShow now replaces the visibility setting since this is only saved on manually setting visibility. go back to saving visibility and use sticky bit to decide if minimap should be turned off or not. --- src/gui/minimap.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index aa06da31..17a7e82a 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -56,13 +56,13 @@ Minimap::Minimap(): setResizable(false); setDefaultVisible(true); - setSaveVisible(false); + setSaveVisible(true); setStickyButton(true); setSticky(false); loadWindowState(); - setVisible(mShow); + setVisible(mShow, isSticky()); } Minimap::~Minimap() @@ -94,9 +94,6 @@ 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(); @@ -120,17 +117,19 @@ void Minimap::setMap(Map *map) setDefaultSize(getX(), getY(), getWidth(), getHeight()); resetToDefaultSize(); - setVisible(true); + if (mShow) + setVisible(true); } else { - setVisible(false); + if (!isSticky()) + setVisible(false); } } void Minimap::toggle() { - setVisible(!mShow, isSticky()); + setVisible(!isVisible(), isSticky()); mShow = isVisible(); } -- cgit v1.2.3-70-g09d2