Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon Compact Layout Type - Doesn't Fit Well On A Vertical Panel Width #121

Open
jotapesse opened this issue Oct 21, 2022 · 12 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@jotapesse
Copy link

jotapesse commented Oct 21, 2022

Hi! I previously used the Weather Widget 1. Moved to Weather Widget 2 as the first no longer works well on Plasma 5.26. I'm using a vertical panel in floating mode. The Weather Widget icon on the panel can get too wide for the panel width. The temperature always goes off to the right edge of the panel. In comparison the first widget still works better. It seems that the Icon size and the temperature text is not properly placed. In the following screenshots I have purposely placed both widgets (1 and 2) from top to bottom. The bottom one is of course Weather Widget 2. Can you please fix this issue?

Operating System: Debian GNU/Linux Sid
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Weather Widget 2 v2.3.4 in Compact Layout Type

image

Even if defloating the panel and depending on the weather icon in use, temperature always gets too much to the right edge of the panel, not as centered as the first widget:

image

@jotapesse jotapesse changed the title Icon Compact Mode - Doesn't Fit The Vertical Panel With Icon Compact Layout Type - Doesn't Fit Well On A Vertical Panel Width Oct 21, 2022
@blackadderkate blackadderkate self-assigned this Oct 22, 2022
@blackadderkate blackadderkate added the bug Something isn't working label Oct 22, 2022
@blackadderkate
Copy link
Owner

I think I have a fix for this (see below).

It seems to work on my login, but it needs thoroughly testing using different themes & distributions before I can release it.

Diff attached if you want to give it a try, and know how to apply it...
patch.txt

@jotapesse
Copy link
Author

jotapesse commented Oct 23, 2022

Hi! Thanks. That indeed seems to fix it for the temperature text. Still noticable missing fixes are for the following. Hopefully you can fix them as well? I'm using the default Plasma Breeze Dark theme by the way.

  • Weather icon: depending on icon it can get over the right edge of the panel;
  • Last Updated time text: string font size does not adjust and it gets over the right panel edge.

image

@jotapesse
Copy link
Author

jotapesse commented Oct 23, 2022

Looking briefly at the code I would say that the widget window/box size (witdh x height) doesn't compute well in the Compact Layout, at least not as well as the Weather Widget 1. I wish I knew more of QML Qt Quick code so that I could help more. Hopefully this will help you pin point it?

@blackadderkate
Copy link
Owner

blackadderkate commented Oct 26, 2022

Apologies if this is a bit garbled - it's 1am and I need sleep!

I think I've got a version that works - give this beta version a try

Update using plasmapkg -u

You can Increase/Decrease the font size in the Config/Appearance section to tweak them to your liking.

@jotapesse
Copy link
Author

Hi! I appreciate your effort. Still doesn't seem to work that well. The widget icon is equally affected by the font size change. The last updated text still gets over the panel edge in any case. Perhaps you could bring back the code from the Weather Widget 1 on how the widget/font sizes are computed?

First screenshot with the default 32px font size. Second screenshot is with a font size of 20px to equal the Weather Widget 1 temperature font size.

image
image

@blackadderkate
Copy link
Owner

Unfortunately the WeatherWidget1 code has several issues. I had complaints that "single digit" temperatures (e.g. 7°C) had "unacceptable" gaps, whilst "triple digit" temperatures (e.g. 100°F) would clip or overlap the icon . I also had several requests to make the fonts and font-size customisable.
And there were even more issues if a user had customised their theme font, DPI or Screen Scaling settings.

So I was pretty-much forced to rewrite it, but I'm not going to give up trying to get it 100% perfect...

@blackadderkate
Copy link
Owner

OK, try this version
It's basically the old layout from v1, but with a few tweaks.

blackadderkate added a commit that referenced this issue Oct 28, 2022
Fix for issue #121:
Icon Compact Layout Type - Doesn't Fit Well On A Vertical Panel Width
@blackadderkate
Copy link
Owner

I have just uploaded a fix for this issue.

Please try downloading and installing this new beta version.

@jotapesse
Copy link
Author

jotapesse commented Oct 28, 2022

Much better! Great job! Thank you! Now to make it perfect and it is a really minor detail, if you could apply to the temperature text font the same kind of character outline effect. I'm using the "Default" font. If you look closely at both widgets you'll notice that the weather widget 1 text seems to standout more (improving its readability against the icon background). Really minor but would make it perfect I guess. :-)

image

@jotapesse
Copy link
Author

image

@jotapesse
Copy link
Author

jotapesse commented Nov 5, 2022

Hi again. Another noticeable glitch is when the last updated time reaches a time of double digits. The text line no longer gets over the edge but now it wraps to a second line below. It would be best if it would be kept on the same single line, downsizing the font or having the font size calculated to accomodate double digits in the first place. Similar to what Weather Widget 1 does I guess? Sorry to be a pain...
image

@thelaughinggnome
Copy link

Might be of interest: https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants