diff options
author | Ken Moore <ken@ixsystems.com> | 2017-10-13 16:25:18 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-10-13 16:25:18 -0400 |
commit | d04f35ab9b827085d1cbee0bc2f7cae7787557ef (patch) | |
tree | 36a40cc20324aee82f4d2944cb2b54161522491c /src-qt5/src-cpp/ScreenObject.cpp | |
parent | Another checkpoint commit - almost ready to start running tests with QML for ... (diff) | |
download | lumina-d04f35ab9b827085d1cbee0bc2f7cae7787557ef.tar.gz lumina-d04f35ab9b827085d1cbee0bc2f7cae7787557ef.tar.bz2 lumina-d04f35ab9b827085d1cbee0bc2f7cae7787557ef.zip |
Another checkpoint commit for Lumina 2
Almost have the QML-based desktop canvas working - still tracking down some QML syntax issues.
Diffstat (limited to 'src-qt5/src-cpp/ScreenObject.cpp')
-rw-r--r-- | src-qt5/src-cpp/ScreenObject.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src-qt5/src-cpp/ScreenObject.cpp b/src-qt5/src-cpp/ScreenObject.cpp new file mode 100644 index 00000000..354b4cba --- /dev/null +++ b/src-qt5/src-cpp/ScreenObject.cpp @@ -0,0 +1,30 @@ +//=========================================== +// Lumina-desktop source code +// Copyright (c) 2017, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#include "ScreenObject.h" +#include <QQmlEngine> + +ScreenObject::ScreenObject(QScreen *scrn, QObject *parent) : QObject(parent){ + bg_screen = scrn; +} + +void ScreenObject::RegisterType(){ + qmlRegisterType<ScreenObject>("Lumina.Backend.ScreenObject",2,0, "ScreenObject"); +} + +QString ScreenObject::name(){ return bg_screen->name(); } +QString ScreenObject::background(){ return bg; } +int ScreenObject::x(){ return bg_screen->geometry().x(); } +int ScreenObject::y(){ return bg_screen->geometry().y(); } +int ScreenObject::width(){ return bg_screen->geometry().width(); } +int ScreenObject::height(){ return bg_screen->geometry().height(); } + +void ScreenObject::setBackground(QString fileOrColor){ + if(bg!=fileOrColor){ + bg = fileOrColor; + emit backgroundChanged(); + } +} |