summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-09 12:43:50 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-09 12:43:50 +0300
commitd189d362ba4b1b7c7963e925638eb5f12baba882 (patch)
tree140f7e1092a532bc89abace4d7fb659510055b29 /src/gui
parente153ea49f7442a82651e4e35f2be59c459ad32cb (diff)
downloadplus-d189d362ba4b1b7c7963e925638eb5f12baba882.tar.gz
plus-d189d362ba4b1b7c7963e925638eb5f12baba882.tar.bz2
plus-d189d362ba4b1b7c7963e925638eb5f12baba882.tar.xz
plus-d189d362ba4b1b7c7963e925638eb5f12baba882.zip
allow set different skin for browserboxes.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popups/popupmenu.cpp3
-rw-r--r--src/gui/widgets/browserbox.cpp8
-rw-r--r--src/gui/widgets/browserbox.h3
-rw-r--r--src/gui/widgets/tabs/chattab.cpp3
-rw-r--r--src/gui/widgets/tabs/setup_colors.cpp3
-rw-r--r--src/gui/windows/didyouknowwindow.cpp3
-rw-r--r--src/gui/windows/helpwindow.cpp3
-rw-r--r--src/gui/windows/npcdialog.cpp3
-rw-r--r--src/gui/windows/questswindow.cpp2
-rw-r--r--src/gui/windows/socialwindow.cpp3
-rw-r--r--src/gui/windows/updaterwindow.cpp3
-rw-r--r--src/gui/windows/whoisonline.cpp3
12 files changed, 26 insertions, 14 deletions
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index fc4c91c8c..a0096e17c 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -89,7 +89,8 @@ std::string tradePartnerName;
PopupMenu::PopupMenu() :
Popup("PopupMenu", "popupmenu.xml"),
- mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true)),
+ mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true,
+ "browserbox.xml")),
mScrollArea(nullptr),
mBeingId(0),
mFloorItemId(0),
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index c8edf757b..df0fd5705 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -47,8 +47,10 @@
ImageSet *BrowserBox::mEmotes = nullptr;
int BrowserBox::mInstances = 0;
-BrowserBox::BrowserBox(const Widget2 *const widget, const unsigned int mode,
- const bool opaque) :
+BrowserBox::BrowserBox(const Widget2 *const widget,
+ const unsigned int mode,
+ const bool opaque,
+ const std::string &skin) :
gcn::Widget(),
Widget2(widget),
gcn::MouseListener(),
@@ -86,7 +88,7 @@ BrowserBox::BrowserBox(const Widget2 *const widget, const unsigned int mode,
Theme *const theme = Theme::instance();
if (theme)
- mSkin = theme->load("browserbox.xml", "");
+ mSkin = theme->load(skin, "browserbox.xml");
if (mInstances == 0)
{
mEmotes = ResourceManager::getInstance()->getImageSet(
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index f57519700..87ed57382 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -112,7 +112,8 @@ class BrowserBox final : public gcn::Widget,
*/
BrowserBox(const Widget2 *const widget,
const unsigned int mode,
- const bool opaque);
+ const bool opaque,
+ const std::string &skin);
A_DELETE_COPY(BrowserBox)
diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp
index 7ad6e303d..b4a8cb158 100644
--- a/src/gui/widgets/tabs/chattab.cpp
+++ b/src/gui/widgets/tabs/chattab.cpp
@@ -53,7 +53,8 @@ static const unsigned int MAX_WORD_SIZE = 50;
ChatTab::ChatTab(const Widget2 *const widget, const std::string &name,
const std::string &channel) :
Tab(widget),
- mTextOutput(new BrowserBox(this, BrowserBox::AUTO_WRAP, true)),
+ mTextOutput(new BrowserBox(this, BrowserBox::AUTO_WRAP, true,
+ "browserbox.xml")),
mScrollArea(new ScrollArea(mTextOutput, false)),
mChannelName(channel),
mAllowHightlight(true),
diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp
index 28b6d39f6..13303bd88 100644
--- a/src/gui/widgets/tabs/setup_colors.cpp
+++ b/src/gui/widgets/tabs/setup_colors.cpp
@@ -50,7 +50,8 @@ Setup_Colors::Setup_Colors(const Widget2 *const widget) :
gcn::SelectionListener(),
mColorBox(new ListBox(this, userPalette, "")),
mScroll(new ScrollArea(mColorBox, true, "setup_colors_background.xml")),
- mPreview(new BrowserBox(this, BrowserBox::AUTO_WRAP, true)),
+ mPreview(new BrowserBox(this, BrowserBox::AUTO_WRAP, true,
+ "browserbox.xml")),
mTextPreview(new TextPreview(this, gettext(rawmsg))),
mPreviewBox(new ScrollArea(mPreview, true,
"setup_colors_preview_background.xml")),
diff --git a/src/gui/windows/didyouknowwindow.cpp b/src/gui/windows/didyouknowwindow.cpp
index f854e58f5..41d515df2 100644
--- a/src/gui/windows/didyouknowwindow.cpp
+++ b/src/gui/windows/didyouknowwindow.cpp
@@ -49,7 +49,8 @@ DidYouKnowWindow::DidYouKnowWindow() :
// TRANSLATORS: did you know window name
Window(_("Did You Know?"), false, nullptr, "didyouknow.xml"),
gcn::ActionListener(),
- mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true)),
+ mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true,
+ "browserbox.xml")),
mScrollArea(new ScrollArea(mBrowserBox,
true, "didyouknow_background.xml")),
// TRANSLATORS: did you know window button
diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp
index 27632517e..f5ece1df3 100644
--- a/src/gui/windows/helpwindow.cpp
+++ b/src/gui/windows/helpwindow.cpp
@@ -51,7 +51,8 @@ HelpWindow::HelpWindow() :
gcn::ActionListener(),
// TRANSLATORS: help window. button.
mDYKButton(new Button(this, _("Did you know..."), "DYK", this)),
- mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true)),
+ mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true,
+ "browserbox.xml")),
mScrollArea(new ScrollArea(mBrowserBox, true, "help_background.xml")),
mTagFileMap()
{
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp
index f4cecbb88..4f3d851c2 100644
--- a/src/gui/windows/npcdialog.cpp
+++ b/src/gui/windows/npcdialog.cpp
@@ -84,7 +84,8 @@ NpcDialog::NpcDialog(const int npcId) :
mNpcId(npcId),
mDefaultInt(0),
mDefaultString(),
- mTextBox(new BrowserBox(this, BrowserBox::AUTO_WRAP, true)),
+ mTextBox(new BrowserBox(this, BrowserBox::AUTO_WRAP, true,
+ "browserbox.xml")),
mScrollArea(new ScrollArea(mTextBox,
getOptionBool("showtextbackground"), "npc_textbackground.xml")),
mText(),
diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp
index ea91dd9b0..7ac9a1efb 100644
--- a/src/gui/windows/questswindow.cpp
+++ b/src/gui/windows/questswindow.cpp
@@ -127,7 +127,7 @@ QuestsWindow::QuestsWindow() :
mQuestScrollArea(new ScrollArea(mQuestsListBox,
getOptionBool("showlistbackground"), "quests_list_background.xml")),
mItemLinkHandler(new ItemLinkHandler),
- mText(new BrowserBox(this, BrowserBox::AUTO_WRAP, true)),
+ mText(new BrowserBox(this, BrowserBox::AUTO_WRAP, true, "browserbox.xml")),
mTextScrollArea(new ScrollArea(mText,
getOptionBool("showtextbackground"), "quests_text_background.xml")),
// TRANSLATORS: quests window button
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index 2847c0d0f..9b22e2792 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -1207,7 +1207,8 @@ public:
CreatePopup() :
Popup("SocialCreatePopup"),
LinkHandler(),
- mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true))
+ mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true,
+ "browserbox.xml"))
{
mBrowserBox->setPosition(4, 4);
mBrowserBox->setHighlightMode(BrowserBox::BACKGROUND);
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index e49d858fd..10b887132 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -180,7 +180,8 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost,
// TRANSLATORS: updater window button
mPlayButton(new Button(this, _("Play"), "play", this)),
mProgressBar(new ProgressBar(this, 0.0, 310, 0)),
- mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true)),
+ mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true,
+ "browserbox.xml")),
mScrollArea(new ScrollArea(mBrowserBox, true, "update_background.xml")),
mUpdateServerPath(mUpdateHost)
{
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index 2b5bac534..edff9b406 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -85,7 +85,8 @@ WhoIsOnline::WhoIsOnline() :
mDownloadedBytes(0),
mMemoryBuffer(nullptr),
mCurlError(new char[CURL_ERROR_SIZE]),
- mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true)),
+ mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true,
+ "browserbox.xml")),
mScrollArea(new ScrollArea(mBrowserBox, false)),
mUpdateTimer(0),
mOnlinePlayers(),