diff options
author | Ken Moore <ken@ixsystems.com> | 2018-05-23 06:59:36 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2018-05-23 06:59:36 -0400 |
commit | 9c1b38d66f79a953bfdec37cea96b8aa128a0229 (patch) | |
tree | 49ed14e5c7b4949b256220bad2733bd36a484d58 /src-qt5/core/lumina-desktop-unified | |
parent | A little bit of cleanup for Lumina 1, try to get better detection of when the... (diff) | |
download | lumina-9c1b38d66f79a953bfdec37cea96b8aa128a0229.tar.gz lumina-9c1b38d66f79a953bfdec37cea96b8aa128a0229.tar.bz2 lumina-9c1b38d66f79a953bfdec37cea96b8aa128a0229.zip |
Add the NativeEmbedWidget.h file to git (forgot to include previously)
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified')
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeEmbedWidget.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeEmbedWidget.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeEmbedWidget.h new file mode 100644 index 00000000..f9cc52b7 --- /dev/null +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/NativeEmbedWidget.h @@ -0,0 +1,49 @@ +//=========================================== +// Lumina-desktop source code +// Copyright (c) 2018, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +#ifndef _DESKTOP_WINDOW_EMBED_WIDGET_H +#define _DESKTOP_WINDOW_EMBED_WIDGET_H +#include <global-includes.h> + +class NativeEmbedWidget : public QObject{ + Q_OBJECT +private: + QWidget *embedW; + QWindow *_window; + NativeWindowObject *WIN; + +private slots: + void visibleChanged(bool show){ WIN->setProperty(NativeWindowObject::Visible, show); } + void windowTitleChanged(QString title){ WIN->setProperty(NativeWindowObject::Title, title); } + void heightChanged(int val){ qDebug() << "Got Wndow Height change:" << val; } //WIN->setProperty(NativeWindowObject::Size, QSize(WIN->property(NativeWindowObject::Size).toSize().width(),val) ); } + void widthChanged(int val){ qDebug() << "Got Wndow Width change:" << val; } // WIN->setProperty(NativeWindowObject::Size, QSize(val, WIN->property(NativeWindowObject::Size).toSize().height()) ); } + void xChanged(int val){ qDebug() << "Got Window X changed:" << val; } + void yChanged(int val){ qDebug() << "Got Window Y changed:" << val; } + + +public: + NativeEmbedWidget(QWidget *parent, NativeWindowObject *obj) : QObject(parent){ + WIN = obj; + _window = QWindow::fromWinId(WIN->id()); + embedW = QWidget::createWindowContainer(_window, parent); + //Setup all the internal connections + connect(_window, SIGNAL(visibleChanged(bool)), this, SLOT(visibleChanged(bool)) ); + connect(_window, SIGNAL(windowTitleChanged(const QString&)), this, SLOT(windowTitleChanged(const QString&)) ); + connect(_window, SIGNAL(widthChanged(int)), this, SLOT(widthChanged(int)) ); + connect(_window, SIGNAL(heightChanged(int)), this, SLOT(heightChanged(int)) ); + connect(_window, SIGNAL(xChanged(int)), this, SLOT(xChanged(int)) ); + connect(_window, SIGNAL(yChanged(int)), this, SLOT(yChanged(int)) ); + } + ~NativeEmbedWidget(){} + + QWidget* widget(){ return embedW; } + +public slots: + void activateWindow(){ _window->requestActivate(); } + +}; + +#endif |