Commit f96c1058 authored by Nate Graham's avatar Nate Graham 🔩

[kcms/fonts] Guide users towards KScreen KCM for making things bigger on-screen

Summary:
Many users seem to like using {nav Force Fonts DPI} or (less commonly) the font sizes to
increase the scale of UI elememnts to suit their screen. This is not the recommended
approach, and we are constantly telling users this in bug reports and social media, but
there's nothing in the UI itself to make people aware of that in the first place.

This patch is an attempt to rectify that by showing gentle informational messages guiding
users towards the KScreen KCM if they adjust settings on the Fonts KCM in a way that
suggests they are trying to make everything bigger.

Test Plan: {F8252619}

Reviewers: #vdg, #plasma, cblack, bport

Reviewed By: #vdg, #plasma, cblack

Subscribers: romangg, ahmadsamir, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D29080
parent 731b014c
......@@ -225,8 +225,6 @@ void KFonts::save()
KGlobalSettings::self()->emitChange(KGlobalSettings::FontChanged);
runRdb(KRdbExportXftSettings | KRdbExportGtkTheme);
emit fontsHaveChanged();
}
void KFonts::adjustFont(const QFont &font, const QString &category)
......@@ -249,6 +247,7 @@ void KFonts::adjustFont(const QFont &font, const QString &category)
m_settings->setFixed(selFont);
}
}
emit fontsHaveChanged();
}
void KFonts::adjustAllFonts()
......
......@@ -74,6 +74,7 @@ Q_SIGNALS:
void hintingCurrentIndexChanged();
void subPixelCurrentIndexChanged();
void aliasingChangeApplied();
void fontDpiSettingsChanged();
private:
QFont applyFontDiff(const QFont &fnt, const QFont &newFont, int fontDiffFlags);
......
......@@ -22,6 +22,9 @@ import QtQuick 2.1
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0 as QtControls
import QtQuick.Dialogs 1.2 as QtDialogs
// For KCMShell.open()
import org.kde.kquickcontrolsaddons 2.0
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kcm 1.1 as KCM
......@@ -30,6 +33,13 @@ KCM.SimpleKCM {
KCM.ConfigModule.quickHelp: i18n("This module lets you configure the system fonts.")
property var kscreenAction: Kirigami.Action {
visible: KCMShell.authorize("kcm_kscreen.desktop").length > 0
text: i18n("Change Display Scaling...")
iconName: "preferences-desktop-display"
onTriggered: KCMShell.open("kcm_kscreen.desktop")
}
ColumnLayout {
Kirigami.InlineMessage {
......@@ -44,6 +54,38 @@ KCM.SimpleKCM {
}
}
Kirigami.InlineMessage {
id: hugeFontsMessage
Layout.fillWidth: true
showCloseButton: true
text: i18n("Very large fonts may produce odd-looking results. Consider adjusting the global screen scale instead of using a very large font size.")
Connections {
target: kcm
onFontsHaveChanged: {
if (generalFontWidget.font.pointSize > 14
|| fixedWidthFontWidget.font.pointSize > 14
|| smallFontWidget.font.pointSize > 14
|| toolbarFontWidget.font.pointSize > 14
|| menuFontWidget.font.pointSize > 18) {
hugeFontsMessage.visible = true
} else {
hugeFontsMessage.visible = false
}
}
}
actions: [ kscreenAction ]
}
Kirigami.InlineMessage {
id: dpiTwiddledMessage
Layout.fillWidth: true
showCloseButton: true
text: i18n("The recommended way to scale the user interface is using the global screen scaling feature.")
actions: [ kscreenAction ]
}
Kirigami.FormLayout {
id: formLayout
readonly property int maxImplicitWidth: Math.max(adjustAllFontsButton.implicitWidth, excludeField.implicitWidth, subPixelCombo.implicitWidth, hintingCombo.implicitWidth)
......@@ -71,24 +113,28 @@ KCM.SimpleKCM {
enabled: !kcm.fontsSettings.isImmutable("font")
}
FontWidget {
id: fixedWidthFontWidget
label: i18n("Fixed width:")
category: "fixed"
font: kcm.fontsSettings.fixed
enabled: !kcm.fontsSettings.isImmutable("fixed")
}
FontWidget {
id: smallFontWidget
label: i18n("Small:")
category: "smallestReadableFont"
font: kcm.fontsSettings.smallestReadableFont
enabled: !kcm.fontsSettings.isImmutable("smallestReadableFont")
}
FontWidget {
id: toolbarFontWidget
label: i18n("Toolbar:")
category: "toolBarFont"
font: kcm.fontsSettings.toolBarFont
enabled: !kcm.fontsSettings.isImmutable("toolBarFont")
}
FontWidget {
id: menuFontWidget
label: i18n("Menu:")
category: "menuFont"
font: kcm.fontsSettings.menuFont
......@@ -241,7 +287,10 @@ KCM.SimpleKCM {
id: dpiCheckBox
checked: kcm.fontsAASettings.dpi !== 0
text: i18n("Force font DPI:")
onClicked: kcm.fontsAASettings.dpi = (checked ? dpiSpinBox.value : 0)
onClicked: {
kcm.fontsAASettings.dpi = checked ? dpiSpinBox.value : 0
dpiTwiddledMessage.visible = checked
}
}
QtControls.SpinBox {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment