]> rtime.felk.cvut.cz Git - coffee/mtbrowser.git/blobdiff - main.qml
textfield added
[coffee/mtbrowser.git] / main.qml
index 8ad5d3a0f396b3f24daf2c5c62dba6d7eaf42cec..754b329fa965a8b66828a1e540537d8e4fab26bd 100644 (file)
--- a/main.qml
+++ b/main.qml
@@ -56,8 +56,6 @@ import QtQuick.Controls 2.2
 import QtQuick.Layouts 1.3
 
 Window {
-    width: 1920
-    height: 1200
     visible: true
 
     ToolBar {
@@ -67,38 +65,37 @@ Window {
         anchors.right: parent.right
 
         RowLayout {
+            anchors.fill: parent
 
             ToolButton {
-                text: qsTr("<")
+                text: qsTr("")
                 onClicked: webView.goBack()
-                anchors.left: parent.left
+                enabled: webView.canGoBack
             }
 
             ToolButton {
-                text: qsTr(">")
+                text: qsTr("")
                 onClicked: webView.goForward()
+                enabled: webView.canGoForward
             }
 
             TextField {
                 id: urlText
-                text: ""
+                Layout.fillWidth: true
+                selectByMouse: true
+                onEditingFinished: webView.url = urlText.text
             }
 
             ToolButton {
-                text: qsTr("Reload")
+                text: qsTr("")
                 onClicked: webView.reload()
             }
-
-            ToolButton {
-                text: qsTr("Enter")
-                onClicked: webView.url = urlText.text
-            }
         }
     }
 
     WebEngineView {
         id: webView
-        url: "https://google.cz/"
+        url: "http://localhost/"
         anchors.left: parent.left
         anchors.top: toolBar.bottom
         anchors.right: parent.right
@@ -113,4 +110,3 @@ Window {
         anchors.right: parent.right
     }
 }
-