diff options
author | Weblate <noreply@weblate.org> | 2017-12-27 22:24:48 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2017-12-27 22:24:48 +0000 |
commit | 107851adab5f573e331150847b48f499edbcfbb9 (patch) | |
tree | 28aac1799650b0c51530130817e63e4c6381127a /src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/PanelObject.cpp | |
parent | Translated using Weblate (Danish) (diff) | |
parent | Shifted from a custom QWidget to a subclass of QGraphicalView and connected i... (diff) | |
download | lumina-107851adab5f573e331150847b48f499edbcfbb9.tar.gz lumina-107851adab5f573e331150847b48f499edbcfbb9.tar.bz2 lumina-107851adab5f573e331150847b48f499edbcfbb9.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/PanelObject.cpp')
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/PanelObject.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/PanelObject.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/PanelObject.cpp new file mode 100644 index 00000000..471da58f --- /dev/null +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-cpp/PanelObject.cpp @@ -0,0 +1,44 @@ +//=========================================== +// Lumina-desktop source code +// Copyright (c) 2017, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "PanelObject.h" +#include <QQmlEngine> +#include <QDebug> + +PanelObject::PanelObject(QString id, QObject *parent) : QObject(parent){ + panel_id = id; +} + +void PanelObject::RegisterType(){ + static bool done = false; + if(done){ return; } + done=true; + qmlRegisterType<PanelObject>("Lumina.Backend.PanelObject",2,0, "PanelObject"); +} + +QString PanelObject::name(){ return panel_id; } +QString PanelObject::background(){ + if(bg.isEmpty()){ return "transparent"; } + return bg; +} +int PanelObject::x(){ return geom.x(); } +int PanelObject::y(){ return geom.y(); } +int PanelObject::width(){ return geom.width(); } +int PanelObject::height(){ return geom.height(); } + +void PanelObject::setBackground(QString fileOrColor){ + if(bg!=fileOrColor){ + bg = fileOrColor; + emit backgroundChanged(); + } +} + +void PanelObject::setGeometry( QRect newgeom ){ + if(geom!=newgeom){ + geom = newgeom; + emit geomChanged(); + } +} |