diff --git a/src/settings/ConfigurationDialog.h b/src/settings/ConfigurationDialog.h index 37ae10d8..627bb6db 100644 --- a/src/settings/ConfigurationDialog.h +++ b/src/settings/ConfigurationDialog.h @@ -103,14 +103,10 @@ public: void addChildren(const QObject *parentObj) { - for (const QObject *child: parentObj->children()) { - if (!child->objectName().startsWith(ManagedNamePrefix)) { - continue; - } - - const char *className = child->metaObject()->className(); - if (qstrcmp(className, "QButtonGroup") == 0) { - add(qobject_cast(child)); + const auto allButtonGroups = parentObj->findChildren(); + for (const auto *buttonGroup: allButtonGroups) { + if (buttonGroup->objectName().startsWith(ManagedNamePrefix)) { + add(buttonGroup); } } } diff --git a/src/settings/TabBarSettings.cpp b/src/settings/TabBarSettings.cpp index d319b9f1..bfd1dd17 100644 --- a/src/settings/TabBarSettings.cpp +++ b/src/settings/TabBarSettings.cpp @@ -27,6 +27,11 @@ TabBarSettings::TabBarSettings(QWidget* aParent) : QWidget(aParent) { setupUi(this); + // For some reason these layouts have invalid sizes when + // sizeHint() is read before the widget is shown. + appearanceTabLayout->activate(); + behaviorTabLayout->activate(); + // Enable CSS file selector only when tabbar is visible and custom css is active const auto updateStyleSheetFileEnable = [this](bool) { kcfg_TabBarUserStyleSheetFile->setEnabled(kcfg_TabBarUseUserStyleSheet->isChecked() diff --git a/src/settings/TabBarSettings.ui b/src/settings/TabBarSettings.ui index 30475bbc..8a410d60 100644 --- a/src/settings/TabBarSettings.ui +++ b/src/settings/TabBarSettings.ui @@ -6,8 +6,8 @@ 0 0 - 384 - 512 + 382 + 418 @@ -27,285 +27,345 @@ 0 - - - 6 + + + 0 - - - - &Never - - - kcfg_TabBarVisibility - - - - - - - Use user-defined stylesheet: - - - - - - - After c&urrent tab - - - kcfg_NewTabBehavior - - - - - - - Close tab on middle-click - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 16 - 20 - - - - - - - - None - - - kcfg_CloseTabButton - - - - - - - Show Close Tab button: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - false - - - text/css - - - (none) - - - - - - - On &the tab bar - - - kcfg_CloseTabButton - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 16 - - - - - - - - On each tab - - - kcfg_CloseTabButton - - - - - - - Miscellaneous: - - - - - - - Put new tabs: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 16 - - - - - - - - Position: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - At the end - - - kcfg_NewTabBehavior - - - - - - - When needed - - - kcfg_TabBarVisibility - - - - - - - A&lways - - - kcfg_TabBarVisibility - - - - - - - Below terminal area - - - kcfg_TabBarPosition - - - - - - - Above terminal area - - - kcfg_TabBarPosition - - - - - - - Expand individual tab widths to full window - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 16 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 16 - - - - - - - - Show: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - Qt::Vertical - - - - 20 - 0 - - - + + + Appearance + + + + 0 + + + + + 6 + + + + + Show: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + When needed + + + kcfg_TabBarVisibility + + + + + + + Alwa&ys + + + kcfg_TabBarVisibility + + + + + + + &Never + + + kcfg_TabBarVisibility + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 16 + + + + + + + + Position: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Be&low terminal area + + + kcfg_TabBarPosition + + + + + + + Above terminal area + + + kcfg_TabBarPosition + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 16 + + + + + + + + Show Close Tab button: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + &On each tab + + + kcfg_CloseTabButton + + + + + + + On &the tab bar + + + kcfg_CloseTabButton + + + + + + + None + + + kcfg_CloseTabButton + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 16 + + + + + + + + Miscellaneous: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Expand individual tab widths to full window + + + + + + + Use user-defined stylesheet: + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 16 + 20 + + + + + + + + false + + + text/css + + + (none) + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + Behavior + + + + 0 + + + + + 6 + + + + + Put new tabs: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + At &the end + + + kcfg_NewTabBehavior + + + + + + + After current &tab + + + kcfg_NewTabBehavior + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 16 + + + + + + + + Miscellaneous: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Close tab on middle-click + + + + + + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + @@ -318,6 +378,7 @@ + tabs ShowTabBarWhenNeeded AlwaysShowTabBar AlwaysHideTabBar @@ -326,243 +387,227 @@ OnEachTab OnTabBar None + kcfg_ExpandTabWidth + kcfg_TabBarUseUserStyleSheet PutNewTabAtTheEnd PutNewTabAfterCurrentTab kcfg_CloseTabOnMiddleMouseButton - kcfg_ExpandTabWidth - kcfg_TabBarUseUserStyleSheet AlwaysHideTabBar toggled(bool) - kcfg_TabBarUseUserStyleSheet - setDisabled(bool) - - - 141 - 72 - - - 141 - 420 - - - - - AlwaysHideTabBar - toggled(bool) - PutNewTabAfterCurrentTab + None setDisabled(bool) - 141 - 72 + 20 + 20 - 141 - 320 + 20 + 20 AlwaysHideTabBar toggled(bool) - kcfg_CloseTabOnMiddleMouseButton + showCloseTabButtonLabel setDisabled(bool) - 141 - 72 + 20 + 20 - 141 - 368 + 20 + 20 AlwaysHideTabBar toggled(bool) - None + OnTabBar setDisabled(bool) - 141 - 72 + 20 + 20 - 141 - 246 + 20 + 20 AlwaysHideTabBar toggled(bool) - showCloseTabButtonLabel + Bottom setDisabled(bool) - 141 - 72 + 20 + 20 - 21 - 194 + 20 + 20 AlwaysHideTabBar toggled(bool) - OnTabBar + OnEachTab setDisabled(bool) - 141 - 72 + 20 + 20 - 141 - 220 + 20 + 20 AlwaysHideTabBar toggled(bool) - Bottom + positionLabel setDisabled(bool) - 141 - 72 + 20 + 20 - 141 - 146 + 20 + 20 AlwaysHideTabBar toggled(bool) - OnEachTab + Top setDisabled(bool) - 141 - 72 + 20 + 20 - 141 - 194 + 20 + 20 AlwaysHideTabBar toggled(bool) - miscellaneousLabel + miscellaneousAppearanceLabel setDisabled(bool) - 141 - 72 + 20 + 20 - 63 - 368 + 20 + 20 AlwaysHideTabBar toggled(bool) - putNewTabsLabel + kcfg_ExpandTabWidth setDisabled(bool) - 141 - 72 + 20 + 20 - 21 - 294 + 20 + 20 AlwaysHideTabBar toggled(bool) - positionLabel + kcfg_TabBarUseUserStyleSheet setDisabled(bool) - 141 - 72 + 20 + 20 - 21 - 120 + 20 + 20 - AlwaysHideTabBar + kcfg_TabBarUseUserStyleSheet toggled(bool) - PutNewTabAtTheEnd - setDisabled(bool) + kcfg_TabBarUserStyleSheetFile + setEnabled(bool) - 141 - 72 + 20 + 20 - 141 - 294 + 20 + 20 AlwaysHideTabBar toggled(bool) - Top + kcfg_CloseTabOnMiddleMouseButton setDisabled(bool) - 141 - 72 + 20 + 20 - 141 - 120 + 20 + 20 AlwaysHideTabBar toggled(bool) - kcfg_ExpandTabWidth + miscellaneousBehaviorLabel setDisabled(bool) - 141 - 72 + 20 + 20 - 141 - 394 + 20 + 20 - - + +