From ed474c2d5cf0a5baa3db93b609dcfb0aa68e4666 Mon Sep 17 00:00:00 2001 From: Juan Palacios Date: Wed, 16 May 2018 11:50:44 +0200 Subject: [PATCH] Add 'Font scale' option --- package/contents/config/main.xml | 3 +++ package/contents/ui/config/ConfigGeneral.qml | 13 +++++++++++++ package/contents/ui/main.qml | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/package/contents/config/main.xml b/package/contents/config/main.xml index 7ebdba0..a92a209 100644 --- a/package/contents/config/main.xml +++ b/package/contents/config/main.xml @@ -9,6 +9,9 @@ 1.0 + + 30 + true diff --git a/package/contents/ui/config/ConfigGeneral.qml b/package/contents/ui/config/ConfigGeneral.qml index 3c874ac..aec4201 100644 --- a/package/contents/ui/config/ConfigGeneral.qml +++ b/package/contents/ui/config/ConfigGeneral.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts 1.1 Item { property alias cfg_updateInterval: updateIntervalSpinBox.value + property alias cfg_fontScale: fontScale.value property alias cfg_showCpuMonitor: showCpuMonitor.checked property alias cfg_showClock: showClock.checked property alias cfg_showRamMonitor: showRamMonitor.checked @@ -29,6 +30,18 @@ Item { suffix: i18nc('Abbreviation for seconds', 's') } + Label { + text: i18n('Font scale:') + Layout.alignment: Qt.AlignRight + } + + SpinBox { + id: fontScale + minimumValue: 1 + maximumValue: 100 + suffix: i18nc('Percent', '%') + } + Item { width: 2 height: 10 diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml index 8719720..f3f99b8 100644 --- a/package/contents/ui/main.qml +++ b/package/contents/ui/main.qml @@ -34,6 +34,7 @@ Item { property bool memoryInPercent: plasmoid.configuration.memoryInPercent property bool enableHints: plasmoid.configuration.enableHints property bool enableShadows: plasmoid.configuration.enableShadows + property double fontScale: (plasmoid.configuration.fontScale / 100) property bool showMemoryInPercent: memoryInPercent property int itemMargin: 5 @@ -41,7 +42,7 @@ Item { property double parentHeight: parent === null ? 0 : parent.height property double itemWidth: vertical ? ( verticalLayout ? parentWidth : (parentWidth - itemMargin) / 2 ) : ( verticalLayout ? (parentHeight - itemMargin) / 2 : parentHeight ) property double itemHeight: itemWidth - property double fontPixelSize: itemHeight * 0.26 + property double fontPixelSize: itemHeight * fontScale property int graphGranularity: 20 property color warningColor: Qt.tint(theme.textColor, '#60FF0000')