D23651: WIP: Add support for a theming in Kicker Dashboard
David Redondo
noreply at phabricator.kde.org
Mon Sep 2 16:18:16 BST 2019
davidre added a comment.
The reason it's transparent is because the clear color of the buffer is set to the background color when it's changed [1][2].
This worked before probably because the Color was (0, 0, 0). For transparent windows we need to set it to `Qt::transparent`[3] and enable an alpha buffer[4].
F7309362: Screenshot_20190902_171545.png <https://phabricator.kde.org/F7309362>
diff --git a/applets/kicker/plugin/dashboardwindow.cpp b/applets/kicker/plugin/dashboardwindow.cpp
index 6665e8df7..cc6b70c32 100644
--- a/applets/kicker/plugin/dashboardwindow.cpp
+++ b/applets/kicker/plugin/dashboardwindow.cpp
@@ -32,6 +32,8 @@ DashboardWindow::DashboardWindow(QQuickItem *parent) : QQuickWindow(parent ? par
, m_visualParentWindow(nullptr)
{
setClearBeforeRendering(true);
+ setDefaultAlphaBuffer(true);
+ setColor(Qt::transparent);
setFlags(Qt::FramelessWindowHint);
setIcon(QIcon::fromTheme(QStringLiteral("plasma")));
@@ -100,8 +102,6 @@ QColor DashboardWindow::backgroundColor() const
void DashboardWindow::setBackgroundColor(const QColor &c)
{
if (color() != c) {
- setColor(c);
-
emit backgroundColorChanged();
}
}
[1] https://cgit.kde.org/plasma-desktop.git/tree/applets/kicker/plugin/dashboardwindow.cpp#n103
[2]https://doc.qt.io/qt-5/qquickwindow.html#color-prop
[3]https://doc.qt.io/qt-5/qquickwidget.html#details (see Limitations)
[4]https://doc.qt.io/qt-5/qquickwindow.html#setDefaultAlphaBuffer
REPOSITORY
R119 Plasma Desktop
REVISION DETAIL
https://phabricator.kde.org/D23651
To: ognarb, #plasma, #vdg
Cc: davidre, felixernst, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190902/3a993c09/attachment-0001.html>
More information about the Plasma-devel
mailing list