From 90ea27f49c84f0dffbbf79b29eaa14c57f31a24d Mon Sep 17 00:00:00 2001 From: Diego Gangl Date: Sun, 17 Dec 2017 12:18:11 +0100 Subject: [PATCH] [Digital Clock] Use a smaller font size in horizontal panel mode This patch makes the digital clock use a smaller font when used in a horizontal form factor. BUG:375969 Test Plan: Play with the widget settings in different panels/desktop Reviewers: #plasma, #vdg, romangg Reviewed By: #plasma, romangg Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D6764 --- .../digital-clock/package/contents/ui/DigitalClock.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/applets/digital-clock/package/contents/ui/DigitalClock.qml b/applets/digital-clock/package/contents/ui/DigitalClock.qml index 4bc28cd0c..1362fe758 100644 --- a/applets/digital-clock/package/contents/ui/DigitalClock.qml +++ b/applets/digital-clock/package/contents/ui/DigitalClock.qml @@ -155,7 +155,15 @@ Item { PropertyChanges { target: sizehelper - height: Math.min(main.showDate || timezoneLabel.visible ? 0.56 * main.height : main.height, 3 * theme.defaultFont.pixelSize) + /* + * The value 0.71 was picked by testing to give the clock the right + * size (aligned with tray icons). + * Value 0.56 seems to be chosen rather arbitrary as well such that + * the time label is slightly larger than the date or timezone label + * and still fits well into the panel with all the applied margins. + */ + height: Math.min(main.showDate || timezoneLabel.visible ? main.height * 0.56 : main.height * 0.71, + 3 * theme.defaultFont.pixelSize) font.pixelSize: sizehelper.height }