diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-09-28 18:23:23 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-09-28 18:23:23 +0200 |
commit | 4e7d8d60c90ad8f981697e6641e3b9296d28b267 (patch) | |
tree | 99b7f6c7e0c038cb9017eae6bc7eb60014dfba62 /src/gui | |
parent | 19c6b66f41396dc1a06ea17ab70f27a4f8802ade (diff) | |
download | mana-client-4e7d8d60c90ad8f981697e6641e3b9296d28b267.tar.gz mana-client-4e7d8d60c90ad8f981697e6641e3b9296d28b267.tar.bz2 mana-client-4e7d8d60c90ad8f981697e6641e3b9296d28b267.tar.xz mana-client-4e7d8d60c90ad8f981697e6641e3b9296d28b267.zip |
Small chages requested by o11c - part 2.
Most noticeably i added the shortcut in a popup, even when
there are no images to the image buttons in the windowmenu.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windowmenu.cpp | 77 |
1 files changed, 38 insertions, 39 deletions
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index 2cac55b5..1c4e8bec 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -183,13 +183,12 @@ void WindowMenu::addButton(const std::string& text, int &x, int &h, Button *btn = new Button("", text, this); if (!iconPath.empty() && btn->setButtonIcon(iconPath)) { - // When in image button mode, we have room to show - // the keyboard shortcut. btn->setButtonPopupText(createShortcutCaption(text, key)); } else { btn->setCaption(gettext(text.c_str())); + btn->setButtonPopupText(createShortcutCaption("", key)); } btn->setPosition(x, 0); @@ -203,44 +202,44 @@ void WindowMenu::updatePopUpCaptions() for (WidgetList::iterator it = mWidgets.begin(); it != mWidgets.end(); ++it) { Button *button = dynamic_cast<Button*> (*it); - if (button) + if (!button) + continue; + + std::string eventId = button->getActionEventId(); + if (eventId == "Status") + { + button->setButtonPopupText(createShortcutCaption("Status", + KeyboardConfig::KEY_WINDOW_STATUS)); + } + else if (eventId == "Equipment") + { + button->setButtonPopupText(createShortcutCaption("Equipment", + KeyboardConfig::KEY_WINDOW_EQUIPMENT)); + } + else if (eventId == "Inventory") + { + button->setButtonPopupText(createShortcutCaption("Inventory", + KeyboardConfig::KEY_WINDOW_INVENTORY)); + } + else if (eventId == "Skills") + { + button->setButtonPopupText(createShortcutCaption("Skills", + KeyboardConfig::KEY_WINDOW_SKILL)); + } + else if (eventId == "Social") + { + button->setButtonPopupText(createShortcutCaption("Social", + KeyboardConfig::KEY_WINDOW_SOCIAL)); + } + else if (eventId == "Shortcuts") + { + button->setButtonPopupText(createShortcutCaption("Shortcuts", + KeyboardConfig::KEY_WINDOW_SHORTCUT)); + } + else if (eventId == "Setup") { - std::string eventId = button->getActionEventId(); - if (eventId == "Status") - { - button->setButtonPopupText(createShortcutCaption("Status", - KeyboardConfig::KEY_WINDOW_STATUS)); - } - else if (eventId == "Equipment") - { - button->setButtonPopupText(createShortcutCaption("Equipment", - KeyboardConfig::KEY_WINDOW_EQUIPMENT)); - } - else if (eventId == "Inventory") - { - button->setButtonPopupText(createShortcutCaption("Inventory", - KeyboardConfig::KEY_WINDOW_INVENTORY)); - } - else if (eventId == "Skills") - { - button->setButtonPopupText(createShortcutCaption("Skills", - KeyboardConfig::KEY_WINDOW_SKILL)); - } - else if (eventId == "Social") - { - button->setButtonPopupText(createShortcutCaption("Social", - KeyboardConfig::KEY_WINDOW_SOCIAL)); - } - else if (eventId == "Shortcuts") - { - button->setButtonPopupText(createShortcutCaption("Shortcuts", - KeyboardConfig::KEY_WINDOW_SHORTCUT)); - } - else if (eventId == "Setup") - { - button->setButtonPopupText(createShortcutCaption("Setup", - KeyboardConfig::KEY_WINDOW_SETUP)); - } + button->setButtonPopupText(createShortcutCaption("Setup", + KeyboardConfig::KEY_WINDOW_SETUP)); } } } |