kcms/fonts: show warning when user tries to set a non-integer font size

It triggers https://bugreports.qt.io/browse/QTBUG-92006, and we need to
warn users about that.

CCBUG: 432372
wilder-5.25
Nate Graham 4 years ago
parent 0cce4af290
commit 9d0a71d7e5
  1. 23
      kcms/fonts/package/contents/ui/main.qml

@ -64,6 +64,29 @@ KCM.SimpleKCM {
actions: [ kscreenAction ]
}
Kirigami.InlineMessage {
id: fractionalFontSizeWarning
Layout.fillWidth: true
showCloseButton: true
type: Kirigami.MessageType.Warning
text: i18n("Decimal font sizes can cause text layout problems in some applications. Consider using only integer font sizes.")
// Specifically, it will trigger https://bugreports.qt.io/browse/QTBUG-92006,
// but we don't mention that in the message because that would be too technical
// for users.
Connections {
target: kcm
function onFontsHaveChanged() {
fractionalFontSizeWarning.visible =
!Number.isInteger(generalFontWidget.font.pointSize)
|| !Number.isInteger(fixedWidthFontWidget.font.pointSize)
|| !Number.isInteger(smallFontWidget.font.pointSize)
|| !Number.isInteger(toolbarFontWidget.font.pointSize)
|| !Number.isInteger(menuFontWidget.font.pointSize)
}
}
}
Kirigami.InlineMessage {
id: dpiTwiddledMessage
Layout.fillWidth: true

Loading…
Cancel
Save