diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-20 02:07:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-20 13:55:43 +0300 |
commit | 4c7a11b639ec94c8a32a9a52e99652c464745037 (patch) | |
tree | b17c6a46a06eb00f385347c8147a00cded21c3b6 /src/gui/widgets | |
parent | 376c7e4a46c2c18d117db49b143a3f138d6a81c7 (diff) | |
download | plus-4c7a11b639ec94c8a32a9a52e99652c464745037.tar.gz plus-4c7a11b639ec94c8a32a9a52e99652c464745037.tar.bz2 plus-4c7a11b639ec94c8a32a9a52e99652c464745037.tar.xz plus-4c7a11b639ec94c8a32a9a52e99652c464745037.zip |
Add palette inheritance to other shortcutcontainer classes.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.cpp | 7 | ||||
-rw-r--r-- | src/gui/widgets/dropshortcutcontainer.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/emoteshortcutcontainer.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/emoteshortcutcontainer.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/itemshortcutcontainer.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/spellshortcutcontainer.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/spellshortcutcontainer.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/widget2.h | 4 |
9 files changed, 37 insertions, 2 deletions
diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 8fde755c1..732b94454 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -81,6 +81,13 @@ DropShortcutContainer::~DropShortcutContainer() mItemPopup = nullptr; } +void DropShortcutContainer::setWidget2(const Widget2 *const widget) +{ + Widget2::setWidget2(widget); + mEquipedColor = getThemeColor(Theme::ITEM_EQUIPPED); + mUnEquipedColor = getThemeColor(Theme::ITEM_NOT_EQUIPPED); +} + void DropShortcutContainer::draw(gcn::Graphics *graphics) { if (!dropShortcut) diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 74f76fdaa..6d3c18674 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -77,6 +77,8 @@ class DropShortcutContainer final : public ShortcutContainer void mouseMoved(gcn::MouseEvent &event) override; + void setWidget2(const Widget2 *const widget); + private: bool mItemClicked; Item *mItemMoved; diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index a2a6b5f22..87719b775 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -95,6 +95,12 @@ EmoteShortcutContainer::~EmoteShortcutContainer() } } +void EmoteShortcutContainer::setWidget2(const Widget2 *const widget) +{ + Widget2::setWidget2(widget); + mForegroundColor = getThemeColor(Theme::TEXT); +} + void EmoteShortcutContainer::draw(gcn::Graphics *graphics) { if (!emoteShortcut) diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index 05fa737a4..db4bcd138 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -78,6 +78,8 @@ class EmoteShortcutContainer final : public ShortcutContainer void widgetHidden(const gcn::Event &event) override; + void setWidget2(const Widget2 *const widget); + private: std::vector<const EmoteSprite*> mEmoteImg; diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 9a53b5b17..041a9e8dc 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -92,6 +92,14 @@ ItemShortcutContainer::~ItemShortcutContainer() mSpellPopup = nullptr; } +void ItemShortcutContainer::setWidget2(const Widget2 *const widget) +{ + Widget2::setWidget2(widget); + mEquipedColor = getThemeColor(Theme::ITEM_EQUIPPED); + mUnEquipedColor = getThemeColor(Theme::ITEM_NOT_EQUIPPED); + mForegroundColor = getThemeColor(Theme::TEXT); +} + void ItemShortcutContainer::draw(gcn::Graphics *graphics) { const ItemShortcut *const selShortcut = itemShortcut[mNumber]; diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index 18a5c020f..001ddf05e 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -78,6 +78,8 @@ class ItemShortcutContainer final : public ShortcutContainer void mouseMoved(gcn::MouseEvent &event) override; + void setWidget2(const Widget2 *const widget); + private: bool mItemClicked; Item *mItemMoved; diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 22ed8d6b5..061e12b73 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -84,6 +84,12 @@ SpellShortcutContainer::~SpellShortcutContainer() mSpellPopup = nullptr; } +void SpellShortcutContainer::setWidget2(const Widget2 *const widget) +{ + Widget2::setWidget2(widget); + mForegroundColor = getThemeColor(Theme::TEXT); +} + void SpellShortcutContainer::draw(gcn::Graphics *graphics) { if (!spellShortcut) diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index 6e0de1c6a..ee95dbd3d 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -77,6 +77,8 @@ class SpellShortcutContainer final : public ShortcutContainer void mouseMoved(gcn::MouseEvent &event) override; + void setWidget2(const Widget2 *const widget); + private: bool mSpellClicked; TextCommand *mSpellMoved; diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h index 02107b3c1..9911d48f6 100644 --- a/src/gui/widgets/widget2.h +++ b/src/gui/widgets/widget2.h @@ -36,7 +36,7 @@ class Widget2 { } - ~Widget2() + virtual ~Widget2() { } @@ -56,7 +56,7 @@ class Widget2 return Palette::BLACK; } - void setWidget2(const Widget2 *const widget) + virtual void setWidget2(const Widget2 *const widget) { mPalette = widget ? widget->mPalette : 1; } |