mirror of
https://github.com/lubosz/overte.git
synced 2025-08-28 00:56:16 +02:00
Desktop Running scripts window now closed and as soon as Tablet opened, it will show Running Script. TODO: make Tablet opens automatically
This commit is contained in:
parent
cfd9f8b64e
commit
bb7110d81b
2 changed files with 24 additions and 1 deletions
|
@ -208,12 +208,13 @@ void TabletProxy::setToolbarMode(bool toolbarMode) {
|
|||
|
||||
_toolbarMode = toolbarMode;
|
||||
|
||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
|
||||
if (toolbarMode) {
|
||||
removeButtonsFromHomeScreen();
|
||||
addButtonsToToolbar();
|
||||
|
||||
// create new desktop window
|
||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
auto tabletRootWindow = new TabletRootWindow();
|
||||
tabletRootWindow->initQml(QVariantMap());
|
||||
auto quickItem = tabletRootWindow->asQuickItem();
|
||||
|
@ -230,16 +231,37 @@ void TabletProxy::setToolbarMode(bool toolbarMode) {
|
|||
removeButtonsFromToolbar();
|
||||
addButtonsToHomeScreen();
|
||||
|
||||
//check if running scripts opened and save it for reopen in Tablet
|
||||
if (offscreenUi->isVisible("RunningScripts")) {
|
||||
offscreenUi->hide("RunningScripts");
|
||||
_showRunningScripts = true;
|
||||
}
|
||||
// destroy desktop window
|
||||
if (_desktopWindow) {
|
||||
_desktopWindow->deleteLater();
|
||||
_desktopWindow = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
loadHomeScreen(true);
|
||||
emit screenChanged(QVariant("Home"), QVariant(TABLET_SOURCE_URL));
|
||||
|
||||
//connect to Tablet shown signal to open running scripts
|
||||
if (_showRunningScripts) {
|
||||
QMetaObject::invokeMethod(qApp, "toggleTabletUI", Q_ARG(bool, true));
|
||||
//qApp->toggleTabletUI(true);
|
||||
auto conn = std::make_shared<QMetaObject::Connection>();
|
||||
*conn = connect(this, &TabletProxy::tabletShownChanged, this, [this, conn] {
|
||||
QObject::disconnect(*conn);
|
||||
if (_tabletShown && _showRunningScripts) {
|
||||
_showRunningScripts = false;
|
||||
pushOntoStack("../../hifi/dialogs/TabletRunningScripts.qml");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void addButtonProxyToQmlTablet(QQuickItem* qmlTablet, TabletButtonProxy* buttonProxy) {
|
||||
Q_ASSERT(QThread::currentThread() == qApp->thread());
|
||||
if (buttonProxy == NULL){
|
||||
|
|
|
@ -252,6 +252,7 @@ protected:
|
|||
enum class State { Uninitialized, Home, Web, Menu, QML };
|
||||
State _state { State::Uninitialized };
|
||||
bool _landscape { false };
|
||||
bool _showRunningScripts { false };
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(TabletProxy*);
|
||||
|
|
Loading…
Reference in a new issue