commit 73bceb9d300a2df370390bc68eb13e3299dbdb8f
Author: Juergen Spitzmueller <[email protected]>
Date: Fri Mar 14 09:58:14 2025 +0100
Some layout fixes
---
src/frontends/qt/GuiPrefs.cpp | 1 +
src/frontends/qt/ui/PrefColorsUi.ui | 585 +++++++++++++++++-------------------
2 files changed, 274 insertions(+), 312 deletions(-)
diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp
index eaec6f16c0..387e1ada4a 100644
--- a/src/frontends/qt/GuiPrefs.cpp
+++ b/src/frontends/qt/GuiPrefs.cpp
@@ -1026,6 +1026,7 @@ PrefColors::PrefColors(GuiPreferences * form)
colorsTW->setRowCount(lcolors_.size());
colorsTW->setHorizontalHeaderLabels({qt_("Light"), qt_("Dark"),
qt_("Color name")});
+
colorsTW->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
for (size_type row=0; row!=lcolors_.size(); ++row) {
colorsTW->setItem(row, 0, new QTableWidgetItem(icon, ""));
colorsTW->setItem(row, 1, new QTableWidgetItem(icon, ""));
diff --git a/src/frontends/qt/ui/PrefColorsUi.ui
b/src/frontends/qt/ui/PrefColorsUi.ui
index fa189783d5..ad02f0d32a 100644
--- a/src/frontends/qt/ui/PrefColorsUi.ui
+++ b/src/frontends/qt/ui/PrefColorsUi.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>636</width>
- <height>439</height>
+ <width>606</width>
+ <height>361</height>
</rect>
</property>
<property name="sizePolicy">
@@ -19,268 +19,338 @@
<property name="windowTitle">
<string/>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="3" column="0">
- <widget class="QCheckBox" name="syscolorsCB">
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="themseGB">
+ <property name="title">
+ <string>Themes</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QListWidget" name="themesLW">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QToolButton" name="saveThemePB">
+ <property name="toolTip">
+ <string>Add the current color set as a theme</string>
+ </property>
+ <property name="text">
+ <string>&Add</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+S</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="removeThemePB">
+ <property name="toolTip">
+ <string>Remove a selected color theme</string>
+ </property>
+ <property name="text">
+ <string>&Remove</string>
+ </property>
+ <property name="shortcut">
+ <string notr="true">Ctrl+R</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Preferred</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>4</width>
+ <height>29</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QToolButton" name="themesMenuPB">
+ <property name="toolTip">
+ <string>Other menus to handle themes</string>
+ </property>
+ <property name="text">
+ <string>&More...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QGroupBox" name="colorSettingsGB">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<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>&Use system colors</string>
+ <property name="title">
+ <string>Color Settings</string>
</property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="searchLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QLineEdit" name="searchStringEdit">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>150</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>500</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Enter a color name to search</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ <property name="placeholderText">
+ <string>Search color</string>
+ </property>
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="findPreviousPB">
+ <property name="toolTip">
+ <string>Search backward</string>
+ </property>
+ <property name="text">
+ <string>Pr&evious</string>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="findNextPB">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>Search forward</string>
+ </property>
+ <property name="text">
+ <string>&Next</string>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+S</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <widget class="QTableWidget" name="colorsTW">
+ <property name="iconSize">
+ <size>
+ <width>32</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="showGrid">
+ <bool>false</bool>
+ </property>
+ <property name="sortingEnabled">
+ <bool>true</bool>
+ </property>
+ <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>
+ </layout>
</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 &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 row="1" column="0" colspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
- <widget class="QToolButton" name="undoColorPB">
+ <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>Undo</string>
+ <string>Use the color scheme of your Operating System/Desktop
Environment</string>
</property>
<property name="text">
- <string>&Undo</string>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- <property name="arrowType">
- <enum>Qt::ArrowType::NoArrow</enum>
+ <string>&Use system colors</string>
</property>
</widget>
</item>
<item>
- <widget class="QToolButton" name="redoColorPB">
+ <widget class="QCheckBox" name="autoapplyCB">
<property name="toolTip">
- <string>Redo</string>
+ <string>Apply changed color immediately</string>
</property>
<property name="text">
- <string>Re&do</string>
- </property>
- <property name="iconSize">
- <size>
- <width>16</width>
- <height>16</height>
- </size>
+ <string>Update &immediately</string>
</property>
</widget>
</item>
<item>
- <spacer name="horizontalSpacer_2">
+ <spacer name="hsBottomRight">
<property name="orientation">
- <enum>Qt::Orientation::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Policy::Fixed</enum>
+ <enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>13</width>
+ <width>157</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&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&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">
+ <layout class="QHBoxLayout" name="horizontalLayout">
<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="rightMargin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QToolButton" name="undoColorPB">
<property name="toolTip">
- <string>Remove a selected color theme</string>
+ <string>Undo</string>
</property>
<property name="text">
- <string>&Remove</string>
- </property>
- <property name="shortcut">
- <string notr="true">Ctrl+R</string>
+ <string>&Undo</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 name="iconSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
</property>
- <property name="text">
- <string>&More...</string>
+ <property name="arrowType">
+ <enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QToolButton" name="saveThemePB">
+ <item>
+ <widget class="QToolButton" name="redoColorPB">
<property name="toolTip">
- <string>Add the current color set as a theme</string>
+ <string>Redo</string>
</property>
<property name="text">
- <string>&Add</string>
+ <string>Re&do</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">
+ <property name="iconSize">
<size>
- <width>150</width>
- <height>0</height>
+ <width>16</width>
+ <height>16</height>
</size>
</property>
</widget>
</item>
- </layout>
- </item>
- <item row="0" column="4">
- <layout class="QHBoxLayout" name="searchLayout">
- <property name="spacing">
- <number>0</number>
- </property>
<item>
- <widget class="QLineEdit" name="searchStringEdit">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="minimumSize">
- <size>
- <width>150</width>
- <height>16</height>
- </size>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
</property>
- <property name="maximumSize">
+ <property name="sizeHint" stdset="0">
<size>
- <width>500</width>
- <height>16777215</height>
+ <width>13</width>
+ <height>20</height>
</size>
</property>
- <property name="toolTip">
- <string>Enter a color name to search</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignmentFlag::AlignCenter</set>
- </property>
- <property name="placeholderText">
- <string>Search color</string>
- </property>
- <property name="clearButtonEnabled">
- <bool>true</bool>
- </property>
- </widget>
+ </spacer>
</item>
<item>
- <widget class="QToolButton" name="findPreviousPB">
+ <widget class="QToolButton" name="colorResetPB">
<property name="toolTip">
- <string>Search backward</string>
+ <string>Revert selected to theme colors</string>
</property>
<property name="text">
- <string>Pr&evious</string>
+ <string>Re&set</string>
</property>
<property name="iconSize">
<size>
@@ -291,18 +361,12 @@
</widget>
</item>
<item>
- <widget class="QToolButton" name="findNextPB">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
+ <widget class="QToolButton" name="colorResetAllPB">
<property name="toolTip">
- <string>Search forward</string>
+ <string>Reset all colors to theme</string>
</property>
<property name="text">
- <string>&Next</string>
+ <string>Reset A&ll</string>
</property>
<property name="iconSize">
<size>
@@ -310,113 +374,10 @@
<height>16</height>
</size>
</property>
- <property name="shortcut">
- <string>Ctrl+S</string>
- </property>
</widget>
</item>
</layout>
</item>
- <item row="0" column="5">
- <spacer name="hsTitleRight">
- <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 row="1" column="1" rowspan="2" colspan="5">
- <widget class="QTableWidget" name="colorsTW">
- <property name="font">
- <font>
- <family>.AppleSystemUIFont</family>
- </font>
- </property>
- <property name="iconSize">
- <size>
- <width>32</width>
- <height>16</height>
- </size>
- </property>
- <property name="showGrid">
- <bool>false</bool>
- </property>
- <property name="sortingEnabled">
- <bool>true</bool>
- </property>
- <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">
- <widget class="QLabel" name="colorLabel">
- <property name="text">
- <string>&Color Settings:</string>
- </property>
- <property name="alignment">
-
<set>Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft</set>
- </property>
- <property name="buddy">
- <cstring>colorsTW</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="themesLabel">
- <property name="text">
- <string>&Themes:</string>
- </property>
- <property name="alignment">
-
<set>Qt::AlignmentFlag::AlignBottom|Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft</set>
- </property>
- <property name="buddy">
- <cstring>themesLW</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <spacer name="horizontalSpacer_3">
- <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>
</item>
</layout>
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs