1 |
commit: efa9b0716a63951bbbaf8c4b64cbbc54cc044983 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 4 19:47:43 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 4 20:16:53 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=efa9b071 |
7 |
|
8 |
kde-plasma/plasma-desktop: Backport 5.22 adaptive opacity feature |
9 |
|
10 |
This raises the minimum required KDE Frameworks version to 5.82.0 |
11 |
which is carrying the necessary backport in kde-frameworks/plasma. |
12 |
|
13 |
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=434202 |
14 |
Package-Manager: Portage-3.0.18, Repoman-3.0.3 |
15 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
16 |
|
17 |
.../files/plasma-desktop-5.21.5-transparency.patch | 239 +++++++++++++++++++++ |
18 |
.../plasma-desktop/plasma-desktop-5.21.5.ebuild | 1 + |
19 |
2 files changed, 240 insertions(+) |
20 |
|
21 |
diff --git a/kde-plasma/plasma-desktop/files/plasma-desktop-5.21.5-transparency.patch b/kde-plasma/plasma-desktop/files/plasma-desktop-5.21.5-transparency.patch |
22 |
new file mode 100644 |
23 |
index 0000000000..3066d3a274 |
24 |
--- /dev/null |
25 |
+++ b/kde-plasma/plasma-desktop/files/plasma-desktop-5.21.5-transparency.patch |
26 |
@@ -0,0 +1,239 @@ |
27 |
+From 6fb37dc0260c298bc35ec5e39399aa1f31693e79 Mon Sep 17 00:00:00 2001 |
28 |
+From: Carson Black <uhhadd@×××××.com> |
29 |
+Date: Thu, 6 Aug 2020 11:58:23 +0200 |
30 |
+Subject: [PATCH] Implement adaptive opacity for panels |
31 |
+ |
32 |
+--- |
33 |
+ .../contents/applet/CompactApplet.qml | 1 + |
34 |
+ .../panelconfiguration/MoreSettingsMenu.qml | 35 +++++ |
35 |
+ desktoppackage/contents/views/Panel.qml | 144 +++++++++++++++++- |
36 |
+ 3 files changed, 174 insertions(+), 6 deletions(-) |
37 |
+ |
38 |
+diff --git a/desktoppackage/contents/applet/CompactApplet.qml b/desktoppackage/contents/applet/CompactApplet.qml |
39 |
+index 0d4c85f52..65eb0468e 100644 |
40 |
+--- a/desktoppackage/contents/applet/CompactApplet.qml |
41 |
++++ b/desktoppackage/contents/applet/CompactApplet.qml |
42 |
+@@ -153,6 +153,7 @@ PlasmaCore.ToolTipArea { |
43 |
+ visualParent: compactRepresentation ? compactRepresentation : null |
44 |
+ location: plasmoid.location |
45 |
+ hideOnWindowDeactivate: plasmoid.hideOnWindowDeactivate |
46 |
++ backgroundHints: (plasmoid.containmentDisplayHints & PlasmaCore.Types.DesktopFullyCovered) ? PlasmaCore.Dialog.SolidBackground : PlasmaCore.Dialog.StandardBackground |
47 |
+ |
48 |
+ property var oldStatus: PlasmaCore.Types.UnknownStatus |
49 |
+ |
50 |
+diff --git a/desktoppackage/contents/configuration/panelconfiguration/MoreSettingsMenu.qml b/desktoppackage/contents/configuration/panelconfiguration/MoreSettingsMenu.qml |
51 |
+index 2e577fbcc..d668eb3c2 100644 |
52 |
+--- a/desktoppackage/contents/configuration/panelconfiguration/MoreSettingsMenu.qml |
53 |
++++ b/desktoppackage/contents/configuration/panelconfiguration/MoreSettingsMenu.qml |
54 |
+@@ -131,6 +131,41 @@ PlasmaCore.Dialog { |
55 |
+ flat: false |
56 |
+ } |
57 |
+ } |
58 |
++ PlasmaExtras.Heading { |
59 |
++ level: 3 |
60 |
++ text: i18nd("plasma_shell_org.kde.plasma.desktop", "Opacity") |
61 |
++ visible: panel.adaptiveOpacityEnabled |
62 |
++ } |
63 |
++ PlasmaComponents.ButtonColumn { |
64 |
++ spacing: 0 |
65 |
++ visible: panel.adaptiveOpacityEnabled |
66 |
++ Layout.fillWidth: true |
67 |
++ Layout.minimumWidth: implicitWidth |
68 |
++ PlasmaComponents.ToolButton { |
69 |
++ width: Math.max(implicitWidth, parent.width) |
70 |
++ text: i18nd("plasma_shell_org.kde.plasma.desktop", "Adaptive") |
71 |
++ checkable: true |
72 |
++ checked: configDialog.opacityMode === 0 |
73 |
++ onClicked: configDialog.opacityMode = 0 |
74 |
++ flat: false |
75 |
++ } |
76 |
++ PlasmaComponents.ToolButton { |
77 |
++ width: Math.max(implicitWidth, parent.width) |
78 |
++ text: i18nd("plasma_shell_org.kde.plasma.desktop", "Opaque") |
79 |
++ checkable: true |
80 |
++ checked: configDialog.opacityMode === 1 |
81 |
++ onClicked: configDialog.opacityMode = 1 |
82 |
++ flat: false |
83 |
++ } |
84 |
++ PlasmaComponents.ToolButton { |
85 |
++ width: Math.max(implicitWidth, parent.width) |
86 |
++ text: i18nd("plasma_shell_org.kde.plasma.desktop", "Translucent") |
87 |
++ checkable: true |
88 |
++ checked: configDialog.opacityMode === 2 |
89 |
++ onClicked: configDialog.opacityMode = 2 |
90 |
++ flat: false |
91 |
++ } |
92 |
++ } |
93 |
+ PlasmaComponents.ToolButton { |
94 |
+ Layout.fillWidth: true |
95 |
+ text: i18nd("plasma_shell_org.kde.plasma.desktop", "Maximize Panel") |
96 |
+diff --git a/desktoppackage/contents/views/Panel.qml b/desktoppackage/contents/views/Panel.qml |
97 |
+index 2fd6ac4d5..cf6c04328 100644 |
98 |
+--- a/desktoppackage/contents/views/Panel.qml |
99 |
++++ b/desktoppackage/contents/views/Panel.qml |
100 |
+@@ -21,17 +21,27 @@ import QtQuick.Layouts 1.1 |
101 |
+ import QtQml 2.15 |
102 |
+ |
103 |
+ import org.kde.plasma.core 2.0 as PlasmaCore |
104 |
++import org.kde.taskmanager 0.1 as TaskManager |
105 |
+ |
106 |
+-PlasmaCore.FrameSvgItem { |
107 |
++Item { |
108 |
+ id: root |
109 |
+ |
110 |
+- imagePath: containment && containment.backgroundHints === PlasmaCore.Types.NoBackground ? "" : "widgets/panel-background" |
111 |
+- |
112 |
+- enabledBorders: panel.enabledBorders |
113 |
+- |
114 |
+ property Item containment |
115 |
+ |
116 |
+- property alias panelMask: root.mask |
117 |
++ property alias panelMask: privateSwapper.mask |
118 |
++ |
119 |
++ QtObject { |
120 |
++ id: privateSwapper |
121 |
++ property string completedState: "" |
122 |
++ // Work around the fact that we can't use a ternary if in an alias |
123 |
++ readonly property var mask: { |
124 |
++ if (completedState == "opaque") { |
125 |
++ return opaqueItem.mask |
126 |
++ } else { |
127 |
++ return translucentItem.mask |
128 |
++ } |
129 |
++ } |
130 |
++ } |
131 |
+ |
132 |
+ readonly property bool verticalPanel: containment && containment.formFactor === PlasmaCore.Types.Vertical |
133 |
+ |
134 |
+@@ -47,6 +57,128 @@ PlasmaCore.FrameSvgItem { |
135 |
+ readonly property int leftPadding: Math.round(Math.min(thickPanelSvg.fixedMargins.left, spacingAtMinSize)); |
136 |
+ readonly property int rightPadding: Math.round(Math.min(thickPanelSvg.fixedMargins.right, spacingAtMinSize)); |
137 |
+ |
138 |
++ TaskManager.VirtualDesktopInfo { |
139 |
++ id: virtualDesktopInfo |
140 |
++ } |
141 |
++ |
142 |
++ TaskManager.ActivityInfo { |
143 |
++ id: activityInfo |
144 |
++ } |
145 |
++ |
146 |
++ PlasmaCore.SortFilterModel { |
147 |
++ id: visibleWindowsModel |
148 |
++ filterRole: 'IsMinimized' |
149 |
++ filterRegExp: 'false' |
150 |
++ sourceModel: TaskManager.TasksModel { |
151 |
++ filterByVirtualDesktop: true |
152 |
++ filterByActivity: true |
153 |
++ filterNotMaximized: true |
154 |
++ filterByScreen: true |
155 |
++ |
156 |
++ screenGeometry: panel.screenGeometry |
157 |
++ virtualDesktop: virtualDesktopInfo.currentDesktop |
158 |
++ activity: activityInfo.currentActivity |
159 |
++ |
160 |
++ id: tasksModel |
161 |
++ groupMode: TaskManager.TasksModel.GroupDisabled |
162 |
++ } |
163 |
++ } |
164 |
++ |
165 |
++ PlasmaCore.FrameSvgItem { |
166 |
++ id: translucentItem |
167 |
++ enabledBorders: panel.enabledBorders |
168 |
++ anchors.fill: parent |
169 |
++ |
170 |
++ imagePath: containment && containment.backgroundHints === PlasmaCore.Types.NoBackground ? "" : "widgets/panel-background" |
171 |
++ } |
172 |
++ |
173 |
++ PlasmaCore.FrameSvgItem { |
174 |
++ id: opaqueItem |
175 |
++ enabledBorders: panel.enabledBorders |
176 |
++ anchors.fill: parent |
177 |
++ |
178 |
++ imagePath: containment && containment.backgroundHints === PlasmaCore.Types.NoBackground ? "" : "solid/widgets/panel-background" |
179 |
++ } |
180 |
++ |
181 |
++ transitions: [ |
182 |
++ Transition { |
183 |
++ from: "*" |
184 |
++ to: "transparent" |
185 |
++ SequentialAnimation { |
186 |
++ ScriptAction { |
187 |
++ script: { |
188 |
++ translucentItem.visible = true |
189 |
++ } |
190 |
++ } |
191 |
++ NumberAnimation { |
192 |
++ target: opaqueItem |
193 |
++ properties: "opacity" |
194 |
++ from: 1 |
195 |
++ to: 0 |
196 |
++ duration: units.veryLongDuration |
197 |
++ easing.type: Easing.InOutQuad |
198 |
++ } |
199 |
++ ScriptAction { |
200 |
++ script: { |
201 |
++ opaqueItem.visible = false |
202 |
++ privateSwapper.completedState = "transparent" |
203 |
++ root.panelMaskChanged() |
204 |
++ } |
205 |
++ } |
206 |
++ } |
207 |
++ }, |
208 |
++ Transition { |
209 |
++ from: "*" |
210 |
++ to: "opaque" |
211 |
++ SequentialAnimation { |
212 |
++ ScriptAction { |
213 |
++ script: { |
214 |
++ opaqueItem.visible = true |
215 |
++ } |
216 |
++ } |
217 |
++ NumberAnimation { |
218 |
++ target: opaqueItem |
219 |
++ properties: "opacity" |
220 |
++ from: 0 |
221 |
++ to: 1 |
222 |
++ duration: units.veryLongDuration |
223 |
++ easing.type: Easing.InOutQuad |
224 |
++ } |
225 |
++ ScriptAction { |
226 |
++ script: { |
227 |
++ translucentItem.visible = false |
228 |
++ privateSwapper.completedState = "opaque" |
229 |
++ root.panelMaskChanged() |
230 |
++ } |
231 |
++ } |
232 |
++ } |
233 |
++ } |
234 |
++ ] |
235 |
++ |
236 |
++ Component.onCompleted: { |
237 |
++ state = Qt.binding(function() { |
238 |
++ let mstate = ''; |
239 |
++ if (panel.opacityMode == 0) { |
240 |
++ mstate = visibleWindowsModel.count > 0 ? "opaque" : "transparent" |
241 |
++ } else if (panel.opacityMode == 1) { |
242 |
++ mstate = "opaque" |
243 |
++ } else { |
244 |
++ mstate = "transparent" |
245 |
++ } |
246 |
++ if (mstate == 'opaque') { |
247 |
++ containment.containmentDisplayHints |= PlasmaCore.Types.DesktopFullyCovered; |
248 |
++ } else { |
249 |
++ containment.containmentDisplayHints &= ~PlasmaCore.Types.DesktopFullyCovered; |
250 |
++ } |
251 |
++ return mstate; |
252 |
++ }) |
253 |
++ } |
254 |
++ state: "" |
255 |
++ states: [ |
256 |
++ State { name: "opaque" }, |
257 |
++ State { name: "transparent" } |
258 |
++ ] |
259 |
++ |
260 |
+ function adjustPrefix() { |
261 |
+ if (!containment) { |
262 |
+ return ""; |
263 |
+-- |
264 |
+GitLab |
265 |
+ |
266 |
|
267 |
diff --git a/kde-plasma/plasma-desktop/plasma-desktop-5.21.5.ebuild b/kde-plasma/plasma-desktop/plasma-desktop-5.21.5.ebuild |
268 |
index 8b159345b5..385b90d132 100644 |
269 |
--- a/kde-plasma/plasma-desktop/plasma-desktop-5.21.5.ebuild |
270 |
+++ b/kde-plasma/plasma-desktop/plasma-desktop-5.21.5.ebuild |
271 |
@@ -120,6 +120,7 @@ RDEPEND="${COMMON_DEPEND} |
272 |
|
273 |
PATCHES=( |
274 |
"${WORKDIR}/${XORGHDRS}/override-include-dirs.patch" # downstream patch |
275 |
+ "${FILESDIR}/${P}-transparency.patch" # KDE-bug 434202 |
276 |
) |
277 |
|
278 |
src_prepare() { |