[Client] Settings: sub-page rows deep-linking into page sections (#7487)

Add AbstractSettingsPage::getSections built from each page's group boxes.
Show each multi-group page's sections as child rows in the navigation
tree. Section rows show the parent page and scroll to and highlight the
group box. Start pages collapsed. Keep single-group pages flat.

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

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

View file

@ -2,6 +2,7 @@
#define COCKATRICE_ABSTRACT_SETTINGS_PAGE_H
#include <QList>
#include <QString>
#include <QWidget>
#include <qtmetamacros.h>
@ -11,12 +12,28 @@
struct SettingsSearchEntry;
/**
* @brief A navigable section of a settings page (one group box)
*/
struct SettingsPageSection
{
QString title; ///< Translated group title
QWidget *sectionWidget = nullptr; ///< Group box to scroll to and highlight
};
class AbstractSettingsPage : public QWidget
{
Q_OBJECT
public:
virtual void retranslateUi() = 0;
virtual QList<SettingsSearchEntry> getSearchEntries();
/**
* @brief Sections of this page for sub-page navigation, in display order
*
* Scans the page's direct-child group boxes; pages with a single group
* report no sections so the nav stays flat for them.
*/
QList<SettingsPageSection> getSections();
protected:
static QList<SettingsSearchEntry> autoDetectSearchEntries(QWidget *page, int pageIndex);