Closed adelq closed 4 years ago
When I tried the fix from @qiaojunfeng , times with two digits for the hour looked fine, but times with one digit for the hour had too much space on the right.
Yes, I've noticed that there is more padding on the right with 1 digit for the hour as well, but without the fix, the text PM/AM is clipped on the right with 2 digits for the hour.
This has been bugging me as well. I don't know anything about qml or plasmoids either, but I tried a little tinkering. I changed the "new" line 164 from
width: sizehelper.contentWidth
to
width: timeLabel.paintedWidth
This seems to push the widgets to the left of the clock "away" while maintaining the margin on the right and left. I checked both gnome and xfce and the behavior of widgets to the left of the clock being pushed away seems to be the expected behavior. Here is a visual of my "fix" on my desktop.
@MITHX I tested your change and it works perfectly. I've updated the pull request with your suggestion. Thanks!
Thank you very much for looking into this. I didn't have the time yet to do so, although being a small thing. Sorry everyone for taking so long. Merged now and soon to be published.
In many configurations, the clock width is not sufficient with the current method of calculating out the appropriate widget width, so the right side of the plasmoid is clipped as in issue #8. I have tried the suggestion in the reply by @qiaojunfeng and it works perfectly as far as I can tell with less complexity in the size calculations. I am also not experienced in plasmoid development, so would like to hear why this code was there initially and if this is the appropriate fix for the bug without introducing new bugs.
Fixes #8