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:
@@ -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) {
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user