From 7b03f5af04943e2de6f3041e67be23280219a238 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 19 Dec 2017 23:54:07 -0500 Subject: Add a new C++ object: PanelObject This is tied into the RootDesktopObject as well as the ScreenObject, resulting in global-session panels as well as per-screen panels. --- .../src-desktop/src-cpp/ScreenObject.cpp | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp') diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp index 4c1d6189..82622403 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/ScreenObject.cpp @@ -13,7 +13,12 @@ ScreenObject::ScreenObject(QScreen *scrn, QObject *parent) : QObject(parent){ } void ScreenObject::RegisterType(){ + static bool done = false; + if(done){ return; } + done=true; qmlRegisterType("Lumina.Backend.ScreenObject",2,0, "ScreenObject"); + //Also register any types that are needed by this class + PanelObject::RegisterType(); } QString ScreenObject::name(){ return bg_screen->name(); } @@ -29,3 +34,24 @@ void ScreenObject::setBackground(QString fileOrColor){ emit backgroundChanged(); } } + +void ScreenObject::setPanels(QList list){ + panel_objects = list; + emit panelsChanged(); +} + +//QML Read Functions +QStringList ScreenObject::panels(){ + //qDebug() << "Request Panels:" << panel_objects.length(); + QStringList names; + for(int i=0; iname(); } + return names; +} + +PanelObject* ScreenObject::panel(QString id){ + //qDebug() << "Got Panel Request:" << id; + for(int i=0; iname()==id){ return panel_objects[i]; } + } + return 0; +} -- cgit