commit a99a16ae5893cfe8f64612e43f65fbe3bb1ed032
Author: Eugene Chornyi <yu_...@lyx.org>
Date:   Wed Oct 11 23:20:37 2023 +0200

    Revert 072ba7bd and f1deb1c6
---
 lib/RELEASE-NOTES                   |    4 --
 lib/configure.py                    |    2 +-
 lib/doc/UserGuide.lyx               |   30 +------------------
 lib/scripts/prefs2prefs_prefs.py    |    7 +----
 src/LyX.cpp                         |   10 ++----
 src/LyXRC.cpp                       |   17 +----------
 src/LyXRC.h                         |    3 --
 src/frontends/qt/GuiApplication.cpp |    3 --
 src/frontends/qt/GuiPrefs.cpp       |   13 --------
 src/frontends/qt/ui/PrefUi.ui       |   54 +++++++++++------------------------
 10 files changed, 25 insertions(+), 118 deletions(-)

diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES
index d8af79b..9b939b7 100644
--- a/lib/RELEASE-NOTES
+++ b/lib/RELEASE-NOTES
@@ -53,10 +53,6 @@
 
 * Edit > Paste operation now preserves newlines in text by default.
 
-* Dark mode on Windows is possible now by choosing "fusion" user interface 
style
-  in user interface preferences dialog, your system style has to be set to dark
-  (bug 12832).
-
 
 !!Documents compilation process and images conversion
 
diff --git a/lib/configure.py b/lib/configure.py
index 5d0806e..e5f71f7 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -2004,7 +2004,7 @@ if __name__ == '__main__':
     lyx_check_config = True
     lyx_kpsewhich = True
     outfile = 'lyxrc.defaults'
-    lyxrc_fileformat = 38
+    lyxrc_fileformat = 37
     rc_entries = ''
     lyx_keep_temps = False
     version_suffix = ''
diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx
index a4a53cf..1239e73 100644
--- a/lib/doc/UserGuide.lyx
+++ b/lib/doc/UserGuide.lyx
@@ -1,5 +1,5 @@
 #LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 620
+\lyxformat 618
 \begin_document
 \begin_header
 \save_transient_properties true
@@ -167,7 +167,6 @@ logicalmkup
 \author 5863208 "ab"
 \author 5863344 "Enrico Forestieri"
 \author 244031559 "Yuriy"
-\author 258250489 "eugen"
 \author 274215730 "scott"
 \author 630872221 "Jean-Pierre Chrétien" jeanpierre.chret...@free.fr
 \author 1064312605 "Udi Fogiel"
@@ -58116,33 +58115,6 @@ literal "false"
 \end_inset
 
 .
-\change_inserted 258250489 1697053558
-
-\end_layout
-
-\begin_layout Standard
-
-\change_inserted 258250489 1697054388
-
-\family sans
-User
-\begin_inset space ~
-\end_inset
-
-interface
-\begin_inset space ~
-\end_inset
-
-style
-\family default
- allows you to change the look and feel of \SpecialChar LyX
-'s user interface control elements.
- There may be different choices available on different operating systems.
- On certain operating systems some styles may support dark mode while others 
don't.
- In order to use dark mode in \SpecialChar LyX
- you may first need to enable it in your system's settings.
-\change_unchanged
-
 \end_layout
 
 \begin_layout Subsubsection
diff --git a/lib/scripts/prefs2prefs_prefs.py b/lib/scripts/prefs2prefs_prefs.py
index b625909..a5a3a7d 100644
--- a/lib/scripts/prefs2prefs_prefs.py
+++ b/lib/scripts/prefs2prefs_prefs.py
@@ -168,10 +168,6 @@
 #  Add \screen_width
 #  Add \screen_limit
 
-# Incremented to format 38, by ec
-#   Add option to configure ui style
-#   No conversion necessary.
-
 # NOTE: The format should also be updated in LYXRC.cpp and
 # in configure.py (search for lyxrc_fileformat).
 
@@ -559,6 +555,5 @@ conversions = [
        [ 34, [rename_cyrillic_kmap_files]],
        [ 35, [add_dark_color]],
        [ 36, [add_spellcheck_default]],
-       [ 37, [remove_fullscreen_widthlimit]],
-       [ 38, []],
+       [ 37, [remove_fullscreen_widthlimit]]
 ]
diff --git a/src/LyX.cpp b/src/LyX.cpp
index 923062b..04c1dd4 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -354,12 +354,6 @@ int LyX::exec(int & argc, char * argv[])
                return app.exec();
        }
 
-       // This one is edited through the preferences dialog.
-       // need to call this before createApplication
-       // because we need to know the Qt style for creating the Application
-       if (!readRcFile("preferences", true))
-               return EXIT_FAILURE;
-
        // Let the frontend parse and remove all arguments that it knows
        pimpl_->application_.reset(createApplication(argc, argv));
 
@@ -1000,6 +994,10 @@ bool LyX::init()
        pimpl_->system_movers_ = pimpl_->movers_;
        system_lcolor = lcolor;
 
+       // This one is edited through the preferences dialog.
+       if (!readRcFile("preferences", true))
+               return false;
+
        // The language may have been set to someting useful through prefs
        setLocale();
 
diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index 73aec18..fa50d4a 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -60,7 +60,7 @@ namespace {
 
 // The format should also be updated in configure.py, and conversion code
 // should be added to prefs2prefs_prefs.py.
-static unsigned int const LYXRC_FILEFORMAT = 38; // chillenb: screen_width and 
screen_limit
+static unsigned int const LYXRC_FILEFORMAT = 37; // chillenb: screen_width and 
screen_limit
 // when adding something to this array keep it sorted!
 LexerKeyword lyxrcTags[] = {
        { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
@@ -197,7 +197,6 @@ LexerKeyword lyxrcTags[] = {
        { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
        { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
        { "\\ui_file", LyXRC::RC_UIFILE },
-       { "\\ui_style", LyXRC::RC_UI_STYLE },
        { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
        { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
        { "\\use_converter_needauth_forbidden", 
LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
@@ -604,10 +603,6 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool 
check_format)
                        lexrc >> icon_set;
                        break;
 
-               case RC_UI_STYLE:
-                       lexrc >> ui_style;
-                       break;
-
                case RC_USE_SYSTEM_THEME_ICONS:
                        lexrc >> use_system_theme_icons;
                        break;
@@ -1629,15 +1624,6 @@ void LyXRC::write(ostream & os, bool 
ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
                // fall through
-       case RC_UI_STYLE:
-               if (ignore_system_lyxrc ||
-                       ui_style != system_lyxrc.ui_style) {
-                       os << "\\ui_style \"" << ui_style
-                               << "\"\n";
-               }
-               if (tag != RC_LAST)
-                       break;
-               // fall through
        case RC_USE_SYSTEM_THEME_ICONS:
                if (ignore_system_lyxrc ||
                          use_system_theme_icons != 
system_lyxrc.use_system_theme_icons) {
@@ -2964,7 +2950,6 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC 
const & lyxrc_new)
        case LyXRC::RC_GROUP_LAYOUTS:
        case LyXRC::RC_HUNSPELLDIR_PATH:
        case LyXRC::RC_ICON_SET:
-       case LyXRC::RC_UI_STYLE:
        case LyXRC::RC_INDEX_ALTERNATIVES:
        case LyXRC::RC_INDEX_COMMAND:
        case LyXRC::RC_JBIBTEX_COMMAND:
diff --git a/src/LyXRC.h b/src/LyXRC.h
index d091e68..c196d57 100644
--- a/src/LyXRC.h
+++ b/src/LyXRC.h
@@ -173,7 +173,6 @@ public:
                RC_TEXINPUTS_PREFIX,
                RC_THESAURUSDIRPATH,
                RC_UIFILE,
-               RC_UI_STYLE,
                RC_USELASTFILEPOS,
                RC_USER_EMAIL,
                RC_USER_INITIALS,
@@ -474,8 +473,6 @@ public:
        std::string user_initials;
        /// icon set name
        std::string icon_set;
-       /// ui style name
-       std::string ui_style;
        /// whether to use the icons from the theme
        bool use_system_theme_icons = false;
        /// True if the TeX engine cannot handle posix paths
diff --git a/src/frontends/qt/GuiApplication.cpp 
b/src/frontends/qt/GuiApplication.cpp
index d74c878..b7abd42 100644
--- a/src/frontends/qt/GuiApplication.cpp
+++ b/src/frontends/qt/GuiApplication.cpp
@@ -222,9 +222,6 @@ frontend::Application * createApplication(int & argc, char 
* argv[])
 #endif
 #endif
 
-       if (!lyxrc.ui_style.empty())
-               frontend::GuiApplication::setStyle(toqstr(lyxrc.ui_style));
-
        frontend::GuiApplication * guiApp = new frontend::GuiApplication(argc, 
argv);
        // I'd rather do that in the constructor, but I do not think that
        // the palette is accessible there.
diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp
index 00c8167..9836086 100644
--- a/src/frontends/qt/GuiPrefs.cpp
+++ b/src/frontends/qt/GuiPrefs.cpp
@@ -63,7 +63,6 @@
 #include <QPushButton>
 #include <QSpinBox>
 #include <QString>
-#include <QStyleFactory>
 #include <QTreeWidget>
 #include <QTreeWidgetItem>
 #include <QValidator>
@@ -2495,8 +2494,6 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * 
form)
                this, SIGNAL(changed()));
        connect(iconSetCO, SIGNAL(activated(int)),
                this, SIGNAL(changed()));
-       connect(uiStyleCO, SIGNAL(activated(int)),
-               this, SIGNAL(changed()));
        connect(useSystemThemeIconsCB, SIGNAL(clicked()),
                this, SIGNAL(changed()));
        connect(lastfilesSB, SIGNAL(valueChanged(int)),
@@ -2519,11 +2516,6 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * 
form)
        iconSetCO->addItem(qt_("Classic"), "classic");
        iconSetCO->addItem(qt_("Oxygen"), "oxygen");
 
-       for (const auto& style : QStyleFactory::keys())
-       {
-               uiStyleCO->addItem(style.toLower());
-       }
-
        if (guiApp->platformName() != "xcb"
            && !guiApp->platformName().contains("wayland"))
                useSystemThemeIconsCB->hide();
@@ -2535,9 +2527,6 @@ void PrefUserInterface::applyRC(LyXRC & rc) const
        rc.icon_set = fromqstr(iconSetCO->itemData(
                iconSetCO->currentIndex()).toString());
 
-       frontend::GuiApplication::setStyle(uiStyleCO->currentText());
-       rc.ui_style = fromqstr(uiStyleCO->currentText());
-
        rc.ui_file = internal_path(fromqstr(uiFileED->text()));
        rc.use_system_theme_icons = useSystemThemeIconsCB->isChecked();
        rc.num_lastfiles = lastfilesSB->value();
@@ -2556,8 +2545,6 @@ void PrefUserInterface::updateRC(LyXRC const & rc)
        if (iconset < 0)
                iconset = 0;
        iconSetCO->setCurrentIndex(iconset);
-       uiStyleCO->setCurrentIndex(uiStyleCO->findText(
-               frontend::GuiApplication::style()->objectName().toLower()));
        useSystemThemeIconsCB->setChecked(rc.use_system_theme_icons);
        uiFileED->setText(toqstr(external_path(rc.ui_file)));
        lastfilesSB->setValue(rc.num_lastfiles);
diff --git a/src/frontends/qt/ui/PrefUi.ui b/src/frontends/qt/ui/PrefUi.ui
index 7a2c8d4..d7551cb 100644
--- a/src/frontends/qt/ui/PrefUi.ui
+++ b/src/frontends/qt/ui/PrefUi.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>556</width>
-    <height>502</height>
+    <height>476</height>
    </rect>
   </property>
   <property name="sizePolicy">
@@ -42,33 +42,6 @@
       </item>
       <item row="0" column="0">
        <layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0">
-        <item row="1" column="2">
-         <layout class="QHBoxLayout" name="horizontalLayout"/>
-        </item>
-        <item row="0" column="2">
-         <widget class="QPushButton" name="uiFilePB">
-          <property name="text">
-           <string>Bro&amp;wse...</string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="1">
-         <widget class="QComboBox" name="iconSetCO">
-          <property name="toolTip">
-           <string>The icon set to use. Warning: normal size of icons may be 
wrong until you save the preferences and restart LyX.</string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="0">
-         <widget class="QLabel" name="iconSetLA">
-          <property name="text">
-           <string>&amp;Icon set:</string>
-          </property>
-          <property name="buddy">
-           <cstring>iconSetCO</cstring>
-          </property>
-         </widget>
-        </item>
         <item row="0" column="0">
          <widget class="QLabel" name="uiFileLA">
           <property name="text">
@@ -82,25 +55,32 @@
         <item row="0" column="1">
          <widget class="QLineEdit" name="uiFileED"/>
         </item>
-        <item row="2" column="0">
-         <widget class="QLabel" name="uiStyleLA">
+        <item row="0" column="2">
+         <widget class="QPushButton" name="uiFilePB">
           <property name="text">
-           <string>User interface &amp;style:</string>
+           <string>Bro&amp;wse...</string>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0">
+         <widget class="QLabel" name="iconSetLA">
+          <property name="text">
+           <string>&amp;Icon set:</string>
           </property>
           <property name="buddy">
-           <cstring>uiStyleCO</cstring>
+           <cstring>iconSetCO</cstring>
           </property>
          </widget>
         </item>
-        <item row="2" column="1">
-         <widget class="QComboBox" name="uiStyleCO">
+        <item row="1" column="1">
+         <widget class="QComboBox" name="iconSetCO">
           <property name="toolTip">
-           <string>Only certain styles may support dark mode, e.g. fusion on 
Windows</string>
+           <string>The icon set to use. Warning: normal size of icons may be 
wrong until you save the preferences and restart LyX.</string>
           </property>
          </widget>
         </item>
-        <item row="2" column="2">
-         <layout class="QHBoxLayout" name="horizontalLayout_2"/>
+        <item row="1" column="2">
+         <layout class="QHBoxLayout" name="horizontalLayout"/>
         </item>
        </layout>
       </item>
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to