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

Panel shadow on non floating panel #43

Closed
Yankwerks opened this issue Apr 21, 2024 · 6 comments
Closed

Panel shadow on non floating panel #43

Yankwerks opened this issue Apr 21, 2024 · 6 comments
Labels
brainstorming enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@Yankwerks
Copy link

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
Copy link
Owner

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 luisbocanegra added the bug Something isn't working label Apr 21, 2024
@luisbocanegra luisbocanegra changed the title [BUG] Panel shadow on non floating panel Panel shadow on non floating panel May 18, 2024
@luisbocanegra luisbocanegra added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed brainstorming and removed bug Something isn't working labels May 18, 2024
@luisbocanegra
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

luisbocanegra commented Sep 25, 2024

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
Copy link
Owner

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 luisbocanegra removed the bug Something isn't working label Sep 25, 2024
@luisbocanegra
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brainstorming enhancement New feature or request help wanted Extra attention is needed
Projects
Status: Done
Development

No branches or pull requests

2 participants