]> rtime.felk.cvut.cz Git - coffee/mtbrowser.git/blobdiff - main.qml
add shell script
[coffee/mtbrowser.git] / main.qml
index bf89577b28bf28decc53d051ab0c2115c6613176..b5068426d5d90f1774c70ba7414d2d870a4d32d5 100644 (file)
--- a/main.qml
+++ b/main.qml
@@ -68,36 +68,42 @@ Window {
             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
-                onEditingFinished: {
-                    webView.url = "https://www.google.com/search?ie=UTF-8&q=" + urlText.text
-                    clear()
-                }
+                placeholderText: "Google"
+                onEditingFinished: search()
+                inputMethodHints: Qt.ImhNoAutoUppercase
             }
 
             ToolButton {
                 id: reload
-                text: qsTr("↻")
+                text: "↻"
                 onClicked: webView.reload()
             }
 
             ToolButton {
                 id: stop
-                text: qsTr("×")
+                text: "×"
                 onClicked: webView.url = "http://localhost/"
             }
         }
@@ -111,6 +117,7 @@ Window {
         anchors.right: parent.right
         anchors.bottom: inputPanel.top
         //onUrlChanged: urlText.text = webView.url
+
     }
 
     InputPanel {