diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 22:55:02 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 22:55:02 +0200 |
commit | ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73 (patch) | |
tree | b803ae0a601e46cfa0539f79f76c731dc28652f2 /src/gui/widgets | |
parent | 2a3f16f5673e6482e422a65f6f23f958dd78955f (diff) | |
download | mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.tar.gz mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.tar.bz2 mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.tar.xz mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.zip |
Made the PopupMenu a Popup subclass
It's a natural better fit. The SkinLoader was changed into a singleton,
since it's used by both Window and Popup classes.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/popup.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/window.h | 1 |
3 files changed, 4 insertions, 11 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 7d73e749..41d60ab6 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -50,7 +50,7 @@ Popup::Popup(const std::string &name, const std::string &skin): setPadding(3); // Loads the skin - mSkin = skinLoader->load(skin, mDefaultSkinPath); + mSkin = SkinLoader::instance()->load(skin, mDefaultSkinPath); // Add this window to the window container windowContainer->add(this); @@ -85,7 +85,7 @@ void Popup::loadPopupConfiguration() if (skinName.compare(mSkin->getFilePath()) != 0) { mSkin->instances--; - mSkin = skinLoader->load(skinName, mDefaultSkinPath); + mSkin = SkinLoader::instance()->load(skinName, mDefaultSkinPath); } } diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 1d7961f3..f252c5f6 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -61,9 +61,6 @@ Window::Window(const std::string &caption, bool modal, Window *parent, const std if (!windowContainer) throw GCN_EXCEPTION("Window::Window(): no windowContainer set"); - if (instances == 0) - skinLoader = new SkinLoader; - instances++; setFrameSize(0); @@ -71,7 +68,7 @@ Window::Window(const std::string &caption, bool modal, Window *parent, const std setTitleBarHeight(20); // Loads the skin - mSkin = skinLoader->load(skin, mDefaultSkinPath); + mSkin = SkinLoader::instance()->load(skin, mDefaultSkinPath); // Add this window to the window container windowContainer->add(this); @@ -104,9 +101,6 @@ Window::~Window() instances--; mSkin->instances--; - - if (instances == 0) - delete skinLoader; } void Window::setWindowContainer(WindowContainer *wc) @@ -511,7 +505,7 @@ void Window::loadWindowState() if (skinName.compare(mSkin->getFilePath()) != 0) { mSkin->instances--; - mSkin = skinLoader->load(skinName, mDefaultSkinPath); + mSkin = SkinLoader::instance()->load(skinName, mDefaultSkinPath); } if (mGrip) diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index f53bc483..510b0f04 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -34,7 +34,6 @@ class Layout; class LayoutCell; class ResizeGrip; class Skin; -class SkinLoader; class WindowContainer; /** |