From d3fb9b4d244cc5e75c241d6e773e30af5b6c13a6 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sun, 14 Jun 2026 00:40:36 -0400 Subject: [PATCH] Add shortcut for map list search bar --- CHANGELOG.md | 1 + include/mainwindow.h | 1 + src/mainwindow.cpp | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14e9ec95..617d6d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project somewhat adheres to [Semantic Versioning](https://semver.org/sp - Add setting to display tile and metatile IDs in decimal instead of hexadecimal. Defaults to displaying both. - Add API functions for reading and writing text files. - Add a warning if multiple layouts have the same data file paths. +- Add `Ctrl/Cmd+F` as a keyboard shortcut for the map list search bar. ### Changed - Porymap's .cfg files were replaced with .json. Any fields not listed in a config file are assumed to be the default value. diff --git a/include/mainwindow.h b/include/mainwindow.h index 1cd1abad..ce8909f8 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -276,6 +276,7 @@ private slots: void mapListShortcut_ToggleEmptyFolders(); void mapListShortcut_ExpandAll(); void mapListShortcut_CollapseAll(); + void mapListShortcut_EditSearch(); void on_actionAbout_Porymap_triggered(); void on_actionOpen_Log_File_triggered(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index af37c520..5643ed3f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -257,6 +257,10 @@ void MainWindow::initExtraShortcuts() { shortcutCollapse_All->setObjectName("shortcutCollapse_All"); shortcutCollapse_All->setWhatsThis("Map List: Collapse all folders"); + auto *shortcutMap_Search = new Shortcut(QKeySequence("Ctrl+F"), this, SLOT(mapListShortcut_EditSearch())); + shortcutMap_Search->setObjectName("shortcutMap_Search"); + shortcutMap_Search->setWhatsThis("Map List: Edit Search Bar"); + auto *shortcut_Open_Scripts = new Shortcut(QKeySequence(), ui->toolButton_Open_Scripts, SLOT(click())); shortcut_Open_Scripts->setObjectName("shortcut_Open_Scripts"); shortcut_Open_Scripts->setWhatsThis("Open Map Scripts"); @@ -3017,6 +3021,11 @@ void MainWindow::mapListShortcut_ToggleEmptyFolders() { if (toolbar) toolbar->toggleEmptyFolders(); } +void MainWindow::mapListShortcut_EditSearch() { + auto toolbar = getCurrentMapListToolBar(); + if (toolbar) toolbar->setSearchFocus(); +} + void MainWindow::on_actionAbout_Porymap_triggered() { if (!this->aboutWindow)