[plasma/plasma-workspace] shell/scripting: shell/scripting: expose floatingApplets on Panel

Nate Graham <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 61ad4a3dced883d26f383a609b9f4b651c59bdac by Nate Graham, on behalf of Ramil Nurmanov.
Committed on 29/07/2026 at 16:39.
Pushed by ngraham into branch 'master'.

shell/scripting: expose floatingApplets on Panel

Expose the `floatingApplets` property on the scripting `Panel` object.

This allows panel layout scripts to configure whether applets use the
floating style, just like the existing `floating` property.

BUG: 521549
FIXED-IN: 6.8.0

M  +18   -0    shell/scripting/panel.cpp
M  +4    -0    shell/scripting/panel.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/61ad4a3dced883d26f383a609b9f4b651c59bdac

diff --git a/shell/scripting/panel.cpp b/shell/scripting/panel.cpp
index 7a3376a5b4..658e9c4775 100644
--- a/shell/scripting/panel.cpp
+++ b/shell/scripting/panel.cpp
@@ -356,6 +356,24 @@ void Panel::setFloating(bool floating)
     }
 }
 
+bool Panel::floatingApplets() const
+{
+    if (panel()) {
+        return panel()->floatingApplets();
+    } else {
+        return panelConfig().parent().readEntry("floatingApplets", false);
+    }
+}
+
+void Panel::setFloatingApplets(bool floatingApplets)
+{
+    if (panel()) {
+        panel()->setFloatingApplets(floatingApplets);
+    } else {
+        panelConfig().parent().writeEntry("floatingApplets", (int)floatingApplets);
+    }
+}
+
 QString Panel::opacity() const
 {
     int opacity;
diff --git a/shell/scripting/panel.h b/shell/scripting/panel.h
index b621051a3e..47b0c2b3b9 100644
--- a/shell/scripting/panel.h
+++ b/shell/scripting/panel.h
@@ -43,6 +43,7 @@ class Panel : public Containment
     Q_PROPERTY(int height READ height WRITE setHeight)
     Q_PROPERTY(QString hiding READ hiding WRITE setHiding)
     Q_PROPERTY(bool floating READ floating WRITE setFloating)
+    Q_PROPERTY(bool floatingApplets READ floatingApplets WRITE setFloatingApplets)
     Q_PROPERTY(QString opacity READ opacity WRITE setOpacity)
 
 public:
@@ -79,6 +80,9 @@ public:
     bool floating() const;
     void setFloating(bool floating);
 
+    bool floatingApplets() const;
+    void setFloatingApplets(bool floatingApplets);
+
     QString opacity() const;
     void setOpacity(const QString &mode);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.