Adaptive Panel Transparency option for Plasma Style developers
Closed, ResolvedPublic

Description

I think we all know what adaptive panel transparency is at this point. For those who don't, it's when a panel adjusts its background and foreground (including background opacity) according to the current window environment and desktop background. This is seen prominently in elementary OS where Wingpanel, their top panel, uses it to its advantage.

This task is for allowing consideration of the idea of giving Plasma Theme Developers the option to use an Adaptive Panel Transparency style for their Plasma Themes. This'd be easier to accomplish with https://phabricator.kde.org/T12619 being implemented beforehand, but regardless I still think it'd be nice to provide the option, as chances are if the option is added then some Plasma Theme developers might get on bored with this feature and make themes around it, as well.

Why not just use Latte's Adaptive Panel Transparency? Fair question, but there's one major problem, besides the fact it means relying on an external program to do the job: Latte's Adaptive Panel Transparency employs a tactic to achieve its colouring which presents its own set of problems regarding the fact it effectively paints over EVERYTHING unless told not to, rather than just changing the foreground of Plasmoids' panel elements to the appropriate colour.

Onto implementation on the Plasma Theme Developer's side. Plasma Themes have access to multiple options in their metadata.desktop files, such as blur behind panel, contrast values, and so on. I feel that putting the options for A.P.T. would be the most logical location for them. Now for how the structure of the additions to metadata.desktop could look for enabling this feature:

[AdaptiveTransparency]
enabled=true - Is Adaptive Transparency enabled? Fallback is false.
foregrounddark=#000000 - The panel foreground for whenever overlaying a light wallpaper (fully transparent with dark foreground)
foregroundlight=#FFFFFF - The panel foreground for whenever overlaying a dark wallpaper (same as foregrounddark but light foreground)
panelbackground=#000000 - The panel background for when semi-transparent (over any other wallpaper or a window is underlapping the panel)

When a window is maximised, the panel would revert to its regular panel.svgz SVG decorated state with the standard panel background/foreground colouring that the Plasma Theme would supply to the panel regardless of whether Adaptive Transparency is on or not. If Compositing is disabled, it'd stay just the way it currently is when Compositing is disabled.

If panelbackground isn't set, it'd fall back to the background colour set for the standard panel or Breeze's value for this. If foregroundlight and foregrounddark aren't set it'd fallback to Breeze's value for each one, unless the developers think of an appropriate substitute colour to get out of that current Plasma Theme to use for those colours as a fallback. Of course this is implying that Breeze'd then have its own values for Adaptive Transparency, even if the feature isn't enabled anyway on the Default Plasma Style.

The-Feren-OS-Dev triaged this task as Wishlist priority.
The-Feren-OS-Dev updated the task description. (Show Details)
davidedmundson closed this task as Resolved.Mar 5 2022, 4:55 PM
davidedmundson claimed this task.