summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-02 13:00:09 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-02 13:00:09 +0300
commit96f146a2ee4c54e733d927dac98fb83d43c53081 (patch)
tree37f421d6574eebbde0b4ab25dcc8a6794243b9a8 /src
parent7c251f07c2b3fdfe99be11ac59aa813b4f3437bb (diff)
downloadmanaplus-96f146a2ee4c54e733d927dac98fb83d43c53081.tar.gz
manaplus-96f146a2ee4c54e733d927dac98fb83d43c53081.tar.bz2
manaplus-96f146a2ee4c54e733d927dac98fb83d43c53081.tar.xz
manaplus-96f146a2ee4c54e733d927dac98fb83d43c53081.zip
Improve setup input window.
Changed font to help font. add separator between more than one keys.
Diffstat (limited to 'src')
-rw-r--r--src/gui/setup_input.cpp11
-rw-r--r--src/input/inputmanager.cpp2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/setup_input.cpp b/src/gui/setup_input.cpp
index ad2e3f7d9..6be11a6ba 100644
--- a/src/gui/setup_input.cpp
+++ b/src/gui/setup_input.cpp
@@ -125,6 +125,8 @@ Setup_Input::Setup_Input(const Widget2 *const widget) :
mKeyListModel->setSize(mActionDataSize[0]);
refreshKeys();
+ if (gui)
+ mKeyList->setFont(reinterpret_cast<gcn::Font*>(gui->getHelpFont()));
mKeyList->addActionListener(this);
mScrollArea->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER);
@@ -315,8 +317,13 @@ void Setup_Input::refreshAssignedKey(const int index)
}
else
{
- mKeyListModel->setElementAt(index, strprintf("%s: %s",
- gettext(key.name.c_str()),
+ std::string str = gettext(key.name.c_str());
+ int sz = 20;
+ if (mainGraphics->mWidth > 800)
+ sz = 30;
+ while (str.size() < sz)
+ str.append(" ");
+ mKeyListModel->setElementAt(index, strprintf("%s: %s", str.c_str(),
inputManager.getKeyStringLong(key.actionId).c_str()));
}
}
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp
index 66bd67efb..a731dc1f5 100644
--- a/src/input/inputmanager.cpp
+++ b/src/input/inputmanager.cpp
@@ -372,7 +372,7 @@ std::string InputManager::getKeyStringLong(const int index) const
if (keyStr.empty())
keyStr = str;
else
- keyStr.append(" ").append(str);
+ keyStr.append(", ").append(str);
}
}