mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 19:13:25 -08:00
[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:
parent
4750e67b7f
commit
4343544588
2 changed files with 175 additions and 8 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue