Add shortcut for map list search bar

This commit is contained in:
GriffinR
2026-06-14 00:40:36 -04:00
parent 31d969c0d6
commit d3fb9b4d24
3 changed files with 11 additions and 0 deletions

View File

@@ -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.

View File

@@ -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();

View File

@@ -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)