summaryrefslogtreecommitdiff
path: root/src/gui/widgets/browserbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-09 01:36:40 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-09 01:45:28 +0300
commite153ea49f7442a82651e4e35f2be59c459ad32cb (patch)
tree8daace3c1691df379296600af4ce3ab3ba5325d0 /src/gui/widgets/browserbox.cpp
parentb2c430f8e0fd67c6529227f8e8bebdc407ef530d (diff)
downloadmv-e153ea49f7442a82651e4e35f2be59c459ad32cb.tar.gz
mv-e153ea49f7442a82651e4e35f2be59c459ad32cb.tar.bz2
mv-e153ea49f7442a82651e4e35f2be59c459ad32cb.tar.xz
mv-e153ea49f7442a82651e4e35f2be59c459ad32cb.zip
Use all parameters in browserbox constructors.
Also load browserbox skin for each instance.
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-rw-r--r--src/gui/widgets/browserbox.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 6fd38e4c6..c8edf757b 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -44,7 +44,6 @@
#include "debug.h"
-Skin *BrowserBox::mSkin = nullptr;
ImageSet *BrowserBox::mEmotes = nullptr;
int BrowserBox::mInstances = 0;
@@ -58,6 +57,7 @@ BrowserBox::BrowserBox(const Widget2 *const widget, const unsigned int mode,
mLineParts(),
mLinks(),
mLinkHandler(nullptr),
+ mSkin(nullptr),
mMode(mode),
mHighMode(UNDERLINE | BACKGROUND),
mSelectedLink(-1),
@@ -84,10 +84,11 @@ BrowserBox::BrowserBox(const Widget2 *const widget, const unsigned int mode,
mBackgroundColor = getThemeColor(Theme::BACKGROUND);
+ Theme *const theme = Theme::instance();
+ if (theme)
+ mSkin = theme->load("browserbox.xml", "");
if (mInstances == 0)
{
- if (Theme::instance())
- mSkin = Theme::instance()->load("browserbox.xml", "");
mEmotes = ResourceManager::getInstance()->getImageSet(
"graphics/sprites/chatemotes.png", 17, 18);
}
@@ -130,11 +131,16 @@ BrowserBox::~BrowserBox()
if (gui)
gui->removeDragged(this);
+ Theme *const theme = Theme::instance();
+ if (theme)
+ {
+ theme->unload(mSkin);
+ mSkin = nullptr;
+ }
+
mInstances --;
if (mInstances == 0)
{
- if (Theme::instance())
- Theme::instance()->unload(mSkin);
if (mEmotes)
{
mEmotes->decRef();