From 72e242267b8415b55b3de0d01201ee04a1f7d76b Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 15 Oct 2023 11:20:49 +0200 Subject: [PATCH] Only apply ui_style if it has changed --- src/frontends/qt/GuiPrefs.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp index e72baf8f03..a0c28e413f 100644 --- a/src/frontends/qt/GuiPrefs.cpp +++ b/src/frontends/qt/GuiPrefs.cpp @@ -2536,15 +2536,17 @@ void PrefUserInterface::applyRC(LyXRC & rc) const QString const uistyle = uiStyleCO->itemData( uiStyleCO->currentIndex()).toString(); - rc.ui_style = fromqstr(uistyle); - if (rc.ui_style == "default") - // FIXME: This should work with frontend::GuiApplication::setStyle(QString()) - // Qt bug https://bugreports.qt.io/browse/QTBUG-58268 - frontend::Alert::warning(_("Restart needed"), - _("Resetting the user interface style to 'Default'" - " requires a restart of LyX.")); - else - frontend::GuiApplication::setStyle(uistyle); + if (rc.ui_style != fromqstr(uistyle)) { + rc.ui_style = fromqstr(uistyle); + if (rc.ui_style == "default") + // FIXME: This should work with frontend::GuiApplication::setStyle(QString()) + // Qt bug https://bugreports.qt.io/browse/QTBUG-58268 + frontend::Alert::warning(_("Restart needed"), + _("Resetting the user interface style to 'Default'" + " requires a restart of LyX.")); + else + frontend::GuiApplication::setStyle(uistyle); + } rc.ui_file = internal_path(fromqstr(uiFileED->text())); rc.use_system_theme_icons = useSystemThemeIconsCB->isChecked(); -- 2.39.5