Bug 414104 - Padding of Latte messes with system tray
Summary: Padding of Latte messes with system tray
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Plasma
Component: application (show other bugs)
Version: 0.9.4
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
: 414127 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-11-13 19:30 UTC by adrien.brunelat
Modified: 2019-11-15 00:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.9.5
Sentry Crash Report:


Attachments
Ill positioned arrow (57.64 KB, image/png)
2019-11-13 19:30 UTC, adrien.brunelat
Details
Wrong activated line (30.48 KB, image/png)
2019-11-13 19:30 UTC, adrien.brunelat
Details
Space in latte of element (76.26 KB, image/png)
2019-11-13 19:31 UTC, adrien.brunelat
Details
Two indicators (21.61 KB, image/png)
2019-11-13 21:25 UTC, adrien.brunelat
Details
No padding (42.31 KB, image/png)
2019-11-14 09:58 UTC, adrien.brunelat
Details
With padding (196.09 KB, image/png)
2019-11-14 09:59 UTC, adrien.brunelat
Details
Applet ignoring padding (79.27 KB, image/png)
2019-11-14 18:28 UTC, adrien.brunelat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description adrien.brunelat 2019-11-13 19:30:26 UTC
Created attachment 123902 [details]
Ill positioned arrow

SUMMARY

When using padding on latte dock panel, the system tray spacing is messed up. The expander arrow is too far to the right and the activated line is not right.
(see screensots)
STEPS TO REPRODUCE
1. install Latte
2. create a panel
3. set padding value to 10px
4. add system tray

OBSERVED RESULT

Expanded arrow is too far away from icons

EXPECTED RESULT

Expects the space between the arrow and the icons to be the same as the space between each icon.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro
(available in About System)
KDE Plasma Version: 5.17.2
KDE Frameworks Version: 5.63.0
Qt Version: 5.13.1
Comment 1 adrien.brunelat 2019-11-13 19:30:46 UTC
Created attachment 123903 [details]
Wrong activated line
Comment 2 adrien.brunelat 2019-11-13 19:31:12 UTC
Created attachment 123904 [details]
Space in latte of element
Comment 3 Michail Vourlakos 2019-11-13 19:44:21 UTC
what padding value?
Comment 4 adrien.brunelat 2019-11-13 20:36:22 UTC
Latte panel settings... > Effects > Indicators > Paddings > set to ~50%
Comment 5 adrien.brunelat 2019-11-13 20:37:45 UTC
I don't display Latte's indicator but it adds a smooth padding to all elements.
Comment 6 Michail Vourlakos 2019-11-13 21:04:18 UTC
(In reply to adrien.brunelat from comment #5)
> I don't display Latte's indicator but it adds a smooth padding to all
> elements.

I don't think so, have you tried to reduce the length margins from Appearance page?
Comment 7 adrien.brunelat 2019-11-13 21:22:20 UTC
The margins are at 0 and they don't space the elements in the same way.

When I add indicators padding, latte adds horizontal padding on all elements for a nice wide indicator. When the indicator is disabled, the padding stays and the indicators from the applets are shown. (main reason why I don't use latte's indicators on the panel is that it adds to the applet's indicator.)
Comment 8 adrien.brunelat 2019-11-13 21:23:42 UTC
When I say I disable indicators I mean that I don't check the "display indicators for applets" (there are only applets on my panel anyway). The main indicator swicth in on.
Comment 9 adrien.brunelat 2019-11-13 21:25:43 UTC
Created attachment 123911 [details]
Two indicators

Example of the system tray activated with both indicators showing.
Comment 10 Michail Vourlakos 2019-11-13 21:26:04 UTC
Close the main indicator switch then
Comment 11 adrien.brunelat 2019-11-13 21:38:38 UTC
> Close the main indicator switch then

That removes the padding. Margins are inferior in two ways:
- it can bet set to 25% top instead of 100% for padding (I like it very spaced)
- it does not add space on the sides (that looks horrible)

I found a workaround using margins and adding separators widgets but the main point resides, the indicator padding setting messes the system tray layout, visible or not. Maybe the bug is from system tray side but I couldn't find where to post such a bug report.
Comment 12 Michail Vourlakos 2019-11-13 21:55:15 UTC
The expanded arrow in the plasma systray is aligned at the far right of the space given to the systray, this is why the expanded arrow is there.
Comment 13 Michail Vourlakos 2019-11-13 21:57:28 UTC
And this is the correct way to be aligned in order to follow Fitt's Law.
Comment 14 Michail Vourlakos 2019-11-13 21:59:03 UTC
For systray issues, you can use plasmashell product, systray component
Comment 15 adrien.brunelat 2019-11-14 09:58:53 UTC
Created attachment 123913 [details]
No padding
Comment 16 adrien.brunelat 2019-11-14 09:59:20 UTC
Created attachment 123914 [details]
With padding
Comment 17 adrien.brunelat 2019-11-14 10:05:48 UTC
This is quite tricky to explain. I think the problem is on the system tray side. I added some screenshots.

As you can see, when some padding is applied, it is expected that he arrow stays grouped with the icons and that space is added to the sides of the whole group. Instead, it is to the far right of the applet. That way it looks like it belongs to something else, it's not nicely grouped with the icons.

Also, the indicator of the applet also is not centered at all.

I'm now pretty sure it has more to do with the system tray applet than latte so I'll report that over there.
Comment 18 Michail Vourlakos 2019-11-14 12:13:51 UTC
Try to run Latte from command line with: latte-dock -d --graphics

It should give you for each applet how much space is given with green rectangles.
Comment 19 Nate Graham 2019-11-14 17:06:52 UTC
*** Bug 414127 has been marked as a duplicate of this bug. ***
Comment 20 Michail Vourlakos 2019-11-14 17:54:05 UTC
EXPLANATION:

Plasma Systray is aligning its icons at the horizontal center of the available space. The popup is aligned at the far right(following Fitt's Law).

So all of this is intentional and makes sense.

Latte is giving to the user plenty ways to add length paddings and margins.
1. Appearance -> Margins -> Length
2. Effects -> Indicators -> Length Padding

SOLUTION 1:
If the user sets 1 AND 2 to 0% then the issue is fixed because it replicates exactly the plasma panel behavior.


SOLUTION 2:
You can use the latte systray tweaks and increase icons spacing from systray settings in order to provide a more pleasant result visually. Systray tweaks are found at: https://github.com/psifidotos/plasma-systray-latte-tweaks
Comment 21 adrien.brunelat 2019-11-14 18:28:48 UTC
Created attachment 123935 [details]
Applet ignoring padding

You keep invoking Fitt's law. But Fitts’ law states that the amount of time required for a person to move a pointer (e.g., mouse cursor) to a target area is a function of the distance to the target divided by the size of the target. Thus, the longer the distance and the smaller the target’s size, the longer it takes. I don't see the link here, maybe you're talking about a variant?

This screenshot shows clearly that the applet's arrow ignores Latte's padding. The padding should be to the right of the arrow, not to the left. Since the arrow is pretty small, it should be closer to the other icons, not farther away. And more importantly, closer to the icons of the tray than to the adjacent other applet.

Spacing the icons with the tweak doesn't have any influence, it just spreads the icons a bit more.

Now, I found my workaround and this is your work so you do whatever you want with this bug report, that's fair enough.
I enjoy Latte very much, I would keep KDE without it, and I'm happy like that. I just feel that there is room for improvement right there. Maybe I'll try to suggest a change if I find a way to fix that.
Comment 22 adrien.brunelat 2019-11-14 18:29:42 UTC
*I would NOT keep KDE without it, was what I meant :)
Comment 23 Michail Vourlakos 2019-11-14 19:20:27 UTC
Git commit 976e7a5ad99448594e49f1873c73f24462d47e15 by Michail Vourlakos.
Committed on 14/11/2019 at 19:17.
Pushed by mvourlakos into branch 'v0.9'.

remove exceptions for systray and indicators

--remove the layout exception for the plasma systray
and behave for this just all the rest applets
--fix indicators for applets in order to consider
properly the indicators padding and applets margins.
In other words the Latte indicators for applets should
not take up all the length provided but ONLY the
applet length + indicators padding (without at any
case the applet length margins)
FIXED-IN:0.9.5

M  +1    -3    containment/package/contents/ui/applet/AppletItem.qml
M  +23   -2    containment/package/contents/ui/applet/indicator/Loader.qml

https://commits.kde.org/latte-dock/976e7a5ad99448594e49f1873c73f24462d47e15
Comment 24 Michail Vourlakos 2019-11-14 19:20:49 UTC
Git commit 453ac890abf32b41fe2f1c80497d1895feb1a864 by Michail Vourlakos.
Committed on 14/11/2019 at 19:20.
Pushed by mvourlakos into branch 'master'.

remove exceptions for systray and indicators

--remove the layout exception for the plasma systray
and behave for this just all the rest applets
--fix indicators for applets in order to consider
properly the indicators padding and applets margins.
In other words the Latte indicators for applets should
not take up all the length provided but ONLY the
applet length + indicators padding (without at any
case the applet length margins)
FIXED-IN:0.9.5

M  +1    -3    containment/package/contents/ui/applet/AppletItem.qml
M  +23   -2    containment/package/contents/ui/applet/indicator/Loader.qml

https://commits.kde.org/latte-dock/453ac890abf32b41fe2f1c80497d1895feb1a864
Comment 25 Michail Vourlakos 2019-11-14 19:23:49 UTC
(In reply to adrien.brunelat from comment #22)
> *I would NOT keep KDE without it, was what I meant :)

I found it... You were right! Thank you very much for pointing me in the right direction. There was an exception for plasma systray's and now it is removed and at the same time I found out some cases the LAtte indicators for applets were using the entire length provided including the length margins, and that shouldnt happen...
Now both of them they should be fixed.... for upcoming 0.9.5
Comment 26 adrien.brunelat 2019-11-14 20:37:05 UTC
(In reply to Michail Vourlakos from comment #25)
> (In reply to adrien.brunelat from comment #22)
> > *I would NOT keep KDE without it, was what I meant :)
> 
> I found it... You were right! Thank you very much for pointing me in the
> right direction. There was an exception for plasma systray's and now it is
> removed and at the same time I found out some cases the LAtte indicators for
> applets were using the entire length provided including the length margins,
> and that shouldnt happen...
> Now both of them they should be fixed.... for upcoming 0.9.5

Great! can't wait to see 9.5!
Comment 27 Michail Vourlakos 2019-11-14 21:00:14 UTC
in the upcoming days I will also upload two more fixes for plasma systray tweaks,

1. An option for the user to disable the builtin systray indicator from systray settings
2. When an applet is highlighted in the systray the Latte Indicator should hide
Comment 28 adrien.brunelat 2019-11-15 00:24:46 UTC
(In reply to Michail Vourlakos from comment #27)
> in the upcoming days I will also upload two more fixes for plasma systray
> tweaks,
> 
> 1. An option for the user to disable the builtin systray indicator from
> systray settings
> 2. When an applet is highlighted in the systray the Latte Indicator should
> hide

Awesome! Also an option to configure the thickness of the indicator would be great!