Bug 368384

Summary: [Feature Request] - Support for transparent panels
Product: [Plasma] plasmashell Reporter: Michail Vourlakos <mvourlakos>
Component: PanelAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: andydecleyre, kde, rapiteanu.catalin, simonandric5
Priority: NOR    
Version: 5.7.3   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Michail Vourlakos 2016-09-07 10:59:20 UTC
It would be very helpful if there was a choice for panels to be transparent independent of the theme. 

Such a use case are the  panels-docks that do need transparency in order to create consistent animations...

Reproducible: Always
Comment 1 David Edmundson 2016-11-05 11:57:02 UTC
For the user to overwrite, it should be in the theme and I'm not going to add any options there.


For the containment to overwrite it - that seems sensible - we have a backgroundHints flag in AppletInterface that we could repurpose for containments.

We'd want to change views/Panel.qml

Theoretically this is just changing

-    imagePath: "widgets/panel-background"
+    imagePath: containment.backgroundHints & Plasma.StandardBackground ? "widgets/panel-background" : ""

But there's additionally a slightly weird quirk that drawing the panel background happens in panel.qml; the shadow for said background happens in the view (panelview.cpp); which isn't ideal as it's tie-in that isn't semantically correct.

Also feel free to make patches to Plasma as well as working on your own applet.
Comment 2 Michail Vourlakos 2016-11-06 12:50:07 UTC
David some update in this,

I tried your code but didnt find any success...

I even tried,

imagePath: "" // this code just gives transparency to the panels, it doesnt make them fully transparent

the code part,
Plasma.StandardBackground //hits a warning that Plasma object is not identified

for my Panel code I tried to set,
Plasmoid.backgroundHints: "NoBackground";    ///which is found in some plasmoids code

so I also tried in Panel.qml the following:
imagePath: containment && containment.backgroundHints !== "NoBackground" ? "widgets/panel-background" : ""

but I didnt have any success...
Comment 3 Michail Vourlakos 2016-11-06 14:12:33 UTC
Sorry, small update...

I had "Blur" and "Background Contrast" effects enabled, I disabled them and now I can play with it...
Comment 4 Michail Vourlakos 2016-11-06 14:42:53 UTC
Ok small good update...

imagePath: containment && containment.backgroundHints === PlasmaCore.Types.NoBackground ? "" : "widgets/panel-background"

works for me and in my panel I add:
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground;

------
David any idea for the shadows?
Why not add them from the panelview.cpp to the Panel.qml? this would allow also to disable them for PlasmaCore.Types.NoBackground... Has something to do with Kwin and and panel(window) counting?
Comment 5 Michail Vourlakos 2016-11-06 16:41:40 UTC
David,

I have sent this: https://phabricator.kde.org/D3282

in order to open the discussion for transparent panels, disabling their shadows and disabling blur and background contrast for these panels...
Comment 6 Michail Vourlakos 2016-11-06 17:08:05 UTC
and also this: https://phabricator.kde.org/D3283
Comment 7 Michail Vourlakos 2016-11-10 15:42:40 UTC
I have updated...

https://phabricator.kde.org/D3282
https://phabricator.kde.org/D3283
Comment 8 Michail Vourlakos 2016-11-13 17:28:04 UTC
Git commit 341a534e9d16eaf89f137136bdbff5756db78775 by Michail Vourlakos.
Committed on 13/11/2016 at 17:23.
Pushed by mvourlakos into branch 'master'.

add backgroundHints for the panel view

Summary:
This patch adds a variable called "backgroundHints"
which can be used with (NoBackground) through qml
in order to enable/disable the KWin effects for
a specific panel and the panel shadows in case the
effects are disabled.
Currently these effects are (Blur and Background Contrast)

Reviewers: #plasma, #davidedmundson

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3282

M  +64   -34   shell/panelview.cpp
M  +12   -0    shell/panelview.h

http://commits.kde.org/plasma-workspace/341a534e9d16eaf89f137136bdbff5756db78775
Comment 9 Michail Vourlakos 2016-11-13 17:39:04 UTC
Git commit b1bc4f8347fca280d7c44b2e76a40f9a7bdc44d4 by Michail Vourlakos.
Committed on 13/11/2016 at 17:35.
Pushed by mvourlakos into branch 'master'.

Hide Background for Panel if backgroundHints used

Summary:
a Panel can set,
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground;
in order to become transparent

Reviewers: #plasma, #davidedmundson

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3283

M  +13   -1    desktoppackage/contents/views/Panel.qml

http://commits.kde.org/plasma-desktop/b1bc4f8347fca280d7c44b2e76a40f9a7bdc44d4