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:20 +03:00
parent 76d223c178
commit f06cf62a35
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -132,6 +132,7 @@ NetHackQtMenuWindow::NetHackQtMenuWindow(QWidget *parent) :
grid->setRowStretch(2, 1); grid->setRowStretch(2, 1);
setFocusPolicy(Qt::StrongFocus); setFocusPolicy(Qt::StrongFocus);
table->setFocusPolicy(Qt::NoFocus); table->setFocusPolicy(Qt::NoFocus);
connect(table, SIGNAL(cellClicked(int,int)), this, SLOT(cellToggleSelect(int,int)));
setLayout(grid); setLayout(grid);
} }
@@ -560,6 +561,11 @@ void NetHackQtMenuWindow::ToggleSelect(int i)
} }
} }
void NetHackQtMenuWindow::cellToggleSelect(int i, int j)
{
ToggleSelect(i);
}
void NetHackQtMenuWindow::DoSelection(bool) void NetHackQtMenuWindow::DoSelection(bool)
{ {
if (how == PICK_ONE) { if (how == PICK_ONE) {
+1
View File
@@ -66,6 +66,7 @@ public slots:
void Search(); void Search();
void ToggleSelect(int); void ToggleSelect(int);
void cellToggleSelect(int, int);
void DoSelection(bool); void DoSelection(bool);
protected: protected: