luisbocanegra / plasma-panel-colorizer

Latte-Dock and WM status bar customization features for the default KDE Plasma panel
https://store.kde.org/p/2130967
GNU General Public License v3.0
232 stars 3 forks source link

Panel shadow on non floating panel #43

Closed Yankwerks closed 1 month ago

Yankwerks commented 7 months ago

Currently when using the "Hide" panel background option, its original shadow is also hidden. This allows the panel to fully match the window decorations background color, as if it was also part of it: Screenshot_20240421_231205

However it comes with the side effect of making that same panel flat and dull when no window is maximized, due to its abstinence of a shadow: Screenshot_20240421_231223

This can be fixed by using colorizer's panel shadow option, however this option only works when the panel is of the floating type: Screenshot_20240421_231244

luisbocanegra commented 7 months ago

Yeah, I noticed this too. Unfortunately the shadows are part of the panel background svg, so I am not sure if I can make my own shadow to draw outside the panel area. Will have to look into this.

Something I also wish was possible is to create my own background blurs and contrast but there doesn't seem to be a way to do that either with native qml

luisbocanegra commented 6 months ago

After some testing it seems the only reason the custom shadow works in floating mode is because the panel seems to be rendering a bigger transparent area, thus making the shadows be still inside the panel area.

Since the shadows come from the plasma theme svg, the panel is able to draw them in some way so that it goes outside the panel, so loading our own svg and then try to modify on the fly is maybe the only way to achieve this.

luisbocanegra commented 5 months ago

Hi, thanks to the work done in c++ plugin Custom blur region for panel background #50 it will be possible to keep the original background enabled with opacity 0 so the original shadow still renders outside the panel. In think this is a reasonable workaround for this problem

image

luisbocanegra commented 1 month ago

There is a rather hacky workaround that can be used on the main branch now.

As I said before, the shadow it's its own separate thing so it does not depend on the shape of the blur mask, quickly inspecting the panel code it seems it process the SVGs to obtain the shadow https://github.com/KDE/plasma-workspace/blob/1ce7ff6ddd0e44c138232cd8dabba8b8471e860d/shell/panelshadows_p.h#L14 https://github.com/KDE/plasma-workspace/blob/1ce7ff6ddd0e44c138232cd8dabba8b8471e860d/shell/panelview.cpp#L1871

The result is a shadow that does not change with our custom background:

Screenshot_20240925_151534

And yes, we still need a way to remove that shadow if we want to draw blur on the custom background

After the rewrite is now possible to set margins to the custom background, this can be used to add some space below the area of the panel so the shadow is shown (exaggerated) there:

Screenshot_20240925_150116

With this now we can create two different presets and have them switch when a window is maximized

Screenshot_20240925_150639

The downside is that there will be some resizing as things in the panel change to fit the new thickness:

Screencast_20240925_151004.webm

luisbocanegra commented 1 month ago

Another simpler way, if using solid custom background without margins, would be making a copy of that preset with the native background removed (formerly "Hide")

Screencast_20240925_153641.webm

luisbocanegra commented 1 month ago

Closing this as I think the above workarounds solve the problem

Actually removing just the Panel native shadow without removing the blur may not be possible but I am tracking that in #59 anyway.