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

Extra space before applet #3

Closed
rokups opened this issue Nov 6, 2018 · 50 comments
Closed

Extra space before applet #3

rokups opened this issue Nov 6, 2018 · 50 comments
Labels
bug Something isn't working fixed upstream

Comments

@rokups
Copy link

rokups commented Nov 6, 2018

There is some extra empty space before applet. It creates a visual discrepancy when other elements are present, like window buttons in the screenshot.

image

Issue is even more severe when application icon is enabled.

image

Be great if there was no extra spacing, or if it was configurable.

Thank you for great applet 👍

P.S. I am positive margin comes from this applet because right-clicking empty space presents context menu option to configure this applet.

@kupiqu
Copy link
Owner

kupiqu commented Nov 6, 2018

My QML skills are a bit limited, but I'll see what I can do...

@kupiqu kupiqu added the enhancement New feature or request label Nov 6, 2018
@Chromace
Copy link

Chromace commented Nov 7, 2018

Does adjusting the "Spacing" option help much in that regard? I have it set to 6.5 on my end, and it looks rather nice. What about you?

@kupiqu
Copy link
Owner

kupiqu commented Nov 7, 2018

Does adjusting the "Spacing" option help much in that regard? I have it set to 6.5 on my end, and it looks rather nice. What about you?

Yes, as @Chromace says (thank you btw!), that is exactly the role of the Spacing parameter. Please @rokups, give it a try...

@kupiqu kupiqu added question Further information is requested and removed enhancement New feature or request labels Nov 7, 2018
@rokups
Copy link
Author

rokups commented Nov 7, 2018

Is it supposed to be here?
image

Edit:
Entire options window changed after installing git version. Version on KDE store is a bit outdated maybe? Anyhow spacing option works perfectly. Thanks!

@rokups rokups closed this as completed Nov 7, 2018
@rokups
Copy link
Author

rokups commented Nov 7, 2018

Erm on the other hand i think there could still be some improvement:
image
Maybe allowing negative spacing would be an option? Screenshot has spacing set to 0.

Panel with widget is on top and window titlebar is below it.

@rokups rokups reopened this Nov 7, 2018
@kupiqu
Copy link
Owner

kupiqu commented Nov 7, 2018

Negative spacing does not make much sense, but indeed there is room for improvement when the window icon is shown. There should be an easy fix for this.

@kupiqu
Copy link
Owner

kupiqu commented Nov 7, 2018

Entire options window changed after installing git version. Version on KDE store is a bit outdated maybe? Anyhow spacing option works perfectly. Thanks!

There should be two different versions in KDE store and I think you got the initial one.

@kupiqu kupiqu added bug Something isn't working and removed question Further information is requested labels Nov 7, 2018
@Chromace
Copy link

Chromace commented Nov 7, 2018

image
image
At least in my case, the display of the icon doesn't seem to be badly spaced. I have the spacing set at 7.0, as seen above. Wonder if it has something to do with screen resolution or something.

@rokups
Copy link
Author

rokups commented Nov 8, 2018

Hmm odd. Maybe it has to do anything with preceeding widget? In my case i have applet-window-buttons right before the title. Issue is visible bit more when that widget is hidden (window being out of focus).
image
Notice how left margin is larger than the bottom one. They probably should be same. I tried moving applet-window-buttons elsewhere by the way, that changes nothing.

@Chromace
Copy link

Chromace commented Nov 8, 2018

It seems ambiguous as to whether the problem stems from this title widget or another at the moment. At the very least from the screenshot I see above, the spacing seems fine. In what way is the left margin larger than the bottom one out of curiosity?

@kupiqu
Copy link
Owner

kupiqu commented Nov 8, 2018 via email

kupiqu added a commit that referenced this issue Nov 8, 2018
@kupiqu kupiqu added the fixed label Nov 8, 2018
@kupiqu kupiqu closed this as completed Nov 8, 2018
@kupiqu
Copy link
Owner

kupiqu commented Nov 8, 2018

fixed with commit b73b229

@kupiqu
Copy link
Owner

kupiqu commented Nov 8, 2018

It's trickier than it seems. I opted for defining 3 space settings: Left, Right, and in between of Icon and AppName.

Btw, I suggest to set your own spacing settings with an application whose icon fills all its width (not all application icons do so).

@kupiqu
Copy link
Owner

kupiqu commented Nov 8, 2018

Also note that the settings UI (see issue #2) got uglier after this commit, will see if I can do sth about it.

@rokups
Copy link
Author

rokups commented Nov 8, 2018

I noticed that this is more of an issue with some applications than the others. For example konsole's icon aligns perfectly while firefox's icon has extra spacing. Did you test with firefox?

@kupiqu
Copy link
Owner

kupiqu commented Nov 8, 2018

Yes, this is exactly what I meant here:

Btw, I suggest to set your own spacing settings with an application whose icon fills all its width (not all application icons do so).

Application icons do not necessarily fill the available width. This is an upstream issue of the icon itself, and there's nothing the applet can do about it. Well, it could have specific widths for specific applications, but I don't think it's worth the effort. Personally, I think these issues should be filled against the applications or icon themes, as then they will be consistent all around, e.g., in a vertical taskbar.

@kupiqu kupiqu added the upstream label Nov 8, 2018
@rokups
Copy link
Author

rokups commented Nov 8, 2018

Kwin displays icon without extra spacing though.

@kupiqu
Copy link
Owner

kupiqu commented Nov 8, 2018

Kwin displays icon without extra spacing though.

If you refer to the kwin menu, it doesn't. I clearly see a difference between icon spacing. Kile for instance is a very narrow icon compared to app icons that fill the space ( e.g. systemsettings). It is more difficult to perceive though because all those sizes are rather tiny.

@kupiqu
Copy link
Owner

kupiqu commented Nov 8, 2018

image

image

@kupiqu
Copy link
Owner

kupiqu commented Nov 8, 2018

I got it before alright, thanks, but please see my screenshot above to see that exactly the icon width issue exists in kwin as well (compared there kile and systemsettings; note that buttons do not appear because I have them in the right side).

Beyond that and with respect to your own setting, I cannot recommend other than adjusting the left spacing of my applet. If an issue remains it must be because an excessive right margin from the buttons applet. Please ask @psifidotos if that could be the case, and if so fill an issue there (https://github.com/psifidotos/applet-window-buttons/issues). Again, I have the buttons on the right side of the panel and appearing only for maximized windows, so I don't suffer your issue.

@psifidotos
Copy link

Please ask @psifidotos if that could be the case

Please test the latest Window Buttons from master branch...
in that version if the rightMargin = 0 then the space right to the button = buttonsSpacing/2

based on your screenshot that big gap between minimize button and Firefox icon is not from Window buttons.

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

based on your screenshot that big gap between minimize button and Firefox icon is not from Window buttons.

If it's not coming from Window Buttons, then Active Application definitely has a left margin different than 0. @rokups please start setting it to 0 and increase it according to your like.

@rokups
Copy link
Author

rokups commented Nov 9, 2018 via email

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

Then, I'm sorry but as far as I can see, it's definitely not the responsibility of this applet, and there's nothing I can do.

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

A way to see that it's (or not) a problem of this applet is moving the applet all the way to the left of the panel for testing purposes while keeping the left margin to 0. Then make a screenshot to show me if there is still some buggy left margin. If so, then I'll need to dig deeper, otherwise it's not the applet.

@rokups
Copy link
Author

rokups commented Nov 9, 2018

This is how it looks:
image

Right-clicking all the way to the left indicates that applet covers very first pixel of the panel:
image

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

This is how it looks like in my case:

image

Can you show your settings?

@rokups
Copy link
Author

rokups commented Nov 9, 2018

image
By the way applet is in latte-dock (panel mode). maybe that is of any significance?

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

Are you at sync with master?

It's in latte, are you not? if so I will test

@rokups
Copy link
Author

rokups commented Nov 9, 2018

Yes, both latte and active application are latest git versions

Edit: well a confession - screenshots came from bit older commit (as you probably guessed already), but i updated/retested and icon positioning is identical to my previous results.

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

Yes, both latte and active application are latest git versions

You should see Plasmoid version: 0.1.95 (0.2 beta)

Said that, I don't think I made any relevant change lately related to this issue though.

I think the problem is how icons get scaled down according to the panel height, because I don't suffer from firefox icon but I see the effect with broader icons such as systemsettings. @psifidotos do you have any clue how to workaround the issue? I don't think it may even be possible :(

@rokups
Copy link
Author

rokups commented Nov 9, 2018

I tried switching to different icon theme and numix theme looks to be working properly (like in your screenshots). Numic-circle and breeze - not so much.

Maybe it would be possible to crop icon at runtime, trimming transparent edges? It definitely is possible with Qt, but i am clueless about QML.

@psifidotos
Copy link

@rokups for the margin check also that in Dock Settings->Apperance->Applets Distance is set to 0%

@kupiqu I have lost the conversation... what is the issue?

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

@kupiqu I have lost the conversation... what is the issue?

The issue happens because icons do not have typically the same width and height sizes, so different behavior is seen when they are scaled down according to panel width or height, whichever is more restrictive.

Compare for instance the icon sizes in Latte's icon vertical bar:

image

Something similar is happening in Active Application

Another example, look the different separation between icons in the system tray:

image

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

In the first screenshot, kile is particularly affected.
In the second screenshot kdeconnect is.

@psifidotos
Copy link

ok...

icon themes are created with some design principles... e.g. how much will be the padding around the icons, which is going to be the color palette etc. etc...

if an icon theme does not have such design principles then it is theme's fault...

I would not mess with something that is theme designers responsibility...

@rokups
Copy link
Author

rokups commented Nov 9, 2018

But.... How come kwin displays icon without extra padding?
image
Applet above, kwin below. Same icon.

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

But.... How come kwin displays icon without extra padding?
image
Applet above, kwin below. Same icon.

As I said before, it depends on the icon (and therefore theme) but also on the available space... If you would set the panel height in plama/latte to the same heigth as in kwin window title then you should see exactly the same behavior in both (assumed the enforced padding, if any, is the same in kwin and plasma/latte).

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

I would not mess with something that is theme designers responsibility...

I totally agree

@rokups
Copy link
Author

rokups commented Nov 9, 2018

Height was a bit off (like 5 pixels). I made it same and gap only increased:
image
What i do not understand is how it is icon's fault if one thing renders it fine and another thing renders it wrong. If icon is really at fault here then kwin must be fixing icons to render proper.

P.S. @psifidotos see screenshot, buttons applet is not centered vertically. Better visible when zoomed in.

@psifidotos
Copy link

set the panel height in plama/latte to the same heigth as in kwin window title then you should see exactly the same behavior in both

makes some sense... but you forget the PlasmaCore.IconItem limitations....
the plasma IconItem because it doen not want to provide blur at any case shrinks the icons in some cases in order to support always only the icons with the sizes that are provided by the icon theme...

If you want to overcome this and use always the maximum size provided you should use:
qiconitem from kquickcontroladdons : https://github.com/KDE/kdeclarative/blob/master/src/qmlcontrols/kquickcontrolsaddons/qiconitem.h

either way... I will probably create something new for window titles and icons... it is just a qml applet that does not need any c++ code... I will take the best practices for all applets that provide application titles etc... and I will combine them in a single plasmoid....

P.S. @psifidotos see screenshot, buttons applet is not centered vertically. Better visible when zoomed in.

use Window Buttons git version and just set a thickness margin... if it is still valid open an issue at Window Buttons page.

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

kwin is not fixing anything, kwin is suffering the same but constraints are different wrt plasma/latte, and you are picking just an icon that works fine with kwin and doesn't in latte, but that's cherry picking, if it would fix the issue it should work for all, but no, please see below kwin failing with the same thing (comparison between konsole and kile):

image

image

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

makes some sense... but you forget the PlasmaCore.IconItem limitations....
the plasma IconItem because it doen not want to provide blur at any case shrinks the icons in some cases in order to support always only the icons with the sizes that are provided by the icon theme...

This was only for testing this particular issue, but yes, I can see that internals of kwin and plasma/latte may make icons look different even for the same height.

If you want to overcome this and use always the maximum size provided you should use:
qiconitem from kquickcontroladdons : https://github.com/KDE/kdeclarative/blob/master/src/qmlcontrols/kquickcontrolsaddons/qiconitem.h

either way... I will probably create something new for window titles and icons... it is just a qml applet that does not need any c++ code... I will take the best practices for all applets that provide application titles etc... and I will combine them in a single plasmoid....

I don't think my applet needs any c++ code. Would you prefer to start from scratch?

@rokups
Copy link
Author

rokups commented Nov 9, 2018

@kupiqu i understand. But i am not cherry-picking icons. All of them have this extra margin on my system. I just have firefox always opened so it is convenient to make screenshots with :) If i change icon theme to numix then this margin gets smaller but still a bit noticeable so it is definitely something related to icon theme. And to be honest - that issue with kile looks way better than fat padding in my case.

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

@kupiqu i understand. But i am not cherry-picking icons. All of them have this extra margin on my system. I just have firefox always opened so it is convenient to make screenshots with :) If i change icon theme to numix then this margin gets smaller but still a bit noticeable so it is definitely something related to icon theme.

I see. Sorry, I inferred that because that's how it looks like in my system. What icon theme do you use and what panel height in latte?

And to be honest - that issue with kile looks way better than fat padding in my case.

Well yeah, the problem there would be with konsole, no padding basically

@psifidotos
Copy link

I don't think my applet needs any c++ code. Would you prefer to start from scratch?

I will probably cherry pick code between different applets... c++ is not needed

@kupiqu
Copy link
Owner

kupiqu commented Nov 9, 2018

I will probably cherry pick code between different applets... c++ is not needed

Sounds good. Do you have a time frame for that?

Not trying to be pushing, just asking because there are some open issues here about UI settings and so on. On the one hand, I recognize the very much need for improvements on that terrain, but on the other hand, I am far from expert on that regard... So, if your time frame is not long, I guess I can stop worrying about that (furthermore because I think little of what I could accomplish in there, would eventually make it in your applet).

@psifidotos
Copy link

I believe that until this Christmas I will be able to publish a version

@rokups
Copy link
Author

rokups commented Nov 9, 2018

what panel height in latte?

Panel height is 28px.

What icon theme do you use

That is a complicated question :) I am using a frankenstein mix of breeze+numix+numix-circle.

~/.local/share/icons % tree   
.
└── breeze
    └── apps
        ├── 128 -> /usr/share/icons/Numix/128/apps
        ├── 48 -> /usr/share/icons/Numix-Circle/48/apps
        └── 64 -> 48

And breeze icon theme selected in settings. This gives me a nice blend of breeze icons in dolphin while stuff like application icons in the dock are round and nice. Its a hack i know, but looks good :)

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

No branches or pull requests

4 participants