aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan de Groot <adridg@FreeBSD.org>2021-01-21 22:18:38 +0000
committerAdriaan de Groot <adridg@FreeBSD.org>2021-01-21 22:18:38 +0000
commit49c4cbf3959bee55af08df82743f4919bf207d6d (patch)
tree656b48a0b104f28803df5fcbdebd10760655b948
parentd064ea7a2d300da22186e939e3db953997ce9d96 (diff)
downloadports-49c4cbf3959bee55af08df82743f4919bf207d6d.tar.gz
ports-49c4cbf3959bee55af08df82743f4919bf207d6d.zip
Backport a x11/plasma5-plasma-workspace fix for date-size in vertical panels
If you use a vertical panel, and have the digital clock, and use a date-format with spaces (e.g. anything but ISO format) then the font- size of the date display would blow up after logging in. This patch is already upstream for 5.21, but it annoys me so pull it into our packaging as well.
Notes
Notes: svn path=/head/; revision=562250
-rw-r--r--x11/plasma5-plasma-workspace/Makefile1
-rw-r--r--x11/plasma5-plasma-workspace/files/patch-MR-572.patch59
2 files changed, 60 insertions, 0 deletions
diff --git a/x11/plasma5-plasma-workspace/Makefile b/x11/plasma5-plasma-workspace/Makefile
index 1e5484c4bf90..c2cca872a085 100644
--- a/x11/plasma5-plasma-workspace/Makefile
+++ b/x11/plasma5-plasma-workspace/Makefile
@@ -2,6 +2,7 @@
PORTNAME= plasma-workspace
DISTVERSION= ${KDE_PLASMA_VERSION}
+PORTREVISION= 1
CATEGORIES= x11 kde kde-plasma
MAINTAINER= kde@FreeBSD.org
diff --git a/x11/plasma5-plasma-workspace/files/patch-MR-572.patch b/x11/plasma5-plasma-workspace/files/patch-MR-572.patch
new file mode 100644
index 000000000000..b00435a73b1b
--- /dev/null
+++ b/x11/plasma5-plasma-workspace/files/patch-MR-572.patch
@@ -0,0 +1,59 @@
+diff --git a/applets/digital-clock/package/contents/ui/DigitalClock.qml b/applets/digital-clock/package/contents/ui/DigitalClock.qml
+index 1ff90e0a0b07aa3563c850c736b68da4a4a316a4..e404da522f75f77aedcf45f2255ab34cf133626a 100644
+--- applets/digital-clock/package/contents/ui/DigitalClock.qml
++++ applets/digital-clock/package/contents/ui/DigitalClock.qml
+@@ -152,6 +152,7 @@ Item {
+
+ height: 0.8 * timeLabel.height
+ width: dateLabel.paintedWidth
++ verticalAlignment: Text.AlignVCenter
+
+ font.pixelSize: dateLabel.height
+ }
+@@ -212,6 +213,8 @@ Item {
+ height: timeLabel.height
+ width: dateLabel.paintedWidth
+
++ font.pixelSize: 1024
++ verticalAlignment: Text.AlignVCenter
+ anchors.rightMargin: labelsGrid.columnSpacing
+
+ fontSizeMode: Text.VerticalFit
+@@ -268,7 +271,7 @@ Item {
+ PropertyChanges {
+ target: contentItem
+
+- height: main.showDate ? labelsGrid.height + dateLabel.height : labelsGrid.height
++ height: main.showDate ? labelsGrid.height + dateLabel.contentHeight : labelsGrid.height
+ width: main.width
+ }
+
+@@ -303,9 +306,15 @@ Item {
+ target: dateLabel
+
+ width: main.width
++ //NOTE: in order for Text.Fit to work as intended, the actual height needs to be quite big, in order for the font to enlarge as much it needs for the available width, and then request a sensible height, for which contentHeight will need to be considered as opposed to height
++ height: PlasmaCore.Units.gridUnit * 10
+
+ fontSizeMode: Text.Fit
+- font.minimumPixelSize: Math.max(theme.smallestFont.pixelSize, timeLabel.height)
++ verticalAlignment: Text.AlignTop
++ // Those magic numbers are purely what looks nice as maximum size, here we have it the smallest
++ // between slightly bigger than the default font (1.4 times) and a bit smaller than the time font
++ font.pixelSize: Math.min(0.7 * timeLabel.height, PlasmaCore.Theme.defaultFont.pixelSize * 1.4)
++ font.minimumPixelSize: theme.smallestFont.pixelSize
+ elide: Text.ElideRight
+ wrapMode: Text.WordWrap
+ }
+@@ -374,8 +383,10 @@ Item {
+ PropertyChanges {
+ target: dateLabel
+
+- height: 0.8 * timeLabel.height
++ height: 0.7 * timeLabel.height
++ font.pixelSize: 1024
+ width: Math.max(timeLabel.contentWidth, units.gridUnit * 3)
++ verticalAlignment: Text.AlignVCenter
+
+ fontSizeMode: Text.Fit
+ minimumPixelSize: 1