Fix automatic resizing of articles; re-instate custom font sizes

This commit is contained in:
Bart De Vries 2021-04-27 22:08:19 +02:00
parent 9ebc6ecb7e
commit 943b66207b
2 changed files with 29 additions and 2 deletions

View File

@ -53,7 +53,7 @@ Kirigami.ScrollablePage {
} }
Controls.Label { Controls.Label {
id: text id: textLabel
Layout.margins: Kirigami.Units.gridUnit Layout.margins: Kirigami.Units.gridUnit
text: page.entry.content text: page.entry.content
baseUrl: page.entry.baseUrl baseUrl: page.entry.baseUrl
@ -62,7 +62,8 @@ Kirigami.ScrollablePage {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
//onWidthChanged: { text = entry.adjustedContent(width, font.pixelSize) } onWidthChanged: { text = entry.adjustedContent(width, font.pixelSize) }
font.pointSize: SettingsManager && !(SettingsManager.articleFontUseSystem) ? SettingsManager.articleFontSize : Kirigami.Units.fontMetrics.font.pointSize
} }
} }

View File

@ -38,6 +38,7 @@ Kirigami.ScrollablePage {
} }
} }
// TODO: implement this
/*Controls.CheckBox { /*Controls.CheckBox {
id: autoDownload id: autoDownload
checked: SettingsManager.autoDownload checked: SettingsManager.autoDownload
@ -47,5 +48,30 @@ Kirigami.ScrollablePage {
onToggled: SettingsManager.autoDownload = checked onToggled: SettingsManager.autoDownload = checked
}*/ }*/
Kirigami.Heading {
Kirigami.FormData.isSection: true
text: i18n("Article")
}
Controls.SpinBox {
id: articleFontSizeSpinBox
enabled: !useSystemFontCheckBox.checked
value: SettingsManager.articleFontSize
Kirigami.FormData.label: i18n("Font size:")
from: 6
to: 20
onValueModified: SettingsManager.articleFontSize = value
}
Controls.CheckBox {
id: useSystemFontCheckBox
checked: SettingsManager.articleFontUseSystem
text: i18n("Use system default")
onToggled: SettingsManager.articleFontUseSystem = checked
}
} }
} }