From: PatR Date: Wed, 14 Oct 2020 10:02:55 +0000 (-0700) Subject: Qt toolbar: add button for 'search' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a443226d18ab5f35a5e7b8de58af5f9507ba8ff;p=nethack Qt toolbar: add button for 'search' The toolbar contains do-Again, Pick up, Drop, Kick, Throw, Fire, Eat, and Rest. Insert Search in front of Rest since it's useful in its own right and some players prefer it even when resting. Includes a new 12x13 icon; a tiny magnifying glass shown straight on is something I can manage. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index f32d792cd..0aff91687 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.328 $ $NHDT-Date: 1602623144 2020/10/13 21:05:44 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.329 $ $NHDT-Date: 1602669770 2020/10/14 10:02:50 $ General Fixes and Modified Features ----------------------------------- @@ -442,7 +442,7 @@ Qt: for menu search, don't require clicking on the search target popup before Qt: rest ("Zz") button on the toolbar only worked when 'rest_on_space' was On (core issue, not Qt's fault) Qt: rename toolbar button "Get" and action menu choice "Get" to "Pick up" -Qt+QSX: fix control key +Qt+OSX: fix control key Qt+OSX: rename menu entry "nethack->Preferences..." for invoking nethack's 'O' command to "Game->Run-time options" and entry "Game->Qt settings" for making persistent Qt customizations to "nethack->Preferences..." @@ -579,6 +579,7 @@ Qt: clicking on the paper doll runs the #seeall command (inventory of wielded and worn items plus tools [lamps, leashes] actively in use; in other words, same set of things whose tiles are used to populate the doll) Qt: clicking on the status window runs the #attributes command (^X) +Qt: add a Search button to the toolbar NetHack Community Patches (or Variation) Included diff --git a/win/Qt/qt_main.cpp b/win/Qt/qt_main.cpp index 73d56f080..00765d8a9 100644 --- a/win/Qt/qt_main.cpp +++ b/win/Qt/qt_main.cpp @@ -352,6 +352,25 @@ static const char * eat_xpm[] = { " oo oo ", " oo oo "}; /* XPM */ +static const char * search_xpm[] = { +"12 13 3 1", +" c None", +". c #FFFFFFFF0000", +"X c #7F0000000000", +" ", +" XXXXX ", +" X ... X ", +" X.....X ", +" X.....X ", +" X ... X ", +" XXXXX ", +" X ", +" X ", +" X ", +" X ", +" X ", +" "}; +/* XPM */ static const char * rest_xpm[] = { "12 13 2 1", " c None", @@ -777,6 +796,7 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) : AddToolButton(toolbar, sm, "Throw", dothrow, QPixmap(throw_xpm)); AddToolButton(toolbar, sm, "Fire", dofire, QPixmap(fire_xpm)); AddToolButton(toolbar, sm, "Eat", doeat, QPixmap(eat_xpm)); + AddToolButton(toolbar, sm, "Search", dosearch, QPixmap(search_xpm)); AddToolButton(toolbar, sm, "Rest", donull, QPixmap(rest_xpm)); connect(game, SIGNAL(triggered(QAction *)),