Skip to content

Commit 0b69fea

Browse files
committed
settings: restore lost geometric centering option
port 1.5
1 parent 494144a commit 0b69fea

1 file changed

Lines changed: 64 additions & 12 deletions

File tree

quickshell/Modules/Settings/WidgetsTabSection.qml

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,22 +181,74 @@ Column {
181181
height: implicitHeight
182182
spacing: Theme.spacingM
183183

184-
Row {
185-
spacing: Theme.spacingM
186-
187-
DankIcon {
188-
name: root.titleIcon
189-
size: Theme.iconSize
190-
color: Theme.primary
184+
Item {
185+
width: parent.width
186+
height: Math.max(headerRow.implicitHeight, centeringModeRow.implicitHeight)
187+
LayoutMirroring.enabled: I18n.isRtl
188+
LayoutMirroring.childrenInherit: true
189+
190+
Row {
191+
id: headerRow
192+
spacing: Theme.spacingM
193+
anchors.left: parent.left
191194
anchors.verticalCenter: parent.verticalCenter
195+
196+
DankIcon {
197+
name: root.titleIcon
198+
size: Theme.iconSize
199+
color: Theme.primary
200+
anchors.verticalCenter: parent.verticalCenter
201+
}
202+
203+
StyledText {
204+
text: root.title
205+
font.pixelSize: Theme.fontSizeLarge
206+
font.weight: Font.Medium
207+
color: Theme.surfaceText
208+
anchors.verticalCenter: parent.verticalCenter
209+
}
192210
}
193211

194-
StyledText {
195-
text: root.title
196-
font.pixelSize: Theme.fontSizeLarge
197-
font.weight: Font.Medium
198-
color: Theme.surfaceText
212+
Row {
213+
id: centeringModeRow
214+
spacing: Theme.spacingXS
215+
anchors.right: parent.right
199216
anchors.verticalCenter: parent.verticalCenter
217+
visible: root.sectionId === "center"
218+
219+
DankActionButton {
220+
id: indexCenterButton
221+
buttonSize: 28
222+
iconName: "format_list_numbered"
223+
iconSize: 16
224+
iconColor: SettingsData.centeringMode === "index" ? Theme.primary : Theme.outline
225+
onClicked: {
226+
SettingsData.set("centeringMode", "index");
227+
}
228+
onEntered: {
229+
sharedTooltip.show(I18n.tr("Index Centering"), indexCenterButton, 0, 0, "bottom");
230+
}
231+
onExited: {
232+
sharedTooltip.hide();
233+
}
234+
}
235+
236+
DankActionButton {
237+
id: geometricCenterButton
238+
buttonSize: 28
239+
iconName: "center_focus_weak"
240+
iconSize: 16
241+
iconColor: SettingsData.centeringMode === "geometric" ? Theme.primary : Theme.outline
242+
onClicked: {
243+
SettingsData.set("centeringMode", "geometric");
244+
}
245+
onEntered: {
246+
sharedTooltip.show(I18n.tr("Geometric Centering"), geometricCenterButton, 0, 0, "bottom");
247+
}
248+
onExited: {
249+
sharedTooltip.hide();
250+
}
251+
}
200252
}
201253
}
202254

0 commit comments

Comments
 (0)