pop-os / cosmic-panel

WIP
GNU General Public License v3.0
113 stars 26 forks source link

Applets can cause rendering issues for vertically oriented panels. #105

Closed XV-02 closed 7 months ago

XV-02 commented 8 months ago

Related to https://github.com/pop-os/cosmic-applets/issues/247

While testing panel/dock orientations with different combination of applets, I noticed that the App Library Button applet can cause issues for correctly rendering other applets on the panel. This is most noticeable with the dynamic workspace selectors in the following screenshots.

screenshot-2024-02-27-23-11-28 screenshot-2024-02-27-23-15-04

At a quick glance, it looks like the text is being centered, but that anything much beyond the centerline isn't shown. This is similar with the Workspaces Button. In both cases, the last fully rendered letter of the Application or Workspaces button is the 50%+1 letter (The 7th letter for "Applications" and the 6th for "Workspaces")

It might be helpful to test longer strings. And, it might also be important to find some way to test "tall" strings as well, to see if the same issue impacts horizontally oriented panels.

wash2 commented 8 months ago

Ya, the panel is capped in dimensions for each size, and it tries to accommodate applets until that size. I guess the size used for centering isn't being capped, but it should be. Also the applet used to use an icon button for the vertical orientation, but it doesn't anymore. I guess maybe it was changed during a refactoring.

I'm not sure that vertical orientations for all applets are really defined though. Maybe there should be metadata in the desktop file indicating valid orientations for applets. That way the settings app could prevent adding applets to a vertical panel when they weren't designed for it.

XV-02 commented 8 months ago

I was wondering about the potential of either requiring all applets to define vertical and horizontal behaviours, or otherwise having some form of whitelist for if an applet is allowed to be deployed to a vertical panel.

I imagine most users, and most people producing applets, will be using the horizontal panel scheme. Having something that requires defined behaviour in both orientations should at least encourage those making applets to consider the use case, so I'm inclined towards that approach.

For the applets we have that are effected - I think all of them are rendering text. That's a quite complicated case for us. There are some languages which can support vertical and horizontal text orientation very well - Japanese for example - and some which might struggle - potentially Arabic scripts. I'm not sure of the best method there.