summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-09-28 18:23:23 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-09-28 18:40:17 +0200
commitb912a0c991cb0b1e02009d6bb2c9dffd2fa84d3a (patch)
tree1204af6510102ca71dc2c9113b50edf6b818fd64
parentc82bb72ea54a15b47938c5cbe69459bbb8c47c40 (diff)
downloadmana-b912a0c991cb0b1e02009d6bb2c9dffd2fa84d3a.tar.gz
mana-b912a0c991cb0b1e02009d6bb2c9dffd2fa84d3a.tar.bz2
mana-b912a0c991cb0b1e02009d6bb2c9dffd2fa84d3a.tar.xz
mana-b912a0c991cb0b1e02009d6bb2c9dffd2fa84d3a.zip
Small changes 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.
-rw-r--r--src/gui/windowmenu.cpp77
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));
}
}
}