diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-02 21:11:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-02 21:11:22 +0300 |
commit | ca0032e744ea7244e70714ed356cfdb37dc26be2 (patch) | |
tree | ba27441fb964cdb7e4fd3864624d66093c9af39d | |
parent | 22d6df52861012841d1ff4c388cf5a44359d6f07 (diff) | |
download | manaplus-ca0032e744ea7244e70714ed356cfdb37dc26be2.tar.gz manaplus-ca0032e744ea7244e70714ed356cfdb37dc26be2.tar.bz2 manaplus-ca0032e744ea7244e70714ed356cfdb37dc26be2.tar.xz manaplus-ca0032e744ea7244e70714ed356cfdb37dc26be2.zip |
Add option to show/hide background in social window tabs.
-rw-r--r-- | data/themes/mana/CMakeLists.txt | 1 | ||||
-rw-r--r-- | data/themes/mana/Makefile.am | 3 | ||||
-rw-r--r-- | data/themes/mana/social.xml | 24 | ||||
-rw-r--r-- | src/gui/socialwindow.cpp | 49 |
4 files changed, 52 insertions, 25 deletions
diff --git a/data/themes/mana/CMakeLists.txt b/data/themes/mana/CMakeLists.txt index 6103cebe6..45fcf55d8 100644 --- a/data/themes/mana/CMakeLists.txt +++ b/data/themes/mana/CMakeLists.txt @@ -1,5 +1,6 @@ SET (FILES colors.xml + social.xml ) INSTALL(FILES ${FILES} DESTINATION ${DATA_DIR}/themes/mana) diff --git a/data/themes/mana/Makefile.am b/data/themes/mana/Makefile.am index 53253d93e..dc2fed230 100644 --- a/data/themes/mana/Makefile.am +++ b/data/themes/mana/Makefile.am @@ -2,7 +2,8 @@ guidir = $(pkgdatadir)/data/themes/mana gui_DATA = \ - colors.xml + colors.xml \ + social.xml EXTRA_DIST = \ $(gui_DATA) \ diff --git a/data/themes/mana/social.xml b/data/themes/mana/social.xml new file mode 100644 index 000000000..db05a14fb --- /dev/null +++ b/data/themes/mana/social.xml @@ -0,0 +1,24 @@ +<skinset name="Default" image="window.png"> + <widget type="Window"> + <option name="showtabbackground" value="1" /> + + <!-- Top Row --> + <part type="top-left-corner" xpos="0" ypos="0" width="4" height="4" /> + <part type="top-edge" xpos="4" ypos="0" width="32" height="4" /> + <part type="top-right-corner" xpos="36" ypos="0" width="4" height="4" /> + + <!-- Middle Row --> + <part type="left-edge" xpos="0" ypos="4" width="4" height="216" /> + <part type="bg-quad" xpos="4" ypos="4" width="32" height="216" /> + <part type="right-edge" xpos="36" ypos="4" width="4" height="216" /> + + <!-- Bottom Row --> + <part type="bottom-left-corner" xpos="0" ypos="220" width="4" height="4" /> + <part type="bottom-edge" xpos="4" ypos="220" width="32" height="4" /> + <part type="bottom-right-corner" xpos="36" ypos="220" width="4" height="4" /> + + <part type="closeImage" xpos="130" ypos="0" width="15" height="15" /> + <part type="stickyImageUp" xpos="130" ypos="51" width="15" height="15" /> + <part type="stickyImageDown" xpos="145" ypos="51" width="15" height="15" /> + </widget> +</skinset> diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index a9fafad77..bb252c688 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -140,7 +140,7 @@ protected: class SocialGuildTab : public SocialTab, public gcn::ActionListener { public: - SocialGuildTab(Guild *guild): + SocialGuildTab(Guild *guild, bool showBackground): mGuild(guild) { setCaption(_("Guild")); @@ -148,7 +148,7 @@ public: setTabColor(&Theme::getThemeColor(Theme::GUILD_SOCIAL_TAB)); mList = new AvatarListBox(guild); - mScroll = new ScrollArea(mList, false); + mScroll = new ScrollArea(mList, showBackground); mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO); mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); @@ -238,7 +238,7 @@ private: class SocialGuildTab2 : public SocialTab, public gcn::ActionListener { public: - SocialGuildTab2(Guild *guild): + SocialGuildTab2(Guild *guild, bool showBackground): mGuild(guild) { setCaption(_("Guild")); @@ -246,7 +246,7 @@ public: setTabColor(&Theme::getThemeColor(Theme::GUILD_SOCIAL_TAB)); mList = new AvatarListBox(guild); - mScroll = new ScrollArea(mList, false); + mScroll = new ScrollArea(mList, showBackground); mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO); mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); @@ -292,7 +292,7 @@ private: class SocialPartyTab : public SocialTab, public gcn::ActionListener { public: - SocialPartyTab(Party *party): + SocialPartyTab(Party *party, bool showBackground): mParty(party) { setCaption(_("Party")); @@ -300,7 +300,7 @@ public: setTabColor(&Theme::getThemeColor(Theme::PARTY_SOCIAL_TAB)); mList = new AvatarListBox(party); - mScroll = new ScrollArea(mList, false); + mScroll = new ScrollArea(mList, showBackground); mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO); mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); @@ -420,11 +420,11 @@ public: class SocialPlayersTab : public SocialTab { public: - SocialPlayersTab(std::string name) : + SocialPlayersTab(std::string name, bool showBackground) : mBeings(new BeingsListModal()) { mList = new AvatarListBox(mBeings); - mScroll = new ScrollArea(mList, false); + mScroll = new ScrollArea(mList, showBackground); mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO); mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); @@ -585,11 +585,11 @@ private: class SocialNavigationTab : public SocialTab { public: - SocialNavigationTab() : + SocialNavigationTab(bool showBackground) : mBeings(new BeingsListModal()) { mList = new AvatarListBox(mBeings); - mScroll = new ScrollArea(mList, false); + mScroll = new ScrollArea(mList, showBackground); mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO); mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); @@ -917,11 +917,11 @@ protected: class SocialAttackTab : public SocialTab { public: - SocialAttackTab() : + SocialAttackTab(bool showBackground) : mBeings(new BeingsListModal()) { mList = new AvatarListBox(mBeings); - mScroll = new ScrollArea(mList, false); + mScroll = new ScrollArea(mList, showBackground); mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO); mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); @@ -971,11 +971,11 @@ private: class SocialPickupTab : public SocialTab { public: - SocialPickupTab() : + SocialPickupTab(bool showBackground) : mBeings(new BeingsListModal()) { mList = new AvatarListBox(mBeings); - mScroll = new ScrollArea(mList, false); + mScroll = new ScrollArea(mList, showBackground); mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO); mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); @@ -1025,11 +1025,11 @@ private: class SocialFriendsTab : public SocialTab { public: - SocialFriendsTab(std::string name) : + SocialFriendsTab(std::string name, bool showBackground) : mBeings(new BeingsListModal()) { mList = new AvatarListBox(mBeings); - mScroll = new ScrollArea(mList, false); + mScroll = new ScrollArea(mList, showBackground); mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO); mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); @@ -1211,19 +1211,19 @@ SocialWindow::SocialWindow() : loadWindowState(); // TRANSLATORS: here P is title for visible players tab in social window - mPlayers = new SocialPlayersTab(_("P")); + mPlayers = new SocialPlayersTab(_("P"), getOptionBool("showtabbackground")); mTabs->addTab(mPlayers, mPlayers->mScroll); // TRANSLATORS: here F is title for friends tab in social window - mFriends = new SocialFriendsTab(_("F")); + mFriends = new SocialFriendsTab(_("F"), getOptionBool("showtabbackground")); mTabs->addTab(mFriends, mFriends->mScroll); - mNavigation = new SocialNavigationTab(); + mNavigation = new SocialNavigationTab(getOptionBool("showtabbackground")); mTabs->addTab(mNavigation, mNavigation->mScroll); if (config.getBoolValue("enableAttackFilter")) { - mAttackFilter = new SocialAttackTab(); + mAttackFilter = new SocialAttackTab(getOptionBool("showtabbackground")); mTabs->addTab(mAttackFilter, mAttackFilter->mScroll); } else @@ -1233,7 +1233,7 @@ SocialWindow::SocialWindow() : if (config.getBoolValue("enablePickupFilter")) { - mPickupFilter = new SocialPickupTab(); + mPickupFilter = new SocialPickupTab(getOptionBool("showtabbackground")); mTabs->addTab(mPickupFilter, mPickupFilter->mScroll); } else @@ -1291,9 +1291,9 @@ bool SocialWindow::addTab(Guild *guild) SocialTab *tab = nullptr; if (guild->getServerGuild()) - tab = new SocialGuildTab(guild); + tab = new SocialGuildTab(guild, getOptionBool("showbackground")); else - tab = new SocialGuildTab2(guild); + tab = new SocialGuildTab2(guild, getOptionBool("showbackground")); mGuilds[guild] = tab; mTabs->addTab(tab, tab->mScroll); @@ -1323,7 +1323,8 @@ bool SocialWindow::addTab(Party *party) if (mParties.find(party) != mParties.end()) return false; - SocialPartyTab *tab = new SocialPartyTab(party); + SocialPartyTab *tab = new SocialPartyTab(party, + getOptionBool("showbackground")); mParties[party] = tab; mTabs->addTab(tab, tab->mScroll); |