From 5f051551aaca2382d8899ad2073ca5754fbcf12d Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Wed, 4 Feb 2015 20:30:54 -0200 Subject: [PATCH] browser url bar --- cmd/mist/assets/qml/main.qml | 8 +- cmd/mist/assets/qml/views/browser.qml | 164 +++++++++++++++++++++++--- 2 files changed, 157 insertions(+), 15 deletions(-) diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 3b2c7ba731..575c15932a 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -50,7 +50,7 @@ ApplicationWindow { mainSplit.setView(wallet.view, wallet.menuItem); - newBrowserTab("http://etherian.io"); + newBrowserTab("http://ethereum-dapp-whisper-client.meteor.com/chat/ethereum"); // Command setup gui.sendCommand(0) @@ -330,6 +330,7 @@ ApplicationWindow { anchors.fill: parent resizing: false + function setView(view, menu) { for(var i = 0; i < views.length; i++) { views[i].view.visible = false @@ -367,6 +368,8 @@ ApplicationWindow { id: menu Layout.minimumWidth: 192 Layout.maximumWidth: 192 + border.width: 10 + anchors.top: parent.top Rectangle { width: parent.height @@ -680,6 +683,9 @@ ApplicationWindow { anchors.bottom: parent.bottom anchors.top: parent.top color: "#00000000" + border.width: 10 + border.color: "#00FF0F" + Rectangle { id: urlPane diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml index 6f23c4de20..5e9892e4c5 100644 --- a/cmd/mist/assets/qml/views/browser.qml +++ b/cmd/mist/assets/qml/views/browser.qml @@ -56,6 +56,8 @@ Rectangle { //uriNav.text = uri.text.replace(/(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.\w{2,3})(.*)/, "$1$2$3"); uriNav.text = uri; + appDomain.text = "some.thing" + } else { // Prevent inf loop. window.cleanPath = false; @@ -79,39 +81,163 @@ Rectangle { anchors { left: parent.left right: parent.right - leftMargin: 7 } - + Button { id: back + onClicked: { webview.goBack() } + + anchors{ + left: parent.left + leftMargin: 6 + } + style: ButtonStyle { background: Image { - source: "../../back.png" - width: 30 + source: "../../backButton.png" + width: 20 height: 30 } } } - TextField { - anchors { + + + Rectangle { + id: appInfoPane + height: 28 + color: "#FFFFFF" + radius: 6 + + MouseArea { + anchors.fill: parent + z: 10 + hoverEnabled: true + onEntered: { + uriNav.visible = true + appTitle.visible = false + appDomain.visible = false + + } + /*onExited: { + uriNav.visible = false + appTitle.visible = true + appDomain.visible = true + + }*/ + + } + + anchors { left: back.right - right: toggleInspector.left + right: parent.right leftMargin: 10 rightMargin: 10 } - text: webview.url; - id: uriNav - y: parent.height / 2 - this.height / 2 - Keys.onReturnPressed: { - webview.url = this.text; - } + Text { + id: appTitle + text: webview.title + font.bold: true + font.capitalization: Font.AllUppercase + horizontalAlignment: Text.AlignRight + verticalAlignment: Text.AlignVCenter + + anchors { + left: parent.left + right: parent.horizontalCenter + top: parent.top + bottom: parent.bottom + rightMargin: 10 + } + color: "#928484" + } + + Text { + id: appDomain + text: webview.url + font.bold: false + horizontalAlignment: Text.AlignLeft + verticalAlignment: Text.AlignVCenter + + anchors { + left: parent.horizontalCenter + right: parent.right + top: parent.top + bottom: parent.bottom + leftMargin: 10 + } + color: "#928484" + } + + + TextField { + id: uriNav + visible: false + anchors { + left: parent.left + right: parent.right + leftMargin: 16 + } + + horizontalAlignment: Text.AlignHCenter + + style: TextFieldStyle { + textColor: "#928484" + background: Rectangle { + border.width: 0 + color: "transparent" + } + } + text: webview.url; + y: parent.height / 2 - this.height / 2 + z: 20 + Keys.onReturnPressed: { + webview.url = this.text; + uriNav.visible = false + appTitle.visible = true + appDomain.visible = true + } + + } + + + + + + /*text { + id: appTitle + anchors.left: parent.left + anchors.right: parent.horizontalCenter + text: "APP TITLE" + font.bold: true + color: "#928484" + }*/ + z:2 } + + Rectangle { + id: appInfoPaneShadow + width: 10 + height: 30 + color: "#BDB6B6" + radius: 6 + anchors { + left: back.right + right: parent.right + leftMargin:10 + rightMargin:10 + top: parent.top + topMargin: 23 + } + + z:1 + } + /* Button { id: toggleInspector anchors { @@ -128,7 +254,17 @@ Rectangle { inspector.url = webview.experimental.remoteInspectorUrl } } - } + }*/ + + Rectangle { + anchors.fill: parent + gradient: Gradient { + GradientStop { position: 0.0; color: "#F6F1F2" } + GradientStop { position: 1.0; color: "#DED5D5" } + } + z:-1 + } + } // Border