tjaart / plasma-fancy-clock

A fancy clock widget for KDE Plasma 5
GNU General Public License v2.0
10 stars 4 forks source link

Widget borders are too large #6

Open efermi opened 7 years ago

efermi commented 7 years ago

I want to make the font bigger, but it is only possible by resizing it horizontally, so I've ran out of the screen space and cannot make it bigger than that. The occupied space is wasted on borders (or is it padding?). It should occupy as little of the screen space as possible. screenshot_20170414_004820

tjaart commented 7 years ago

@efermi I'm unable to replicate this with default settings. I've managed to create a clock that fills my entire screen with no padding.

Please ensure that you are using the latest version AND please tell me which settings I would need to replicate this.

efermi commented 7 years ago

my settings: time format: HH:mm time font size ratio: 4 date format: empty date font size ratio: 10

Version=3.0

tjaart commented 7 years ago

@efermi I replicated your settings on an empty desktop, and I still can't see that behaviour.

The only things I can think of are your plasma version and the font. I've noticed that some fonts behave strangely with the with the widget width. The font size is calculated as a pixel size based on the width of the widget. What happens when you change fonts to say Noto Sans?

efermi commented 7 years ago

Extreme example with both ratios set to 10 screenshot_20170414_124510 It is like missing seconds and date still take their space. I've tried this on plasma 5.8.6 and 5.9.4, with the same behavior.

tjaart commented 7 years ago

I see what you mean now. The problem is that the size ratio calculates the pixel size of the font. While this works okay if you have the seconds included, it doesn't work so well with alternate formats.

So currently, if you choose a ratio of 4, the pixel size of the font is the width of the widget divided by 4. so if your widget width is 100px, your font size will be 25px.

There needs to be a better solution to the sizing problem. I've tried using Qml font size policy but sadly that doesn't quite get the result I'm looking for. What I've done in the interim is to make the minimum font size ratio 2. You can get this latest version here on git. That should at least allow you to make the view work. A ratio of 3 should do the trick.

efermi commented 7 years ago

Thanks, that's better, although widget's text doesn't quite fit its container. screenshot_20170414_220704

There needs to be a better solution to the sizing problem

the stock digital clock widget scales sensibly, may be worth a look?

tjaart commented 7 years ago

@efermi I won't be able to look at it soon (sadly), but you are welcome to dig in if you want! I'm glad the fix helped.