[Client] Settings: isolate the selected section when drilling down (#7488)

* [Client] Settings: isolate the selected section when drilling down

Show only the selected section's group box. Restore the overview on
page rows. Filter search results to the control's containing section.
Reset the scroll position on every change.

Reworked to stay in the enlarged modal instead of the settings tab.

* [Client] Settings: re-clicking an isolated section restores the overview

* [Settings] Keep section row selected when drilling down per review

* [Settings] Stop stealing nav selection mid-gesture per review

* [Settings] Sample nav selection pre-press so re-click detection works per review

* Don't flash the section on drill-down

* [Client] Settings: clear the section filter when selecting the page row per review

onTabClicked() returned early for the already-current page before switchPageContent() could call applySectionFilter(index, nullptr), so clicking the page row while a section was isolated moved the selection but left the page filtered. Only skip the restore when no section is isolated.

* [Settings] Select the search result's section in the sidebar per review

Reaching a setting through the search isolated its section and flashed the
widget, but left the navigation selection on the page row, so the sidebar
looked like it had only jumped to the section's page. Extract the section-row
selection shared with drill-down into selectSectionRow() and use it for search
results too, keeping the gesture/re-click behavior untouched.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-10-18 22:48:52 +02:00 • committed by GitHub
parent 4750e67b7f
commit 4343544588
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 175 additions and 8 deletions

View file

@ -79,6 +79,8 @@ private:
SettingsSearchDelegate *searchDelegate; ///< Delegate for search result rendering
int currentTabIndex; ///< Currently active tab index
bool searchActive; ///< Whether search mode is active
QWidget *isolatedSection = nullptr; ///< Isolated section group box, or nullptr for full pages
bool pressWasOnCurrentItem = false; ///< True when the mouse press started on the already-current item
void setupUi();
void setupNavTree();
@ -88,6 +90,10 @@ private:
void navigateToSearchResult(const QModelIndex &index);
void navigateToSection(int pageIndex, QWidget *sectionWidget);
void setActiveTab(int index);
void switchPageContent(int index);
void applySectionFilter(int pageIndex, QWidget *sectionWidget);
void selectSectionRow(int pageIndex, QWidget *sectionWidget);
QTreeWidgetItem *findSectionItem(int pageIndex, QWidget *sectionWidget) const;
static void flashWidget(QWidget *widget);
static void scrollToAndFlash(QWidget *target);
static QStringList translatedPageNames();