From 07121956f882dce22235868a25e0c2df96fb828a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 30 May 2015 15:04:01 +0300 Subject: Move theme colors enum into separate file. --- src/gui/popups/beingpopup.cpp | 36 +++++++++++++++---------------- src/gui/popups/itempopup.cpp | 48 ++++++++++++++++++++--------------------- src/gui/popups/skillpopup.cpp | 8 +++---- src/gui/popups/speechbubble.cpp | 8 +++---- src/gui/popups/speechbubble.h | 4 ++-- src/gui/popups/spellpopup.cpp | 8 +++---- src/gui/popups/statuspopup.cpp | 4 ++-- src/gui/popups/textpopup.cpp | 4 ++-- 8 files changed, 60 insertions(+), 60 deletions(-) (limited to 'src/gui/popups') diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index 8cacafefb..d1f7b1e17 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -70,20 +70,20 @@ BeingPopup::BeingPopup() : mBeingComment->setPosition(0, 5 * fontHeight); mBeingRoom->setPosition(0, 6 * fontHeight); - mBeingParty->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); - mBeingGuild->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); - mBeingRank->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); - mBeingBuyBoard->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); - mBeingSellBoard->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); - mBeingComment->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); - mBeingRoom->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); + mBeingParty->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); + mBeingGuild->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); + mBeingRank->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); + mBeingBuyBoard->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); + mBeingSellBoard->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); + mBeingComment->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); + mBeingRoom->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); } BeingPopup::~BeingPopup() @@ -138,13 +138,13 @@ void BeingPopup::show(const int x, const int y, Being *const b) if (b->isAdvanced()) { mBeingName->setForegroundColorAll(getThemeColor( - Theme::PLAYER_ADVANCED), getThemeColor( - Theme::PLAYER_ADVANCED_OUTLINE)); + ThemeColorId::PLAYER_ADVANCED), getThemeColor( + ThemeColorId::PLAYER_ADVANCED_OUTLINE)); } else { - mBeingName->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); + mBeingName->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); } mBeingName->adjustSize(); diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp index 705c7c50f..5ae6830cc 100644 --- a/src/gui/popups/itempopup.cpp +++ b/src/gui/popups/itempopup.cpp @@ -68,20 +68,20 @@ ItemPopup::ItemPopup() : // Item Description mItemDesc->setEditable(false); mItemDesc->setPosition(0, fontHeight); - mItemDesc->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); + mItemDesc->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); // Item Effect mItemEffect->setEditable(false); mItemEffect->setPosition(0, 2 * fontHeight); - mItemEffect->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); + mItemEffect->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); // Item Weight mItemWeight->setEditable(false); mItemWeight->setPosition(0, 3 * fontHeight); - mItemWeight->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); + mItemWeight->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); } void ItemPopup::postInit() @@ -247,27 +247,27 @@ void ItemPopup::setLabelColor(Label *label, const ItemType::Type type) const { switch (type) { - caseSetColor(ItemType::UNUSABLE, Theme::GENERIC) - caseSetColor(ItemType::USABLE, Theme::USABLE) - caseSetColor(ItemType::EQUIPMENT_ONE_HAND_WEAPON, Theme::ONEHAND) - caseSetColor(ItemType::EQUIPMENT_TWO_HANDS_WEAPON, Theme::TWOHAND) - caseSetColor(ItemType::EQUIPMENT_TORSO, Theme::TORSO) - caseSetColor(ItemType::EQUIPMENT_ARMS, Theme::ARMS) - caseSetColor(ItemType::EQUIPMENT_HEAD, Theme::HEAD) - caseSetColor(ItemType::EQUIPMENT_LEGS, Theme::LEGS) - caseSetColor(ItemType::EQUIPMENT_SHIELD, Theme::SHIELD) - caseSetColor(ItemType::EQUIPMENT_RING, Theme::RING) - caseSetColor(ItemType::EQUIPMENT_NECKLACE, Theme::NECKLACE) - caseSetColor(ItemType::EQUIPMENT_FEET, Theme::FEET) - caseSetColor(ItemType::EQUIPMENT_AMMO, Theme::AMMO) - caseSetColor(ItemType::EQUIPMENT_CHARM, Theme::CHARM) - caseSetColor(ItemType::SPRITE_RACE, Theme::UNKNOWN_ITEM) - caseSetColor(ItemType::SPRITE_HAIR, Theme::UNKNOWN_ITEM) + caseSetColor(ItemType::UNUSABLE, ThemeColorId::GENERIC) + caseSetColor(ItemType::USABLE, ThemeColorId::USABLE) + caseSetColor(ItemType::EQUIPMENT_ONE_HAND_WEAPON, ThemeColorId::ONEHAND) + caseSetColor(ItemType::EQUIPMENT_TWO_HANDS_WEAPON, ThemeColorId::TWOHAND) + caseSetColor(ItemType::EQUIPMENT_TORSO, ThemeColorId::TORSO) + caseSetColor(ItemType::EQUIPMENT_ARMS, ThemeColorId::ARMS) + caseSetColor(ItemType::EQUIPMENT_HEAD, ThemeColorId::HEAD) + caseSetColor(ItemType::EQUIPMENT_LEGS, ThemeColorId::LEGS) + caseSetColor(ItemType::EQUIPMENT_SHIELD, ThemeColorId::SHIELD) + caseSetColor(ItemType::EQUIPMENT_RING, ThemeColorId::RING) + caseSetColor(ItemType::EQUIPMENT_NECKLACE, ThemeColorId::NECKLACE) + caseSetColor(ItemType::EQUIPMENT_FEET, ThemeColorId::FEET) + caseSetColor(ItemType::EQUIPMENT_AMMO, ThemeColorId::AMMO) + caseSetColor(ItemType::EQUIPMENT_CHARM, ThemeColorId::CHARM) + caseSetColor(ItemType::SPRITE_RACE, ThemeColorId::UNKNOWN_ITEM) + caseSetColor(ItemType::SPRITE_HAIR, ThemeColorId::UNKNOWN_ITEM) default: { return label->setForegroundColorAll(getThemeColor( - Theme::UNKNOWN_ITEM), getThemeColor( - Theme::UNKNOWN_ITEM_OUTLINE)); + ThemeColorId::UNKNOWN_ITEM), getThemeColor( + ThemeColorId::UNKNOWN_ITEM_OUTLINE)); } } } diff --git a/src/gui/popups/skillpopup.cpp b/src/gui/popups/skillpopup.cpp index ecd085a99..a3da22acd 100644 --- a/src/gui/popups/skillpopup.cpp +++ b/src/gui/popups/skillpopup.cpp @@ -50,13 +50,13 @@ SkillPopup::SkillPopup() : mSkillDesc->setEditable(false); mSkillDesc->setPosition(0, fontHeight); - mSkillDesc->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); + mSkillDesc->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); mSkillEffect->setEditable(false); mSkillEffect->setPosition(0, 2 * fontHeight); - mSkillEffect->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); + mSkillEffect->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); } void SkillPopup::postInit() diff --git a/src/gui/popups/speechbubble.cpp b/src/gui/popups/speechbubble.cpp index c91b41370..650afc805 100644 --- a/src/gui/popups/speechbubble.cpp +++ b/src/gui/popups/speechbubble.cpp @@ -48,8 +48,8 @@ SpeechBubble::SpeechBubble() : mCaption->setFont(boldFont); mSpeechBox->setOpaque(false); - mSpeechBox->setForegroundColorAll(getThemeColor(Theme::BUBBLE_TEXT), - getThemeColor(Theme::BUBBLE_TEXT_OUTLINE)); + mSpeechBox->setForegroundColorAll(getThemeColor(ThemeColorId::BUBBLE_TEXT), + getThemeColor(ThemeColorId::BUBBLE_TEXT_OUTLINE)); } void SpeechBubble::postInit() @@ -73,8 +73,8 @@ void SpeechBubble::setText(const std::string &text, const bool showName) if (text == mText && (mCaption->getWidth() <= mSpeechBox->getWidth())) return; - mSpeechBox->setForegroundColorAll(getThemeColor(Theme::BUBBLE_TEXT), - getThemeColor(Theme::BUBBLE_TEXT_OUTLINE)); + mSpeechBox->setForegroundColorAll(getThemeColor(ThemeColorId::BUBBLE_TEXT), + getThemeColor(ThemeColorId::BUBBLE_TEXT_OUTLINE)); int width = mCaption->getWidth(); mSpeechBox->clearRows(); diff --git a/src/gui/popups/speechbubble.h b/src/gui/popups/speechbubble.h index 4d6d86aed..7f09ca187 100644 --- a/src/gui/popups/speechbubble.h +++ b/src/gui/popups/speechbubble.h @@ -46,9 +46,9 @@ class SpeechBubble final : public Popup */ void setCaption(const std::string &name, const Color *const color1 = - &theme->getColor(Theme::BUBBLE_NAME, 255), + &theme->getColor(ThemeColorId::BUBBLE_NAME, 255), const Color *const color2 = - &theme->getColor(Theme::BUBBLE_NAME_OUTLINE, 255)); + &theme->getColor(ThemeColorId::BUBBLE_NAME_OUTLINE, 255)); /** * Sets the text to be displayed. diff --git a/src/gui/popups/spellpopup.cpp b/src/gui/popups/spellpopup.cpp index be741bb32..f9da0482a 100644 --- a/src/gui/popups/spellpopup.cpp +++ b/src/gui/popups/spellpopup.cpp @@ -39,10 +39,10 @@ SpellPopup::SpellPopup() : mItemComment(new Label(this)) { mItemName->setFont(boldFont); - mItemName->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); - mItemComment->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); + mItemName->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); + mItemComment->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); } void SpellPopup::postInit() diff --git a/src/gui/popups/statuspopup.cpp b/src/gui/popups/statuspopup.cpp index f69d72574..2bc4a9170 100644 --- a/src/gui/popups/statuspopup.cpp +++ b/src/gui/popups/statuspopup.cpp @@ -39,8 +39,8 @@ { \ Label *const label = mLabels[num]; \ label->setPosition(0, y); \ - label->setForegroundColorAll(getThemeColor(Theme::POPUP), \ - getThemeColor(Theme::POPUP_OUTLINE)); \ + label->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), \ + getThemeColor(ThemeColorId::POPUP_OUTLINE)); \ add(label); \ y += fontHeight; \ } diff --git a/src/gui/popups/textpopup.cpp b/src/gui/popups/textpopup.cpp index 511816586..b6cb996a6 100644 --- a/src/gui/popups/textpopup.cpp +++ b/src/gui/popups/textpopup.cpp @@ -47,8 +47,8 @@ void TextPopup::postInit() Label *const label = new Label(this); mText[f] = label; label->setPosition(0, y); - label->setForegroundColorAll(getThemeColor(Theme::POPUP), - getThemeColor(Theme::POPUP_OUTLINE)); + label->setForegroundColorAll(getThemeColor(ThemeColorId::POPUP), + getThemeColor(ThemeColorId::POPUP_OUTLINE)); add(label); y += fontHeight; } -- cgit v1.2.3-70-g09d2