mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:18:38 +02:00
Merge pull request #11103 from vladest/fix_toolbar_apps_switch
Fix toolbar apps switch
This commit is contained in:
commit
6680be2a03
3 changed files with 8 additions and 9 deletions
|
@ -33,7 +33,7 @@ Rectangle {
|
||||||
|
|
||||||
// only show the title if loaded through a "loader"
|
// only show the title if loaded through a "loader"
|
||||||
function showTitle() {
|
function showTitle() {
|
||||||
return root.parent.objectName == "loader";
|
return (root.parent !== null) && root.parent.objectName == "loader";
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|
|
@ -241,7 +241,6 @@ void TabletProxy::setToolbarMode(bool toolbarMode) {
|
||||||
_desktopWindow = nullptr;
|
_desktopWindow = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit screenChanged(QVariant("Home"), QVariant(TABLET_SOURCE_URL));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void addButtonProxyToQmlTablet(QQuickItem* qmlTablet, TabletButtonProxy* buttonProxy) {
|
static void addButtonProxyToQmlTablet(QQuickItem* qmlTablet, TabletButtonProxy* buttonProxy) {
|
||||||
|
@ -467,14 +466,14 @@ void TabletProxy::loadQMLSource(const QVariant& path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root) {
|
if (root) {
|
||||||
if (_state != State::QML) {
|
removeButtonsFromHomeScreen(); //works only in Tablet
|
||||||
removeButtonsFromHomeScreen();
|
|
||||||
QMetaObject::invokeMethod(root, "loadSource", Q_ARG(const QVariant&, path));
|
QMetaObject::invokeMethod(root, "loadSource", Q_ARG(const QVariant&, path));
|
||||||
_state = State::QML;
|
_state = State::QML;
|
||||||
|
if (path != _currentPathLoaded) {
|
||||||
emit screenChanged(QVariant("QML"), path);
|
emit screenChanged(QVariant("QML"), path);
|
||||||
|
}
|
||||||
_currentPathLoaded = path;
|
_currentPathLoaded = path;
|
||||||
QMetaObject::invokeMethod(root, "setShown", Q_ARG(const QVariant&, QVariant(true)));
|
QMetaObject::invokeMethod(root, "setShown", Q_ARG(const QVariant&, QVariant(true)));
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
qCDebug(uiLogging) << "tablet cannot load QML because _qmlTabletRoot is null";
|
qCDebug(uiLogging) << "tablet cannot load QML because _qmlTabletRoot is null";
|
||||||
}
|
}
|
||||||
|
|
|
@ -417,7 +417,7 @@ var toolBar = (function () {
|
||||||
createButton = activeButton;
|
createButton = activeButton;
|
||||||
tablet.screenChanged.connect(function (type, url) {
|
tablet.screenChanged.connect(function (type, url) {
|
||||||
if (isActive && (type !== "QML" || url !== "Edit.qml")) {
|
if (isActive && (type !== "QML" || url !== "Edit.qml")) {
|
||||||
that.toggle();
|
that.setActive(false)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
tablet.fromQml.connect(fromQml);
|
tablet.fromQml.connect(fromQml);
|
||||||
|
|
Loading…
Reference in a new issue