Qt4: Allow clicking anywhere in menus

Instead of requiring clicking on the checkbox, allow clicking
anywhere in a selectable line to select it.
This commit is contained in:
Pasi Kallinen
2017-10-10 19:19:17 +03:00
parent 76d223c178
commit f06cf62a35
2 changed files with 7 additions and 0 deletions

View File

@@ -132,6 +132,7 @@ NetHackQtMenuWindow::NetHackQtMenuWindow(QWidget *parent) :
grid->setRowStretch(2, 1);
setFocusPolicy(Qt::StrongFocus);
table->setFocusPolicy(Qt::NoFocus);
connect(table, SIGNAL(cellClicked(int,int)), this, SLOT(cellToggleSelect(int,int)));
setLayout(grid);
}
@@ -560,6 +561,11 @@ void NetHackQtMenuWindow::ToggleSelect(int i)
}
}
void NetHackQtMenuWindow::cellToggleSelect(int i, int j)
{
ToggleSelect(i);
}
void NetHackQtMenuWindow::DoSelection(bool)
{
if (how == PICK_ONE) {

View File

@@ -66,6 +66,7 @@ public slots:
void Search();
void ToggleSelect(int);
void cellToggleSelect(int, int);
void DoSelection(bool);
protected: