This commit is contained in:
cristian64 2026-03-20 23:40:55 -05:00 committed by GitHub
commit fe2dacd0d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,15 +159,13 @@ void Settings::ApplyStyle()
{
const StyleType style_type = GetStyleType();
{
const bool use_fusion{style_type == StyleType::FusionLight ||
style_type == StyleType::FusionDarkGray ||
style_type == StyleType::FusionDark};
static const QString s_initial_style_name{QApplication::style()->name()};
const QString style_name{use_fusion ? QStringLiteral("fusion") : s_initial_style_name};
if (QApplication::style()->name() != style_name)
QApplication::setStyle(style_name);
}
const bool use_fusion{style_type == StyleType::FusionLight ||
style_type == StyleType::FusionDarkGray ||
style_type == StyleType::FusionDark};
static const QString s_initial_style_name{QApplication::style()->name()};
const QString style_name{use_fusion ? QStringLiteral("fusion") : s_initial_style_name};
if (QApplication::style()->name() != style_name)
QApplication::setStyle(style_name);
const QString stylesheet_name = GetUserStyleName();
QString stylesheet_contents;
@ -386,6 +384,26 @@ void Settings::ApplyStyle()
stylesheet_contents.append(QStringLiteral("%1").arg(tooltip_stylesheet));
}
// For Fusion, define group box style if not already defined.
if (style_name.compare(QStringLiteral("fusion"), Qt::CaseInsensitive) == 0 &&
!stylesheet_contents.contains(QStringLiteral("QGroupBox")))
{
stylesheet_contents.append(QStringLiteral("QGroupBox {"
" margin-top: 0.6em;"
" padding-top: 0.5em;"
" padding-bottom: 0;"
" padding-left: 1px;"
" padding-right: 1px;"
"} "
"QGroupBox::title {"
" subcontrol-origin: margin;"
" subcontrol-position: top left;"
" left: 0.7em;"
" padding-top: 1px;"
" min-width: 0;"
"}"));
}
qApp->setStyleSheet(stylesheet_contents);
}