commit f12b02dafa786eae2e1363f1c77c7cea68743de8
Author: Koji Yokota <[email protected]>
Date:   Tue Mar 11 21:36:41 2025 +0900

    Make icon buttons more explanatory
---
 src/frontends/qt/GuiPrefs.cpp       |  59 +---
 src/frontends/qt/ui/PrefColorsUi.ui | 546 +++++++++++++++++-------------------
 2 files changed, 270 insertions(+), 335 deletions(-)

diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp
index 2a480d04c4..75a2b894b8 100644
--- a/src/frontends/qt/GuiPrefs.cpp
+++ b/src/frontends/qt/GuiPrefs.cpp
@@ -1039,49 +1039,6 @@ PrefColors::PrefColors(GuiPreferences * form)
 
        undo_stack_ = new QUndoStack(this);
 
-       // set up tool icons
-       const QIcon undoIcon =
-               QIcon(QPixmap(toqstr(
-                                 
addPathName(package().system_support().absFileName(),
-                                             "images/undo.svgz"))));
-       QAction* undoAct = new QAction(undoIcon, qt_("Undo"), this);
-       undoColorPB->setDefaultAction(undoAct);
-
-       const QIcon redoIcon =
-               QIcon(QPixmap(toqstr(
-                                 
addPathName(package().system_support().absFileName(),
-                                             "images/redo.svgz"))));
-       QAction* redoAct = new QAction(redoIcon, qt_("Redo"), this);
-       redoColorPB->setDefaultAction(redoAct);
-
-       const QIcon resetIcon =
-               QIcon(QPixmap(toqstr(
-                                 
addPathName(package().system_support().absFileName(),
-                                             "images/reload.svgz"))));
-       QAction* resetAct = new QAction(resetIcon, qt_("Reset current 
light/dark colors to default"), this);
-       colorResetPB->setDefaultAction(resetAct);
-
-       const QIcon resetAllIcon =
-               QIcon(QPixmap(toqstr(
-                                 
addPathName(package().system_support().absFileName(),
-                                             "images/buffer-close.svgz"))));
-       QAction* resetAllAct = new QAction(resetAllIcon, qt_("Reset all colors 
to default"), this);
-       colorResetAllPB->setDefaultAction(resetAllAct);
-
-       const QIcon findPreviousIcon =
-               QIcon(QPixmap(toqstr(
-                                 
addPathName(package().system_support().absFileName(),
-                                             "images/bookmark-goto_0.svgz"))));
-       QAction* findPreviousAct = new QAction(findPreviousIcon, qt_("Find 
Previous"), this);
-       searchBackwardPB->setDefaultAction(findPreviousAct);
-
-       const QIcon findNextIcon =
-               QIcon(QPixmap(toqstr(
-                                 
addPathName(package().system_support().absFileName(),
-                                             "images/bookmark-goto.svgz"))));
-       QAction* findNextAct = new QAction(findNextIcon, qt_("Find Next"), 
this);
-       searchForwardPB->setDefaultAction(findNextAct);
-
        // setup shortcuts
        QShortcut* sc_undo = new QShortcut(QKeySequence(QKeySequence::Undo), 
this);
        QShortcut* sc_redo = new QShortcut(QKeySequence(QKeySequence::Redo), 
this);
@@ -1099,6 +1056,10 @@ PrefColors::PrefColors(GuiPreferences * form)
 
        connect(autoapplyCB, SIGNAL(toggled(bool)),
                this, SLOT(changeAutoapply()));
+       connect(colorResetPB, SIGNAL(clicked()),
+               this, SLOT(resetColor()));
+       connect(colorResetAllPB, SIGNAL(clicked()),
+               this, SLOT(resetAllColor()));
        connect(colorsTW, SIGNAL(cellClicked(int,int)),
                this, SLOT(changeColor(int,int)));
        connect(colorsTW, SIGNAL(itemActivated(QTableWidgetItem*)),
@@ -1107,18 +1068,14 @@ PrefColors::PrefColors(GuiPreferences * form)
                this, SLOT(changeLyxObjectsSelection()));
        connect(colorsTW, SIGNAL(itemPressed(QTableWidgetItem*)),
                this, SLOT(pressCurrentItem(QTableWidgetItem*)));
-       connect(findNextAct, SIGNAL(triggered()),
+       connect(findNextPB, SIGNAL(clicked()),
                this, SLOT(searchNextColorItem()));
-       connect(findPreviousAct, SIGNAL(triggered()),
+       connect(findPreviousPB, SIGNAL(clicked()),
                this, SLOT(searchPreviousColorItem()));
-       connect(redoAct, SIGNAL(triggered()),
+       connect(redoColorPB, SIGNAL(clicked()),
                undo_stack_, SLOT(redo()));
        connect(removeThemePB, SIGNAL(clicked()),
                this, SLOT(removeTheme()));
-       connect(resetAct, SIGNAL(triggered()),
-               this, SLOT(resetColor()));
-       connect(resetAllAct, SIGNAL(triggered()),
-               this, SLOT(resetAllColor()));
        connect(saveThemePB, SIGNAL(clicked()),
                this, SLOT(saveThemeInterface()));
        connect(sc_search, SIGNAL(activated()),
@@ -1141,7 +1098,7 @@ PrefColors::PrefColors(GuiPreferences * form)
                this, SLOT(openThemeMenu()));
        connect(themesLW, SIGNAL(itemClicked(QListWidgetItem*)),
                this, SLOT(loadThemeInterface(QListWidgetItem*)));
-       connect(undoAct, SIGNAL(triggered()),
+       connect(undoColorPB, SIGNAL(clicked()),
                undo_stack_, SLOT(undo()));
 }
 
diff --git a/src/frontends/qt/ui/PrefColorsUi.ui 
b/src/frontends/qt/ui/PrefColorsUi.ui
index 81ba4ad501..fa189783d5 100644
--- a/src/frontends/qt/ui/PrefColorsUi.ui
+++ b/src/frontends/qt/ui/PrefColorsUi.ui
@@ -20,54 +20,222 @@
    <string/>
   </property>
   <layout class="QGridLayout" name="gridLayout_2">
-   <item row="1" column="0" colspan="3">
-    <layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0" 
columnstretch="0,0,0,0,0,0,0,0">
-     <item row="1" column="1" rowspan="2" colspan="7">
-      <widget class="QTableWidget" name="colorsTW">
-       <property name="font">
-        <font>
-         <family>.AppleSystemUIFont</family>
-        </font>
+   <item row="3" column="0">
+    <widget class="QCheckBox" name="syscolorsCB">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="toolTip">
+      <string>Use the color scheme of your Operating System/Desktop 
Environment</string>
+     </property>
+     <property name="text">
+      <string>&amp;Use system colors</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="QCheckBox" name="autoapplyCB">
+     <property name="toolTip">
+      <string>Apply changed color immediately</string>
+     </property>
+     <property name="text">
+      <string>Update &amp;immediately</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="2">
+    <spacer name="hsBottomRight">
+     <property name="orientation">
+      <enum>Qt::Orientation::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="3" column="3">
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <property name="spacing">
+      <number>0</number>
+     </property>
+     <property name="rightMargin">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="QToolButton" name="undoColorPB">
+       <property name="toolTip">
+        <string>Undo</string>
+       </property>
+       <property name="text">
+        <string>&amp;Undo</string>
        </property>
        <property name="iconSize">
         <size>
-         <width>32</width>
+         <width>16</width>
          <height>16</height>
         </size>
        </property>
-       <property name="showGrid">
-        <bool>false</bool>
+       <property name="arrowType">
+        <enum>Qt::ArrowType::NoArrow</enum>
        </property>
-       <property name="sortingEnabled">
-        <bool>true</bool>
+      </widget>
+     </item>
+     <item>
+      <widget class="QToolButton" name="redoColorPB">
+       <property name="toolTip">
+        <string>Redo</string>
        </property>
-       <property name="columnCount">
-        <number>3</number>
+       <property name="text">
+        <string>Re&amp;do</string>
+       </property>
+       <property name="iconSize">
+        <size>
+         <width>16</width>
+         <height>16</height>
+        </size>
        </property>
-       <attribute name="horizontalHeaderMinimumSectionSize">
-        <number>24</number>
-       </attribute>
-       <attribute name="horizontalHeaderDefaultSectionSize">
-        <number>36</number>
-       </attribute>
-       <attribute name="horizontalHeaderStretchLastSection">
-        <bool>true</bool>
-       </attribute>
-       <attribute name="verticalHeaderVisible">
-        <bool>false</bool>
-       </attribute>
-       <attribute name="verticalHeaderMinimumSectionSize">
-        <number>12</number>
-       </attribute>
-       <attribute name="verticalHeaderDefaultSectionSize">
-        <number>18</number>
-       </attribute>
-       <column/>
-       <column/>
-       <column/>
       </widget>
      </item>
-     <item row="0" column="6">
+     <item>
+      <spacer name="horizontalSpacer_2">
+       <property name="orientation">
+        <enum>Qt::Orientation::Horizontal</enum>
+       </property>
+       <property name="sizeType">
+        <enum>QSizePolicy::Policy::Fixed</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>13</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QToolButton" name="colorResetPB">
+       <property name="toolTip">
+        <string>Revert selected to theme colors</string>
+       </property>
+       <property name="text">
+        <string>Re&amp;set</string>
+       </property>
+       <property name="iconSize">
+        <size>
+         <width>16</width>
+         <height>16</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QToolButton" name="colorResetAllPB">
+       <property name="toolTip">
+        <string>Reset all colors to theme</string>
+       </property>
+       <property name="text">
+        <string>Reset A&amp;ll</string>
+       </property>
+       <property name="iconSize">
+        <size>
+         <width>16</width>
+         <height>16</height>
+        </size>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="1" column="0" colspan="4">
+    <layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0" 
columnstretch="0,0,0,0,0,0">
+     <item row="1" column="0" rowspan="2">
+      <layout class="QGridLayout" name="gridLayoutThemes">
+       <property name="spacing">
+        <number>0</number>
+       </property>
+       <item row="1" column="3">
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Orientation::Horizontal</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Policy::Preferred</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="1" column="2">
+        <widget class="QToolButton" name="removeThemePB">
+         <property name="toolTip">
+          <string>Remove a selected color theme</string>
+         </property>
+         <property name="text">
+          <string>&amp;Remove</string>
+         </property>
+         <property name="shortcut">
+          <string notr="true">Ctrl+R</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="4">
+        <widget class="QToolButton" name="themesMenuPB">
+         <property name="toolTip">
+          <string>Other menus to handle themes</string>
+         </property>
+         <property name="text">
+          <string>&amp;More...</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QToolButton" name="saveThemePB">
+         <property name="toolTip">
+          <string>Add the current color set as a theme</string>
+         </property>
+         <property name="text">
+          <string>&amp;Add</string>
+         </property>
+         <property name="shortcut">
+          <string>Ctrl+S</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1" colspan="4">
+        <widget class="QListWidget" name="themesLW">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Maximum" vsizetype="Expanding">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="maximumSize">
+          <size>
+           <width>200</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="baseSize">
+          <size>
+           <width>150</width>
+           <height>0</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item row="0" column="4">
       <layout class="QHBoxLayout" name="searchLayout">
        <property name="spacing">
         <number>0</number>
@@ -107,15 +275,12 @@
         </widget>
        </item>
        <item>
-        <widget class="QToolButton" name="searchBackwardPB">
+        <widget class="QToolButton" name="findPreviousPB">
          <property name="toolTip">
           <string>Search backward</string>
          </property>
          <property name="text">
-          <string>&lt;-</string>
-         </property>
-         <property name="icon">
-          <iconset theme="QIcon::ThemeIcon::GoPrevious"/>
+          <string>Pr&amp;evious</string>
          </property>
          <property name="iconSize">
           <size>
@@ -126,7 +291,7 @@
         </widget>
        </item>
        <item>
-        <widget class="QToolButton" name="searchForwardPB">
+        <widget class="QToolButton" name="findNextPB">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
            <horstretch>0</horstretch>
@@ -137,10 +302,7 @@
           <string>Search forward</string>
          </property>
          <property name="text">
-          <string>-&gt;</string>
-         </property>
-         <property name="icon">
-          <iconset theme="QIcon::ThemeIcon::GoNext"/>
+          <string>&amp;Next</string>
          </property>
          <property name="iconSize">
           <size>
@@ -156,125 +318,64 @@
       </layout>
      </item>
      <item row="0" column="5">
-      <spacer name="hsTitleCenter">
+      <spacer name="hsTitleRight">
        <property name="orientation">
         <enum>Qt::Orientation::Horizontal</enum>
        </property>
        <property name="sizeType">
-        <enum>QSizePolicy::Policy::Maximum</enum>
+        <enum>QSizePolicy::Policy::Fixed</enum>
        </property>
        <property name="sizeHint" stdset="0">
         <size>
-         <width>30</width>
-         <height>13</height>
+         <width>13</width>
+         <height>20</height>
         </size>
        </property>
       </spacer>
      </item>
-     <item row="0" column="4">
-      <layout class="QHBoxLayout" name="horizontalLayout">
-       <property name="spacing">
-        <number>0</number>
+     <item row="1" column="1" rowspan="2" colspan="5">
+      <widget class="QTableWidget" name="colorsTW">
+       <property name="font">
+        <font>
+         <family>.AppleSystemUIFont</family>
+        </font>
        </property>
-       <property name="rightMargin">
-        <number>0</number>
+       <property name="iconSize">
+        <size>
+         <width>32</width>
+         <height>16</height>
+        </size>
        </property>
-       <item>
-        <widget class="QToolButton" name="undoColorPB">
-         <property name="toolTip">
-          <string>Undo</string>
-         </property>
-         <property name="text">
-          <string>&lt;=</string>
-         </property>
-         <property name="iconSize">
-          <size>
-           <width>16</width>
-           <height>16</height>
-          </size>
-         </property>
-         <property name="arrowType">
-          <enum>Qt::ArrowType::NoArrow</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QToolButton" name="redoColorPB">
-         <property name="toolTip">
-          <string>Redo</string>
-         </property>
-         <property name="text">
-          <string>=&gt;</string>
-         </property>
-         <property name="iconSize">
-          <size>
-           <width>16</width>
-           <height>16</height>
-          </size>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="horizontalSpacer_2">
-         <property name="orientation">
-          <enum>Qt::Orientation::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Policy::Fixed</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>13</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QToolButton" name="colorResetPB">
-         <property name="toolTip">
-          <string>Revert selected to theme colors</string>
-         </property>
-         <property name="text">
-          <string>R</string>
-         </property>
-         <property name="iconSize">
-          <size>
-           <width>16</width>
-           <height>16</height>
-          </size>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QToolButton" name="colorResetAllPB">
-         <property name="toolTip">
-          <string>Reset all colors to theme</string>
-         </property>
-         <property name="text">
-          <string>A</string>
-         </property>
-         <property name="iconSize">
-          <size>
-           <width>16</width>
-           <height>16</height>
-          </size>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item row="0" column="0">
-      <widget class="QLabel" name="themesLabel">
-       <property name="text">
-        <string>&amp;Themes:</string>
+       <property name="showGrid">
+        <bool>false</bool>
        </property>
-       <property name="alignment">
-        
<set>Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft</set>
+       <property name="sortingEnabled">
+        <bool>true</bool>
        </property>
-       <property name="buddy">
-        <cstring>themesLW</cstring>
+       <property name="columnCount">
+        <number>3</number>
        </property>
+       <attribute name="horizontalHeaderMinimumSectionSize">
+        <number>24</number>
+       </attribute>
+       <attribute name="horizontalHeaderDefaultSectionSize">
+        <number>36</number>
+       </attribute>
+       <attribute name="horizontalHeaderStretchLastSection">
+        <bool>true</bool>
+       </attribute>
+       <attribute name="verticalHeaderVisible">
+        <bool>false</bool>
+       </attribute>
+       <attribute name="verticalHeaderMinimumSectionSize">
+        <number>12</number>
+       </attribute>
+       <attribute name="verticalHeaderDefaultSectionSize">
+        <number>18</number>
+       </attribute>
+       <column/>
+       <column/>
+       <column/>
       </widget>
      </item>
      <item row="0" column="1" colspan="2">
@@ -290,102 +391,18 @@
        </property>
       </widget>
      </item>
-     <item row="0" column="7">
-      <spacer name="hsTitleRight">
-       <property name="orientation">
-        <enum>Qt::Orientation::Horizontal</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Policy::Fixed</enum>
+     <item row="0" column="0">
+      <widget class="QLabel" name="themesLabel">
+       <property name="text">
+        <string>&amp;Themes:</string>
        </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>13</width>
-         <height>20</height>
-        </size>
+       <property name="alignment">
+        
<set>Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft</set>
        </property>
-      </spacer>
-     </item>
-     <item row="1" column="0" rowspan="2">
-      <layout class="QGridLayout" name="gridLayoutThemes">
-       <property name="spacing">
-        <number>0</number>
+       <property name="buddy">
+        <cstring>themesLW</cstring>
        </property>
-       <item row="1" column="3">
-        <spacer name="horizontalSpacer">
-         <property name="orientation">
-          <enum>Qt::Orientation::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Policy::Preferred</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="1" column="2">
-        <widget class="QToolButton" name="removeThemePB">
-         <property name="toolTip">
-          <string>Remove a selected color theme</string>
-         </property>
-         <property name="text">
-          <string>-</string>
-         </property>
-         <property name="shortcut">
-          <string notr="true">Ctrl+R</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="4">
-        <widget class="QToolButton" name="themesMenuPB">
-         <property name="toolTip">
-          <string>Other menus to handle themes</string>
-         </property>
-         <property name="text">
-          <string>...</string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="1">
-        <widget class="QToolButton" name="saveThemePB">
-         <property name="toolTip">
-          <string>Add the current color set as a theme</string>
-         </property>
-         <property name="text">
-          <string>+</string>
-         </property>
-         <property name="shortcut">
-          <string>Ctrl+S</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="1" colspan="4">
-        <widget class="QListWidget" name="themesLW">
-         <property name="sizePolicy">
-          <sizepolicy hsizetype="Maximum" vsizetype="Expanding">
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>180</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="baseSize">
-          <size>
-           <width>150</width>
-           <height>0</height>
-          </size>
-         </property>
-        </widget>
-       </item>
-      </layout>
+      </widget>
      </item>
      <item row="0" column="3">
       <spacer name="horizontalSpacer_3">
@@ -402,53 +419,14 @@
      </item>
     </layout>
    </item>
-   <item row="3" column="0">
-    <widget class="QCheckBox" name="syscolorsCB">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="toolTip">
-      <string>Use the color scheme of your Operating System/Desktop 
Environment</string>
-     </property>
-     <property name="text">
-      <string>&amp;Use system colors</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="1">
-    <widget class="QCheckBox" name="autoapplyCB">
-     <property name="toolTip">
-      <string>Apply changed color immediately</string>
-     </property>
-     <property name="text">
-      <string>Update &amp;immediately</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="2">
-    <spacer name="hsBottomRight">
-     <property name="orientation">
-      <enum>Qt::Orientation::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <tabstops>
   <tabstop>undoColorPB</tabstop>
   <tabstop>redoColorPB</tabstop>
   <tabstop>searchStringEdit</tabstop>
-  <tabstop>searchBackwardPB</tabstop>
-  <tabstop>searchForwardPB</tabstop>
+  <tabstop>findPreviousPB</tabstop>
+  <tabstop>findNextPB</tabstop>
   <tabstop>syscolorsCB</tabstop>
   <tabstop>autoapplyCB</tabstop>
  </tabstops>
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to