Revise Interface section layout in Options dialog

The Language option now has its own layout since it is independent to other options (Style and Color scheme).
This avoids text in Language combobox to be left out and replaced by `...` due to Style Hint text being too long.

PR #22823.
This commit is contained in:
Chocobo1 2025-06-08 17:15:42 +08:00 committed by GitHub
parent 4132173b30
commit 8aa1a96d71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 88 additions and 74 deletions

View file

@ -1760,9 +1760,9 @@ void OptionsDialog::initializeStyleCombo()
m_ui->labelStyle->hide(); m_ui->labelStyle->hide();
m_ui->comboStyle->hide(); m_ui->comboStyle->hide();
m_ui->labelStyleHint->hide(); m_ui->labelStyleHint->hide();
m_ui->UISettingsBoxLayout->removeWidget(m_ui->labelStyle); m_ui->layoutStyle->removeWidget(m_ui->labelStyle);
m_ui->UISettingsBoxLayout->removeWidget(m_ui->comboStyle); m_ui->layoutStyle->removeWidget(m_ui->comboStyle);
m_ui->UISettingsBoxLayout->removeWidget(m_ui->labelStyleHint); m_ui->layoutStyle->removeWidget(m_ui->labelStyleHint);
#endif #endif
} }
@ -1776,9 +1776,9 @@ void OptionsDialog::initializeColorSchemeOptions()
#else #else
m_ui->labelColorScheme->hide(); m_ui->labelColorScheme->hide();
m_ui->comboColorScheme->hide(); m_ui->comboColorScheme->hide();
m_ui->UISettingsBoxLayout->removeWidget(m_ui->labelColorScheme); m_ui->layoutStyle->removeWidget(m_ui->labelColorScheme);
m_ui->UISettingsBoxLayout->removeWidget(m_ui->comboColorScheme); m_ui->layoutStyle->removeWidget(m_ui->comboColorScheme);
m_ui->UISettingsBoxLayout->removeItem(m_ui->spacerColorScheme); m_ui->layoutStyle->removeItem(m_ui->spacerColorScheme);
#endif #endif
} }

View file

@ -137,8 +137,8 @@
<property name="title"> <property name="title">
<string>Interface</string> <string>Interface</string>
</property> </property>
<layout class="QGridLayout" name="UISettingsBoxLayout"> <layout class="QVBoxLayout" name="UISettingsBoxLayout">
<item row="0" column="0" colspan="3"> <item>
<widget class="QLabel" name="labelRestartRequired"> <widget class="QLabel" name="labelRestartRequired">
<property name="font"> <property name="font">
<font> <font>
@ -150,72 +150,80 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item>
<widget class="QLabel" name="labelLanguage"> <layout class="QHBoxLayout" name="layoutLanguage">
<property name="text"> <item>
<string>Language:</string> <widget class="QLabel" name="labelLanguage">
</property> <property name="text">
</widget> <string>Language:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboLanguage"/>
</item>
<item>
<spacer name="spacerLanguage">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item row="1" column="1"> <item>
<widget class="QComboBox" name="comboLanguage"/> <layout class="QGridLayout" name="layoutStyle">
<item row="0" column="0">
<widget class="QLabel" name="labelStyle">
<property name="text">
<string>Style:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboStyle"/>
</item>
<item row="0" column="2">
<widget class="QLabel" name="labelStyleHint">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelColorScheme">
<property name="text">
<string>Color scheme:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboColorScheme"/>
</item>
<item row="1" column="2">
<spacer name="spacerColorScheme">
<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> </item>
<item row="1" column="2"> <item>
<spacer name="spacerLanguage">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelStyle">
<property name="text">
<string>Style:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboStyle"/>
</item>
<item row="2" column="2">
<widget class="QLabel" name="labelStyleHint">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="labelColorScheme">
<property name="text">
<string>Color scheme:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboColorScheme"/>
</item>
<item row="3" column="2">
<spacer name="spacerColorScheme">
<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="4" column="0" colspan="3">
<widget class="QGroupBox" name="checkUseCustomTheme"> <widget class="QGroupBox" name="checkUseCustomTheme">
<property name="title"> <property name="title">
<string>Use custom UI Theme</string> <string>Use custom UI Theme</string>
@ -237,15 +245,21 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="5" column="0" colspan="2"> <item>
<widget class="QCheckBox" name="checkUseSystemIcon"> <widget class="QCheckBox" name="checkUseSystemIcon">
<property name="text"> <property name="text">
<string>Use icons from system theme</string> <string>Use icons from system theme</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" colspan="2"> <item>
<widget class="QPushButton" name="buttonCustomizeUITheme"> <widget class="QPushButton" name="buttonCustomizeUITheme">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Customize UI Theme...</string> <string>Customize UI Theme...</string>
</property> </property>