diff options
-rw-r--r-- | basicsuite/webengine/main.qml | 11 | ||||
-rw-r--r-- | basicsuite/webengine/ui/PageView.qml | 12 |
2 files changed, 15 insertions, 8 deletions
diff --git a/basicsuite/webengine/main.qml b/basicsuite/webengine/main.qml index 6b7a989..2295ea4 100644 --- a/basicsuite/webengine/main.qml +++ b/basicsuite/webengine/main.qml @@ -180,14 +180,12 @@ Rectangle { id: homeButton width: 20 Layout.fillHeight: true - iconSource: pageView.opacity == 1 ? "ui/icons/window.png" : "ui/icons/home.png" + iconSource: pageView.enabled ? "ui/icons/window.png" : "ui/icons/home.png" onClicked: { - if (pageView.opacity == 0) { - pageView.enabled = true - pageView.opacity = 1 + if (pageView.enabled) { + pageView.hide() } else { - pageView.enabled = false - pageView.opacity = 0 + pageView.show() } } } @@ -213,6 +211,7 @@ Rectangle { Layout.fillWidth: true text: mainWebView.url onAccepted: { + pageView.hide() mainWebView.url = engine.fromUserInput(text) } } diff --git a/basicsuite/webengine/ui/PageView.qml b/basicsuite/webengine/ui/PageView.qml index ac95306..49ed103 100644 --- a/basicsuite/webengine/ui/PageView.qml +++ b/basicsuite/webengine/ui/PageView.qml @@ -46,6 +46,14 @@ Rectangle { id: root color: "darkgrey" visible: true + function show() { + enabled = true + opacity = 1 + } + function hide() { + enabled = false + opacity = 0 + } anchors { fill: parent } @@ -61,7 +69,7 @@ Rectangle { anchors.fill: parent onClicked: { load(Qt.resolvedUrl("../content/webgl/helloqt.html")) - homeButton.clicked() + hide() } } } @@ -73,7 +81,7 @@ Rectangle { anchors.fill: parent onClicked: { load(Qt.resolvedUrl("../content/csstetrahedron/index.html")) - homeButton.clicked() + hide() } } } |