]> rtime.felk.cvut.cz Git - coffee/mtbrowser.git/blobdiff - main.qml
text formatted
[coffee/mtbrowser.git] / main.qml
index 9f5dadc79ea5d3f43eab55c7b274f8e96aabeb52..b5068426d5d90f1774c70ba7414d2d870a4d32d5 100644 (file)
--- a/main.qml
+++ b/main.qml
@@ -65,38 +65,59 @@ Window {
         anchors.right: parent.right
 
         RowLayout {
+            anchors.fill: parent
 
             ToolButton {
-                text: qsTr("←")
+                text: "←"
                 onClicked: webView.goBack()
                 enabled: webView.canGoBack
             }
 
             ToolButton {
-                text: qsTr("→")
+                text: "→"
                 onClicked: webView.goForward()
                 enabled: webView.canGoForward
             }
 
+            TextField {
+                function search() {
+                    if (length > 0) {
+                        webView.url = "https://www.google.com/search?ie=UTF-8&q=" + text
+                        clear()
+                    }
+                }
+
+                id: urlText
+                Layout.fillWidth: true
+                selectByMouse: true
+                placeholderText: "Google"
+                onEditingFinished: search()
+                inputMethodHints: Qt.ImhNoAutoUppercase
+            }
+
             ToolButton {
-                text: qsTr("↻")
+                id: reload
+                text: "↻"
                 onClicked: webView.reload()
             }
 
-            Label {
-                id: urlText
+            ToolButton {
+                id: stop
+                text: "×"
+                onClicked: webView.url = "http://localhost/"
             }
         }
     }
 
     WebEngineView {
         id: webView
-        url: "https://google.cz/"
+        url: "http://localhost/"
         anchors.left: parent.left
         anchors.top: toolBar.bottom
         anchors.right: parent.right
         anchors.bottom: inputPanel.top
-        onUrlChanged: urlText.text = webView.url
+        //onUrlChanged: urlText.text = webView.url
+
     }
 
     InputPanel {