Fixup: Add ":" to button label
This commit is contained in:
parent
8cfb4b13f2
commit
5d1df42a01
3 changed files with 10 additions and 13 deletions
|
@ -9,15 +9,6 @@
|
|||
|
||||
using namespace Settings::NativeInput;
|
||||
|
||||
std::map<Values, std::string> ButtonNameMap({
|
||||
{ A, "A" }, { B, "B" }, { X, "X" }, { Y, "Y" },
|
||||
{ L, "L" }, { R, "R" }, { ZL, "ZL" }, { ZR, "ZR" },
|
||||
{ DLEFT, "D-Left" }, { DRIGHT, "D-Right" }, { DUP, "D-Up" }, { DDOWN, "D-Down" },
|
||||
{ SLEFT, "S-Left" }, { SRIGHT, "S-Right" }, { SUP, "S-Up" }, { SDOWN, "S-Down" },
|
||||
{ CLEFT, "C-Left" }, { CRIGHT, "C-Right" }, { CUP, "C-Up" }, { CDOWN, "C-Down" },
|
||||
{ START, "Start" }, { SELECT, "Select" }, { HOME, "Home" } }
|
||||
);
|
||||
|
||||
QLineEditKeyConfig::QLineEditKeyConfig(Values button, QWidget* parent)
|
||||
: QLineEdit(parent), button(button) {}
|
||||
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
|
||||
class QKeyEvent;
|
||||
|
||||
/// Map a button to its name
|
||||
extern std::map<Settings::NativeInput::Values, std::string> ButtonNameMap;
|
||||
|
||||
/// The LineEdits used for button configuration
|
||||
class QLineEditKeyConfig : public QLineEdit {
|
||||
Q_OBJECT
|
||||
|
|
|
@ -24,6 +24,15 @@ GInputsDialog::GInputsDialog(QWidget* parent) : QDialog(parent) {
|
|||
lineEdits[i]->setFocusPolicy(Qt::ClickFocus);
|
||||
}
|
||||
|
||||
std::string labelArray[] = {
|
||||
"A:", "B:", "X:", "Y:",
|
||||
"L:", "R:", "ZL:", "ZR:",
|
||||
"D-Left:", "D-Right:", "D-Up:", "D-Down:",
|
||||
"S-Left:", "S-Right:", "S-Up:", "S-Down:",
|
||||
"C-Left:", "C-Right:", "C-Up:", "C-Down:",
|
||||
"Start:", "Select:", "Home:"
|
||||
};
|
||||
|
||||
// put the lineEdits and their labels into a grid
|
||||
QGridLayout* grid = new QGridLayout();
|
||||
size_t size = lineEdits.size();
|
||||
|
@ -32,7 +41,7 @@ GInputsDialog::GInputsDialog(QWidget* parent) : QDialog(parent) {
|
|||
int row = i % NUM_ROW;
|
||||
int labelColumn = (int)i / NUM_ROW * 2;
|
||||
QLineEditKeyConfig* lineEdit = lineEdits[i];
|
||||
QLabel* label = new QLabel(tr(ButtonNameMap[lineEdit->button].c_str()));
|
||||
QLabel* label = new QLabel(tr(labelArray[lineEdit->button].c_str()));
|
||||
grid->addWidget(label, row, labelColumn);
|
||||
grid->addWidget(lineEdit, row, labelColumn + 1);
|
||||
|
||||
|
|
Loading…
Reference in a new issue