From 898c74f4ded38102360624cad924ecf49af7e36f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 20 Sep 2012 23:49:06 +0300 Subject: Add theme color for text in popup windows. New theme color: POPUP --- data/graphics/gui/colors.xml | 1 + data/themes/blacknblack/colors.xml | 1 + data/themes/blackwood/colors.xml | 1 + data/themes/enchilado/colors.xml | 1 + data/themes/mana/colors.xml | 1 + data/themes/pink/colors.xml | 1 + data/themes/unity/colors.xml | 1 + data/themes/wood/colors.xml | 1 + src/gui/beingpopup.cpp | 10 ++++++---- src/gui/itempopup.cpp | 3 +++ src/gui/spellpopup.cpp | 3 +++ src/gui/statuspopup.cpp | 18 ++++++++++++++++++ src/gui/textpopup.cpp | 3 +++ src/gui/theme.cpp | 1 + src/gui/theme.h | 1 + 15 files changed, 43 insertions(+), 4 deletions(-) diff --git a/data/graphics/gui/colors.xml b/data/graphics/gui/colors.xml index 49a5ee367..ca3d61926 100644 --- a/data/graphics/gui/colors.xml +++ b/data/graphics/gui/colors.xml @@ -14,6 +14,7 @@ + diff --git a/data/themes/blacknblack/colors.xml b/data/themes/blacknblack/colors.xml index c1f4cbac7..e802e470f 100644 --- a/data/themes/blacknblack/colors.xml +++ b/data/themes/blacknblack/colors.xml @@ -14,6 +14,7 @@ + diff --git a/data/themes/blackwood/colors.xml b/data/themes/blackwood/colors.xml index cbe809512..cbc7d1d69 100644 --- a/data/themes/blackwood/colors.xml +++ b/data/themes/blackwood/colors.xml @@ -14,6 +14,7 @@ + diff --git a/data/themes/enchilado/colors.xml b/data/themes/enchilado/colors.xml index 77fe13740..cb64bfc95 100644 --- a/data/themes/enchilado/colors.xml +++ b/data/themes/enchilado/colors.xml @@ -14,6 +14,7 @@ + diff --git a/data/themes/mana/colors.xml b/data/themes/mana/colors.xml index 749718d9e..59e87a047 100644 --- a/data/themes/mana/colors.xml +++ b/data/themes/mana/colors.xml @@ -14,6 +14,7 @@ + diff --git a/data/themes/pink/colors.xml b/data/themes/pink/colors.xml index 05a1f9dab..b8a0139f9 100644 --- a/data/themes/pink/colors.xml +++ b/data/themes/pink/colors.xml @@ -14,6 +14,7 @@ + diff --git a/data/themes/unity/colors.xml b/data/themes/unity/colors.xml index 4c944e25a..eaddc0147 100644 --- a/data/themes/unity/colors.xml +++ b/data/themes/unity/colors.xml @@ -13,6 +13,7 @@ + diff --git a/data/themes/wood/colors.xml b/data/themes/wood/colors.xml index ddf935d57..b73b65e9c 100644 --- a/data/themes/wood/colors.xml +++ b/data/themes/wood/colors.xml @@ -14,6 +14,7 @@ + diff --git a/src/gui/beingpopup.cpp b/src/gui/beingpopup.cpp index f7118d48c..865e29abd 100644 --- a/src/gui/beingpopup.cpp +++ b/src/gui/beingpopup.cpp @@ -55,14 +55,16 @@ BeingPopup::BeingPopup() : // Being's party mBeingParty->setPosition(getPadding(), fontHeight); - // Being's party mBeingGuild->setPosition(getPadding(), 2 * fontHeight); - mBeingRank->setPosition(getPadding(), 3 * fontHeight); - mBeingComment->setPosition(getPadding(), 4 * fontHeight); + mBeingParty->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mBeingGuild->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mBeingRank->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mBeingComment->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + add(mBeingName); add(mBeingParty); add(mBeingGuild); @@ -110,7 +112,7 @@ void BeingPopup::show(const int x, const int y, Being *const b) } else { - mBeingName->setForegroundColor(Theme::getThemeColor(Theme::LABEL)); + mBeingName->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); } mBeingName->adjustSize(); diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index 4b0501def..b1c363a67 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -67,14 +67,17 @@ ItemPopup::ItemPopup(): // Item Description mItemDesc->setEditable(false); mItemDesc->setPosition(getPadding(), fontHeight); + mItemDesc->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); // Item Effect mItemEffect->setEditable(false); mItemEffect->setPosition(getPadding(), 2 * fontHeight + 2 * getPadding()); + mItemEffect->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); // Item Weight mItemWeight->setEditable(false); mItemWeight->setPosition(getPadding(), 3 * fontHeight + 4 * getPadding()); + mItemWeight->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); add(mItemName); add(mItemDesc); diff --git a/src/gui/spellpopup.cpp b/src/gui/spellpopup.cpp index 9267e76df..49eba7f43 100644 --- a/src/gui/spellpopup.cpp +++ b/src/gui/spellpopup.cpp @@ -26,6 +26,7 @@ #include "gui/gui.h" #include "gui/palette.h" #include "gui/sdlfont.h" +#include "gui/theme.h" #include "gui/widgets/label.h" @@ -44,6 +45,8 @@ SpellPopup::SpellPopup(): mItemComment(new Label) { mItemName->setFont(boldFont); + mItemName->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mItemComment->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); add(mItemName); add(mItemComment); diff --git a/src/gui/statuspopup.cpp b/src/gui/statuspopup.cpp index 0bba7a505..ac222408b 100644 --- a/src/gui/statuspopup.cpp +++ b/src/gui/statuspopup.cpp @@ -25,6 +25,7 @@ #include "gui/gui.h" #include "gui/palette.h" +#include "gui/theme.h" #include "gui/viewport.h" #include "gui/widgets/label.h" @@ -85,6 +86,23 @@ StatusPopup::StatusPopup() : mDisableGameModifiers->setPosition(getPadding(), 20 + 14 * fontHeight + getPadding()); + mMoveType->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mCrazyMoveType->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mMoveToTargetType->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mFollowMode->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mAttackWeaponType->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mAttackType->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mMagicAttackType->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mPvpAttackType->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mDropCounter->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mPickUpType->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mMapType->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mImitationMode->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mAwayMode->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mCameraMode->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); + mDisableGameModifiers->setForegroundColor( + Theme::getThemeColor(Theme::POPUP)); + add(mMoveType); add(mCrazyMoveType); add(mMoveToTargetType); diff --git a/src/gui/textpopup.cpp b/src/gui/textpopup.cpp index 219b25633..d542bdcde 100644 --- a/src/gui/textpopup.cpp +++ b/src/gui/textpopup.cpp @@ -46,8 +46,11 @@ TextPopup::TextPopup(): const int fontHeight = getFont()->getHeight(); mText1->setPosition(getPadding(), getPadding()); + mText1->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); mText2->setPosition(getPadding(), fontHeight + 2 * getPadding()); + mText2->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); mText3->setPosition(getPadding(), (2 * fontHeight) + 2 * getPadding()); + mText3->setForegroundColor(Theme::getThemeColor(Theme::POPUP)); add(mText1); add(mText2); diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index c421e40e3..b6509348f 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -709,6 +709,7 @@ static int readColorType(const std::string &type) "LABEL", "LISTBOX", "RADIOBUTTON", + "POPUP", "TAB", "TAB_HIGHLIGHTED", "TAB_SELECTED", diff --git a/src/gui/theme.h b/src/gui/theme.h index 1800addc8..aeed253ed 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -179,6 +179,7 @@ class Theme : public Palette, public ConfigListener LABEL, LISTBOX, RADIOBUTTON, + POPUP, TAB, TAB_HIGHLIGHTED, TAB_SELECTED, -- cgit v1.2.3-70-g09d2