Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Font scale' option #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package/contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<entry name="updateInterval" type="Double">
<default>1.0</default>
</entry>
<entry name="fontScale" type="int">
<default>30</default>
</entry>
<entry name="showCpuMonitor" type="Bool">
<default>true</default>
</entry>
Expand Down
13 changes: 13 additions & 0 deletions package/contents/ui/config/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ 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
property double parentWidth: parent === null ? 0 : parent.width
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')
Expand Down