Toolbar mode: 1. Fixed switching between different apps. 2. Fixed switching from Create

This commit is contained in:
vladest 2017-08-02 16:32:09 +02:00
parent 5bdaa4daa1
commit 4330e31212
3 changed files with 8 additions and 9 deletions

View file

@ -33,7 +33,7 @@ Rectangle {
// only show the title if loaded through a "loader"
function showTitle() {
return root.parent.objectName == "loader";
return (root.parent !== null) && root.parent.objectName == "loader";
}
Column {

View file

@ -237,7 +237,6 @@ void TabletProxy::setToolbarMode(bool toolbarMode) {
}
}
loadHomeScreen(true);
emit screenChanged(QVariant("Home"), QVariant(TABLET_SOURCE_URL));
}
static void addButtonProxyToQmlTablet(QQuickItem* qmlTablet, TabletButtonProxy* buttonProxy) {
@ -463,14 +462,14 @@ void TabletProxy::loadQMLSource(const QVariant& path) {
}
if (root) {
if (_state != State::QML) {
removeButtonsFromHomeScreen();
QMetaObject::invokeMethod(root, "loadSource", Q_ARG(const QVariant&, path));
_state = State::QML;
removeButtonsFromHomeScreen(); //works only in Tablet
QMetaObject::invokeMethod(root, "loadSource", Q_ARG(const QVariant&, path));
_state = State::QML;
if (path != _currentPathLoaded) {
emit screenChanged(QVariant("QML"), path);
_currentPathLoaded = path;
QMetaObject::invokeMethod(root, "setShown", Q_ARG(const QVariant&, QVariant(true)));
}
_currentPathLoaded = path;
QMetaObject::invokeMethod(root, "setShown", Q_ARG(const QVariant&, QVariant(true)));
} else {
qCDebug(uiLogging) << "tablet cannot load QML because _qmlTabletRoot is null";
}

View file

@ -419,7 +419,7 @@ var toolBar = (function () {
createButton = activeButton;
tablet.screenChanged.connect(function (type, url) {
if (isActive && (type !== "QML" || url !== "Edit.qml")) {
that.toggle();
that.setActive(false)
}
});
tablet.fromQml.connect(fromQml);