Use trailing components in form

This commit is contained in:
Devin Lin 2022-11-26 18:32:23 -05:00 committed by Bart De Vries
parent 6c8d0fa404
commit 4db4664db3
2 changed files with 46 additions and 95 deletions

View File

@ -181,16 +181,13 @@ Kirigami.ScrollablePage {
}
RowLayout {
Layout.fillWidth: true
MobileForm.FormRadioDelegate {
id: markCustomUnreadNumberButton
checked: SettingsManager.markUnreadOnNewFeed === 1
text: i18n("Mark most recent episodes as unplayed")
onToggled: SettingsManager.markUnreadOnNewFeed = 1
}
Controls.SpinBox {
trailing: Controls.SpinBox {
Layout.rightMargin: Kirigami.Units.gridUnit
id: markCustomUnreadNumberSpinBox
enabled: markCustomUnreadNumberButton.checked
@ -221,17 +218,11 @@ Kirigami.ScrollablePage {
title: i18n("Article")
}
MobileForm.AbstractFormDelegate {
MobileForm.FormTextDelegate {
id: fontSize
background: Item {}
contentItem: RowLayout {
Controls.Label {
Layout.fillWidth: true
text: i18n("Font size")
}
Controls.SpinBox {
trailing: Controls.SpinBox {
id: articleFontSizeSpinBox
enabled: !useSystemFontCheckBox.checked
@ -243,7 +234,6 @@ Kirigami.ScrollablePage {
onValueModified: SettingsManager.articleFontSize = value
}
}
}
MobileForm.FormDelegateSeparator { above: fontSize; below: useSystemFontCheckBox }
@ -268,21 +258,14 @@ Kirigami.ScrollablePage {
title: i18n("Errors")
}
MobileForm.AbstractFormDelegate {
background: Item {}
contentItem: RowLayout {
Controls.Label {
Layout.fillWidth: true
MobileForm.FormTextDelegate {
text: i18n("Error log")
}
Controls.Button {
trailing: Controls.Button {
icon.name: "error"
text: i18n("Open Log")
onClicked: settingsErrorOverlay.open()
}
}
}
ErrorListOverlay {
id: settingsErrorOverlay

View File

@ -41,35 +41,20 @@ Kirigami.ScrollablePage {
title: i18n("Storage path")
}
MobileForm.AbstractFormDelegate {
MobileForm.FormTextDelegate {
id: storagePath
visible: Qt.platform.os !== "android" // not functional on android
background: Item {}
contentItem: RowLayout {
spacing: 0
ColumnLayout {
spacing: Kirigami.Units.smallSpacing
Controls.Label {
Layout.fillWidth: true
elide: Text.ElideRight
text: i18n("Storage path")
}
Controls.Label {
Layout.fillWidth: true
elide: Text.ElideRight
color: Kirigami.Theme.disabledTextColor
text: StorageManager.storagePath
}
}
description: StorageManager.storagePath
Controls.Button {
trailing: Controls.Button {
Layout.leftMargin: Kirigami.Units.largeSpacing
icon.name: "document-open-folder"
text: i18n("Select folder...")
enabled: !defaultStoragePath.checked
onClicked: storagePathDialog.open()
}
FileDialog {
id: storagePathDialog
title: i18n("Select Storage Path")
@ -80,7 +65,6 @@ Kirigami.ScrollablePage {
}
}
}
}
MobileForm.FormDelegateSeparator { above: storagePath; below: defaultStoragePath }
@ -116,26 +100,11 @@ Kirigami.ScrollablePage {
MobileForm.FormDelegateSeparator {}
MobileForm.AbstractFormDelegate {
background: Item {}
contentItem: RowLayout {
spacing: Kirigami.Units.largeSpacing
ColumnLayout {
spacing: Kirigami.Units.smallSpacing
Controls.Label {
Layout.fillWidth: true
elide: Text.ElideRight
MobileForm.FormTextDelegate {
text: i18n("Image cache")
}
Controls.Label {
Layout.fillWidth: true
elide: Text.ElideRight
color: Kirigami.Theme.disabledTextColor
text: i18nc("Using <amount of bytes> of disk space", "Using %1 of disk space", StorageManager.formattedImageDirSize)
}
}
description: i18nc("Using <amount of bytes> of disk space", "Using %1 of disk space", StorageManager.formattedImageDirSize)
Controls.Button {
trailing: Controls.Button {
icon.name: "edit-clear-all"
text: i18n("Clear Cache")
onClicked: StorageManager.clearImageCache();
@ -144,5 +113,4 @@ Kirigami.ScrollablePage {
}
}
}
}
}