qt_gui: Organize settings page (#1316)

* Wire up translations and descriptions for the cursor settings.
* Move controller settings to input tab and rename it to controller (to inline it with how other settings are shown).
* Fixed unnecessary double initialization of the back button setting.
* Organize statements and functions w/ respect to their tabs and some minor QOL changes for the settings UI in general.
This commit is contained in:
Exhigh 2024-10-10 18:52:39 +04:00 committed by GitHub
parent 299a29e243
commit 87f8f3a59e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 499 additions and 242 deletions

View file

@ -274,6 +274,9 @@
<layout class="QHBoxLayout" name="generalTabHLayout_2">
<item>
<layout class="QVBoxLayout" name="updaterTabLayoutLeft">
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
</property>
<property name="leftMargin">
<number>0</number>
</property>
@ -286,8 +289,157 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<item alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QGroupBox" name="updaterGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>275</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="title">
<string>Update</string>
</property>
<layout class="QVBoxLayout" name="UpdateLayout" stretch="0,0,0">
<property name="spacing">
<number>5</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>11</number>
</property>
<property name="bottomMargin">
<number>11</number>
</property>
<item>
<widget class="QGroupBox" name="updaterComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>75</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="title">
<string>Update Channel</string>
</property>
<layout class="QVBoxLayout" name="UpdateChannelLayout">
<property name="spacing">
<number>7</number>
</property>
<property name="leftMargin">
<number>11</number>
</property>
<property name="topMargin">
<number>11</number>
</property>
<property name="rightMargin">
<number>11</number>
</property>
<property name="bottomMargin">
<number>11</number>
</property>
<item>
<widget class="QComboBox" name="updateComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Release</string>
</property>
</item>
<item>
<property name="text">
<string>Nightly</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="checkUpdateButton">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>197</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Check for Updates</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="updateCheckBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Check for Updates at Startup</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="GUITabLayoutMiddle" stretch="0">
<item alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QGroupBox" name="GUIgroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -296,204 +448,141 @@
</property>
<property name="minimumSize">
<size>
<width>265</width>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Update</string>
</property>
<widget class="QCheckBox" name="updateCheckBox">
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>261</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Check for Updates at Startup</string>
</property>
</widget>
<widget class="QGroupBox" name="updaterComboBox">
<property name="geometry">
<rect>
<x>12</x>
<y>30</y>
<width>241</width>
<height>65</height>
</rect>
</property>
<property name="title">
<string>Update Channel</string>
</property>
<widget class="QComboBox" name="updateComboBox">
<property name="geometry">
<rect>
<x>12</x>
<y>30</y>
<width>217</width>
<height>28</height>
</rect>
</property>
<item>
<property name="text">
<string>Release</string>
</property>
</item>
<item>
<property name="text">
<string>Nightly</string>
</property>
</item>
</widget>
</widget>
<widget class="QPushButton" name="checkUpdateButton">
<property name="geometry">
<rect>
<x>25</x>
<y>100</y>
<width>215</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>Check for Updates</string>
</property>
</widget>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="GUITabLayoutMiddle" stretch="1">
<item>
<widget class="QGroupBox" name="GUIgroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>GUI Settings</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget_3">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>241</width>
<height>92</height>
</rect>
<layout class="QVBoxLayout" name="GUILayout">
<property name="topMargin">
<number>1</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="playBGMCheckBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Play title music</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Volume</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="BGMVolumeSlider">
<property name="toolTip">
<string>Set the volume of the background music.</string>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="pageStep">
<number>20</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="invertedControls">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::TickPosition::NoTicks</enum>
</property>
<property name="tickInterval">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<property name="bottomMargin">
<number>11</number>
</property>
<item>
<layout class="QVBoxLayout" name="GUIMusicLayout">
<property name="topMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="playBGMCheckBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Play title music</string>
</property>
</widget>
</item>
<item>
<spacer name="GUIverticalSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>2</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Volume</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="BGMVolumeSlider">
<property name="toolTip">
<string>Set the volume of the background music.</string>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="pageStep">
<number>20</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="invertedControls">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::TickPosition::NoTicks</enum>
</property>
<property name="tickInterval">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="GUIwidgetSpacer" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>61</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="ControllerTabLayoutRight" stretch="1">
<layout class="QVBoxLayout" name="EmptyTabLayoutRight">
<item>
<widget class="QGroupBox" name="ControllerGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<spacer name="emptyHorizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="title">
<string>Controller Settings</string>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
<widget class="QGroupBox" name="backButtonBehaviorGroupBox">
<property name="geometry">
<rect>
<x>12</x>
<y>30</y>
<width>241</width>
<height>65</height>
</rect>
</property>
<property name="title">
<string>Back Button Behavior</string>
</property>
<widget class="QComboBox" name="backButtonBehaviorComboBox">
<property name="geometry">
<rect>
<x>12</x>
<y>30</y>
<width>217</width>
<height>28</height>
</rect>
</property>
</widget>
</widget>
</widget>
</spacer>
</item>
</layout>
</item>
@ -510,18 +599,48 @@
<layout class="QHBoxLayout" name="inputTabHLayoutTop" stretch="1,1,1">
<item>
<layout class="QVBoxLayout" name="cursorTabLayoutLeft">
<item>
<widget class="QGroupBox" name="HideCursor">
<property name="spacing">
<number>7</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QGroupBox" name="cursorGroupBox">
<property name="title">
<string>Cursor</string>
</property>
<layout class="QVBoxLayout" name="inputCursorLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="topMargin">
<number>11</number>
</property>
<property name="bottomMargin">
<number>11</number>
</property>
<item>
<widget class="QGroupBox" name="hideCursorGroupBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Hide Cursor</string>
</property>
<layout class="QVBoxLayout" name="hideCursorLayout">
<property name="spacing">
<number>7</number>
</property>
<property name="bottomMargin">
<number>11</number>
</property>
<item>
<widget class="QComboBox" name="hideCursorComboBox"/>
</item>
@ -533,10 +652,16 @@
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>85</height>
<height>0</height>
</size>
</property>
<property name="title">
@ -549,19 +674,28 @@
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="IdleTimeoutLayout" stretch="0,0">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>70</number>
</property>
<property name="topMargin">
<number>11</number>
<number>5</number>
</property>
<item>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<number>5</number>
</property>
<item alignment="Qt::AlignmentFlag::AlignHCenter">
<widget class="QSpinBox" name="idleTimeoutSpinBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -620,26 +754,80 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="emptyTabLayoutMiddle">
<layout class="QVBoxLayout" name="ControllerTabLayoutMiddle">
<item>
<spacer name="emptyHorizontalSpacerMiddle">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
<widget class="QGroupBox" name="ControllerGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
<property name="title">
<string>Controller</string>
</property>
</spacer>
<layout class="QVBoxLayout" name="ControllerLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="topMargin">
<number>11</number>
</property>
<property name="bottomMargin">
<number>11</number>
</property>
<item>
<widget class="QGroupBox" name="backButtonBehaviorGroupBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>237</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Back Button Behavior</string>
</property>
<layout class="QVBoxLayout" name="BackButtonLayout">
<property name="leftMargin">
<number>11</number>
</property>
<item>
<widget class="QComboBox" name="backButtonBehaviorComboBox"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="controllerWidgetSpacer" native="true">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="emptyTabLayoutRight">
<item>
<spacer name="emptyHorizontalSpacerRight">
<spacer name="emptyhorizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>