MarianArlt / kde-plasmoid-betterinlineclock

Your usual clock widget, just way better and on a single line!
https://www.opendesktop.org/p/1245902
GNU General Public License v3.0
20 stars 14 forks source link

Sometimes the width is not enough #8

Closed trmdi closed 4 years ago

trmdi commented 4 years ago

Please see the screenshot, look at the "M" in "AM":

image

Reload the applet fixes it. I guess the width is a fixed value which is calculated when the applet starts.

qiaojunfeng commented 4 years ago

Me too, it has the same issue on my machine.

qiaojunfeng commented 4 years ago

I found a way to fix this: In my machine, the plasmoid is installed at ~/.local/share/plasma/plasmoids/org.kde.plasma.chiliclock/ Change the file ~.local/share/plasma/plasmoids/org.kde.plasma.chiliclock/contents/ui/DigitalClock.qml line 164

width: !use24hFormat || use24hFormat === Qt.PartiallyChecked ? sizehelper.contentWidth - separator.paintedWidth : sizehelper.contentWidth

to

width: sizehelper.contentWidth

can temporarily fix this. (also need a relogin to make it take effect)

It seems that the width of the plasmoid is calculated for a time such as 1:48 PM but not for 10:48 PM, so if an hour has 2 digits then it will exceed the width of the plasmoid.

I don't have experience in writing plasmoid so this is certainly not a good fix. Maybe it's better to add an option to manually assign the width of the plasmoid.