summaryrefslogtreecommitdiff
path: root/src/gui/emotewindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-14 22:13:04 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-14 22:13:04 +0300
commit41f47b3b0a9e0350b4955d4c05845eeca5143663 (patch)
treed89a0651d83f1de32b4ecd371f524b8dc902fe49 /src/gui/emotewindow.cpp
parentd0b0c1c8bbb8ce9fbf93887ed7dae5f779d17a21 (diff)
downloadmanaplus-41f47b3b0a9e0350b4955d4c05845eeca5143663.tar.gz
manaplus-41f47b3b0a9e0350b4955d4c05845eeca5143663.tar.bz2
manaplus-41f47b3b0a9e0350b4955d4c05845eeca5143663.tar.xz
manaplus-41f47b3b0a9e0350b4955d4c05845eeca5143663.zip
add icons into tabs in chat emotes window.
Diffstat (limited to 'src/gui/emotewindow.cpp')
-rw-r--r--src/gui/emotewindow.cpp38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/gui/emotewindow.cpp b/src/gui/emotewindow.cpp
index f0b9f905f..848c9db34 100644
--- a/src/gui/emotewindow.cpp
+++ b/src/gui/emotewindow.cpp
@@ -35,6 +35,8 @@
#include "utils/gettext.h"
+#include "resources/imageset.h"
+
#include <guichan/font.hpp>
#include "debug.h"
@@ -59,7 +61,8 @@ EmoteWindow::EmoteWindow() :
mScrollColorPage(new ScrollArea(mColorPage, false, "emotepage.xml")),
mFontModel(new NamesModel),
mFontPage(new ListBox(this, mFontModel, "")),
- mScrollFontPage(new ScrollArea(mFontPage, false, "fontpage.xml"))
+ mScrollFontPage(new ScrollArea(mFontPage, false, "fontpage.xml")),
+ mImageSet(Theme::getImageSetFromThemeXml("emotetabs.xml", "", 17, 16))
{
setShowTitle(false);
setResizable(true);
@@ -85,12 +88,28 @@ EmoteWindow::EmoteWindow() :
mFontModel->fillFromArray(&fontSizeList[0], fontSizeListSize);
mFontPage->setCenter(true);
- // TRANSLATORS: emotes tab name
- mTabs->addTab(_("Emotes"), mEmotePage);
- // TRANSLATORS: emotes tab name
- mTabs->addTab(_("Colors"), mScrollColorPage);
- // TRANSLATORS: emotes tab name
- mTabs->addTab(_("Fonts"), mScrollFontPage);
+ if (mImageSet && mImageSet->size() >= 3)
+ {
+ for (int f = 0; f < 3; f ++)
+ {
+ Image *const image = mImageSet->get(f);
+ if (image)
+ image->incRef();
+ }
+
+ mTabs->addTab(mImageSet->get(0), mEmotePage);
+ mTabs->addTab(mImageSet->get(1), mScrollColorPage);
+ mTabs->addTab(mImageSet->get(2), mScrollFontPage);
+ }
+ else
+ {
+ // TRANSLATORS: emotes tab name
+ mTabs->addTab(_("Emotes"), mEmotePage);
+ // TRANSLATORS: emotes tab name
+ mTabs->addTab(_("Colors"), mScrollColorPage);
+ // TRANSLATORS: emotes tab name
+ mTabs->addTab(_("Fonts"), mScrollFontPage);
+ }
mEmotePage->setActionEventId("emote");
mColorPage->setActionEventId("color");
@@ -115,6 +134,11 @@ EmoteWindow::~EmoteWindow()
mFontModel = nullptr;
delete mScrollFontPage;
mScrollFontPage = nullptr;
+ if (mImageSet)
+ {
+ mImageSet->decRef();
+ mImageSet = nullptr;
+ }
}
void EmoteWindow::show()