]> granicus.if.org Git - nethack/commitdiff
Qt4: Allow clicking anywhere in menus
authorPasi Kallinen <paxed@alt.org>
Tue, 10 Oct 2017 16:19:17 +0000 (19:19 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 10 Oct 2017 16:19:20 +0000 (19:19 +0300)
Instead of requiring clicking on the checkbox, allow clicking
anywhere in a selectable line to select it.

win/Qt4/qt4menu.cpp
win/Qt4/qt4menu.h

index a6fc8c2f5e9444aab62b4508580ac7be1e292522..fe004e87ce1bfb539d8d7210f5462bfd310d07cc 100644 (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) {
index ad15841bc891428d0b9e9824206f11b94aa28c1c..5bc265920f57034edb387405fb0671bc15ee1b8a 100644 (file)
@@ -66,6 +66,7 @@ public slots:
        void Search();
 
        void ToggleSelect(int);
+        void cellToggleSelect(int, int);
        void DoSelection(bool);
 
 protected: