@@ -17,25 +17,26 @@ SettingsContentBase {
1717
1818 required property int theme // Theme.Style.xxx
1919 required property int fontSize // Theme.FontSize.xxx
20+ required property int paddingFactor // Theme.PaddingFactor.xxx
2021
2122 signal themeChangeRequested (int theme)
2223 signal fontSizeChangeRequested (int fontSize)
24+ signal paddingFactorChangeRequested (int paddingFactor)
2325
24- Item {
26+ content : ColumnLayout {
2527 id: appearanceContainer
26- anchors .left : !! parent ? parent .left : undefined
27- anchors .leftMargin : Theme .padding
28+
2829 width: root .contentWidth - 2 * Theme .padding
29- height : childrenRect . height
30+ spacing : Theme . padding
3031
3132 Rectangle {
3233 id: preview
33- anchors . top : parent . top
34- anchors . left : parent . left
35- anchors .right : parent . right
36- height : placeholderMessage .implicitHeight +
37- placeholderMessage . anchors . leftMargin +
38- placeholderMessage . anchors . rightMargin
34+
35+ Layout . preferredHeight : placeholderMessage . implicitHeight +
36+ placeholderMessage . anchors .leftMargin +
37+ placeholderMessage .anchors . rightMargin
38+ Layout . fillWidth : true
39+
3940 radius: Theme .radius
4041 border .color : Theme .palette .border
4142 color: Theme .palette .transparent
@@ -45,7 +46,8 @@ SettingsContentBase {
4546 anchors .top : parent .top
4647 anchors .left : parent .left
4748 anchors .right : parent .right
48- anchors .margins : Theme .smallPadding
49+ anchors .margins : Theme .padding
50+
4951 isMessage: true
5052 shouldRepeatHeader: true
5153 messageTimestamp: Date .now ()
@@ -60,17 +62,14 @@ SettingsContentBase {
6062 StatusSectionHeadline {
6163 id: sectionHeadlineFontSize
6264 text: qsTr (" Text size" )
63- anchors .top : preview .bottom
64- anchors .topMargin : Theme .bigPadding * 2
65- anchors .left : parent .left
66- anchors .right : parent .right
65+ Layout .topMargin : 2 * Theme .padding
6766 }
6867
6968 StatusQ .StatusLabeledSlider {
7069 id: fontSizeSlider
71- anchors . top : sectionHeadlineFontSize . bottom
72- anchors . topMargin : Theme .padding
73- width : parent . width
70+ Layout . fillWidth : true
71+ Layout . leftMargin : Theme .smallPadding
72+ Layout . rightMargin : Layout . leftMargin
7473
7574 textRole: " name"
7675 valueRole: " value"
@@ -88,36 +87,51 @@ SettingsContentBase {
8887 onMoved: root .fontSizeChangeRequested (value)
8988 }
9089
90+ StatusSectionHeadline {
91+ text: qsTr (" Padding factor" )
92+ Layout .topMargin : 2 * Theme .padding
93+ }
94+
95+ StatusQ .StatusLabeledSlider {
96+ Layout .fillWidth : true
97+ Layout .leftMargin : Theme .smallPadding
98+ Layout .rightMargin : Layout .leftMargin
99+
100+ textRole: " name"
101+ valueRole: " value"
102+ model: ListModel {
103+ ListElement { name: qsTr (" XXS" ); value: Theme .PaddingFactor .PaddingXXS }
104+ ListElement { name: qsTr (" XS" ); value: Theme .PaddingFactor .PaddingXS }
105+ ListElement { name: qsTr (" S" ); value: Theme .PaddingFactor .PaddingS }
106+ ListElement { name: qsTr (" M" ); value: Theme .PaddingFactor .PaddingM }
107+ ListElement { name: qsTr (" L" ); value: Theme .PaddingFactor .PaddingL }
108+ }
109+
110+ value: root .paddingFactor
111+
112+ onMoved: root .paddingFactorChangeRequested (value)
113+ }
114+
91115 Rectangle {
92- id: modeSeparator
93- anchors .top : fontSizeSlider .bottom
94- anchors .topMargin : Theme .padding * 3
95- anchors .left : parent .left
96- anchors .right : parent .right
97- height: 1
116+ Layout .topMargin : Theme .xlPadding
117+ Layout .preferredHeight : 1
118+ Layout .fillWidth : true
98119 color: Theme .palette .separator
99120 }
100121
101122 StatusSectionHeadline {
102- id: sectionHeadlineAppearance
103123 text: qsTr (" Mode" )
104- anchors .top : modeSeparator .bottom
105- anchors .topMargin : Theme .padding * 3
106- anchors .left : parent .left
107- anchors .right : parent .right
124+ Layout .topMargin : Theme .xlPadding
108125 }
109126
110127 RowLayout {
111- id: appearanceSection
112- anchors .top : sectionHeadlineAppearance .bottom
113- anchors .topMargin : Theme .padding
114- anchors .left : parent .left
115- anchors .right : parent .right
128+ id: modeRow
129+
130+ Layout .fillWidth : true
116131 spacing: Theme .halfPadding
117132
118133 StatusImageRadioButton {
119- Layout .preferredWidth : parent .width / 3 - parent .spacing
120- Layout .preferredHeight : implicitHeight
134+ Layout .fillWidth : true
121135 image .source : Theme .png (" appearance-light" )
122136 control .text : qsTr (" Light" )
123137 control .checked : root .theme === Theme .Style .Light
@@ -129,7 +143,7 @@ SettingsContentBase {
129143 }
130144
131145 StatusImageRadioButton {
132- Layout .preferredWidth : parent . width / 3 - parent . spacing
146+ Layout .fillWidth : true
133147 image .source : Theme .png (" appearance-dark" )
134148 control .text : qsTr (" Dark" )
135149 control .checked : root .theme === Theme .Style .Dark
@@ -141,7 +155,7 @@ SettingsContentBase {
141155 }
142156
143157 StatusImageRadioButton {
144- Layout .preferredWidth : parent . width / 3 - parent . spacing
158+ Layout .fillWidth : true
145159 image .source : Theme .png (" appearance-system" )
146160 control .text : qsTr (" System" )
147161 control .checked : root .theme === Theme .Style .System
0 commit comments