History

expose to scripts the ability to show dedicated qml windows such as preferences

howard-stearns committed 10 years ago

Commit 347b20e1 parent 2a099d52 files · +11 −0Browse files

Showing the changes to interface/src/scripting/DesktopScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/scripting/DesktopScriptingInterface.cpp+10−0
@@ -17,6 +17,8 @@ · 16 unmodified lines
17#include "Application.h"17#include "Application.h"
18#include "MainWindow.h"18#include "MainWindow.h"
19#include <display-plugins/CompositorHelper.h>19#include <display-plugins/CompositorHelper.h>
20#include <DependencyManager.h>
21#include <OffscreenUi.h>
20 22
21int DesktopScriptingInterface::getWidth() {23int DesktopScriptingInterface::getWidth() {
22 QSize size = qApp->getWindow()->windowHandle()->screen()->virtualSize();24 QSize size = qApp->getWindow()->windowHandle()->screen()->virtualSize();
@@ -31,3 +33,11 @@ void DesktopScriptingInterface::setOverlayAlpha(float alpha) { · 8 unmodified lines
31 qApp->getApplicationCompositor().setAlpha(alpha);33 qApp->getApplicationCompositor().setAlpha(alpha);
32}34}
33 35
36void DesktopScriptingInterface::show(const QString& path, const QString& title) {
37 if (QThread::currentThread() != thread()) {
38 QMetaObject::invokeMethod(this, "show", Qt::QueuedConnection, Q_ARG(QString, path), Q_ARG(QString, title));
39 return;
40 }
41 DependencyManager::get<OffscreenUi>()->show(path, title);
42}
43