From 7aef0fed29ec9e0b7f65f12f242c75b39b652d47 Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Fri, 13 Feb 2015 18:32:15 +0100 Subject: changed url bar behaviour. Failed attempt at icon --- cmd/mist/assets/qml/main.qml | 14 +++-- cmd/mist/assets/qml/views/browser.qml | 110 +++++++++++++++++++--------------- cmd/mist/assets/qml/views/catalog.qml | 28 +++------ 3 files changed, 77 insertions(+), 75 deletions(-) (limited to 'cmd/mist') diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index d03ef43d9..c9505806c 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -59,13 +59,13 @@ ApplicationWindow { function activeView(view, menuItem) { mainSplit.setView(view, menuItem) - if (view.hideUrl) { + /*if (view.hideUrl) { urlPane.visible = false; mainView.anchors.top = rootView.top } else { urlPane.visible = true; mainView.anchors.top = divider.bottom - } + }*/ } function addViews(view, path, options) { @@ -120,13 +120,10 @@ ApplicationWindow { var domainAlreadyOpen = false; - console.log("requested: " + requestedDomain ) - for(var i = 0; i < mainSplit.views.length; i++) { if (mainSplit.views[i].view.url) { var matches = mainSplit.views[i].view.url.toString().match(/^[a-z]*\:\/\/(?:www\.)?([^\/?#]+)(?:[\/?#]|$)/i); var existingDomain = matches && matches[1]; - console.log("exists: " + existingDomain); if (requestedDomain == existingDomain) { domainAlreadyOpen = true; mainSplit.views[i].view.url = url; @@ -567,7 +564,9 @@ ApplicationWindow { if (parent.closable == true) { closeIcon.visible = sel.visible } - + /*if(view.hasOwnProperty("iconSource")) { + icon.source = view.iconSource; + }*/ } onExited: { closeIcon.visible = false @@ -600,10 +599,13 @@ ApplicationWindow { id: label font.family: sourceSansPro.name font.weight: Font.DemiBold + elide: Text.ElideRight anchors { left: icon.right + right: parent.right verticalCenter: parent.verticalCenter leftMargin: 6 + rightMargin: 8 // verticalCenterOffset: -10 } x:250 diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml index 04b2229ec..ff3ff0f7f 100644 --- a/cmd/mist/assets/qml/views/browser.qml +++ b/cmd/mist/assets/qml/views/browser.qml @@ -64,23 +64,15 @@ Rectangle { } function showFullUrlBar(on){ - if (on) { - //appTitle.visible = false - //appDomain.visible = false - - //uriNav.visible = true - clickAnywhereOnApp.visible = true - - navBar.state = "fullUrlVisible" - } else { - //appTitle.visible = true - //appDomain.visible = true - //uriNav.visible = false - clickAnywhereOnApp.visible = false - - navBar.state = "titleVisible" - - } + if (uriNav.focus == false ) { + if (on == false) { + clickAnywhereOnApp.visible = false + navBar.state = "titleVisible" + } else { + clickAnywhereOnApp.visible = true + navBar.state = "fullUrlVisible" + } + } } @@ -90,24 +82,40 @@ Rectangle { Item { objectName: "root" id: root - anchors.fill: parent + anchors { + fill: parent + } + state: "inspectorShown" MouseArea { id: clickAnywhereOnApp z:15 - //hoverEnabled: true - anchors.fill: parent - /*hoverEnabled: true*/ + // Using a secondary screen to catch on mouse exits for the area, because + // there are many hover actions conflicting + + anchors { + top: parent.top + topMargin: 50 + right: parent.right + bottom: parent.bottom + left: parent.left + } + hoverEnabled: true - onClicked: { + onEntered: { showFullUrlBar(false); } - /*Rectangle { - anchors.fill: parent - color: "#88888888" - }*/ + onClicked: { + uriNav.focus = false + showFullUrlBar(false); + } + + // Rectangle { + // anchors.fill: parent + // color: "#88888888" + // } } RowLayout { @@ -126,7 +134,7 @@ Rectangle { webview.goBack() } - anchors{ + anchors { left: parent.left leftMargin: 6 } @@ -146,15 +154,17 @@ Rectangle { color: "#FFFFFF" radius: 6 - MouseArea { anchors.fill: parent z: 10 hoverEnabled: true onEntered: { - showFullUrlBar(true); - } + showFullUrlBar(true); + } + /*onExited: { + showFullUrlBar(false); + }*/ } @@ -171,14 +181,15 @@ Rectangle { font.bold: true font.capitalization: Font.AllUppercase horizontalAlignment: Text.AlignRight - verticalAlignment: Text.AlignVCenter - + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + anchors { left: parent.left right: parent.horizontalCenter top: parent.top bottom: parent.bottom - rightMargin: 10 + leftMargin: 32 } color: "#928484" } @@ -189,13 +200,15 @@ Rectangle { font.bold: false horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter + elide: Text.ElideLeft anchors { left: parent.horizontalCenter right: parent.right top: parent.top bottom: parent.bottom - leftMargin: 10 + leftMargin: 32 + } color: "#C0AFAF" } @@ -212,7 +225,7 @@ Rectangle { } horizontalAlignment: Text.AlignHCenter - + style: TextFieldStyle { textColor: "#928484" background: Rectangle { @@ -227,11 +240,6 @@ Rectangle { Keys.onReturnPressed: { webview.url = this.text; } - /* onFocusedChanged: { - if (focused) { - //uriNav.selectAll(); - } - }*/ } z:2 @@ -332,18 +340,19 @@ Rectangle { bottom: parent.bottom top: navBar.bottom } - z: 10 - - onLoadingChanged: { + + z: 10 + + onLoadingChanged: { + + // this checks if your app has special header tags if (loadRequest.status == WebEngineView.LoadSucceededStatus) { webview.runJavaScript("document.title", function(pageTitle) { menuItem.title = pageTitle; }); - //var topBarStyle webView.runJavaScript("document.querySelector(\"meta[name='ethereum-dapp-url-bar-style']\").getAttribute(\"content\")", function(topBarStyle){ if (topBarStyle=="transparent") { - // Adjust for a transparent sidebar Dapp navBarBackground.visible = false; back.visible = false; @@ -362,8 +371,13 @@ Rectangle { }; }); - - + // webView.runJavaScript("document.querySelector(\"link[rel='icon']\").getAttribute(\"href\")", function(sideIcon){ + // if(sideIcon){ + // window.iconSource = "http://localhost:3000/whisper-icon@2x.png" //webview.url + sideIcon + // console.log(iconSource) + // }; + // }); + webview.runJavaScript(eth.readFile("bignumber.min.js")); webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js")); @@ -371,7 +385,7 @@ Rectangle { var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); var domain = matches && matches[1]; - appDomain.text = domain //webview.url.replace("a", "z") + appDomain.text = domain appTitle.text = webview.title showFullUrlBar(false); diff --git a/cmd/mist/assets/qml/views/catalog.qml b/cmd/mist/assets/qml/views/catalog.qml index a7832e9fa..18a835ad2 100644 --- a/cmd/mist/assets/qml/views/catalog.qml +++ b/cmd/mist/assets/qml/views/catalog.qml @@ -85,35 +85,21 @@ Rectangle { property var domain: "ethereum-dapp-catalog.meteor.com" url: protocol + domain - //navigationRequest: WebEngineView.IgnoreRequest - // onLoadingChanged: { - // if (loadRequest.status == WebEngineView.LoadSucceededStatus) { - // webview.runJavaScript(eth.readFile("bignumber.min.js")); - // webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js")); - // } - // } - - //onNavigationRequested: { - // detect URL scheme prefix, most likely an external link - //var schemaRE = /^\w+:/; - //if (schemaRE.test(request.url)) { - // request.action = WebView.AcceptRequest; - //} else { - //request.action = WebView.IgnoreRequest; - // delegate request.url here - //} - //} + + onJavaScriptConsoleMessage: { console.log(sourceID + ":" + lineNumber + ":" + JSON.stringify(message)); } - onNavigationRequested: { + onNavigationRequested: { + // this checks if the domain of the requested link is the same as the catalog's + // If it is, it opens on the same window, if it's not it opens a new tab + var cleanTitle = request.url.toString() var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); var requestedDomain = matches && matches[1]; - console.debug ("NavigationRequested: " + request.url + " navigationType=" + request.navigationType) if(request.navigationType==0){ @@ -137,7 +123,7 @@ Rectangle { anchors { left: root.left right: root.right - top: sizeGrip.bottom + top: root.top bottom: root.bottom } -- cgit v1.2.3 From 05f28088499fdc0105bb17cee9345a3483aa24f2 Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Mon, 16 Feb 2015 11:17:31 +0100 Subject: Add http when not present on browser --- cmd/mist/assets/qml/views/browser.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmd/mist') diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml index ff3ff0f7f..a6f4e3d92 100644 --- a/cmd/mist/assets/qml/views/browser.qml +++ b/cmd/mist/assets/qml/views/browser.qml @@ -238,7 +238,12 @@ Rectangle { z: 20 activeFocusOnPress: true Keys.onReturnPressed: { - webview.url = this.text; + // if there's no http, add it. + var url = this.text, + matches = url.match(/^([a-z]*\:\/\/)?([^\/.]+)(:?\/)(.*|$)/i), + requestedProtocol = (matches && matches[1] != "undefined")? "" : "http://"; + + webview.url = requestedProtocol + url; } } -- cgit v1.2.3 From 1878630b591b039fadb6f88e15340d04f4af3ed1 Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Mon, 16 Feb 2015 14:34:47 +0100 Subject: Solved Issue #318 and added states to back button --- cmd/mist/assets/backButtonDisabled.png | Bin 0 -> 634 bytes cmd/mist/assets/backButtonDisabled@2x.png | Bin 0 -> 1458 bytes cmd/mist/assets/backButtonHover.png | Bin 0 -> 657 bytes cmd/mist/assets/backButtonHover@2x.png | Bin 0 -> 1517 bytes cmd/mist/assets/qml/main.qml | 2 +- cmd/mist/assets/qml/views/browser.qml | 39 +++++++++++++++--------------- 6 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 cmd/mist/assets/backButtonDisabled.png create mode 100644 cmd/mist/assets/backButtonDisabled@2x.png create mode 100644 cmd/mist/assets/backButtonHover.png create mode 100644 cmd/mist/assets/backButtonHover@2x.png (limited to 'cmd/mist') diff --git a/cmd/mist/assets/backButtonDisabled.png b/cmd/mist/assets/backButtonDisabled.png new file mode 100644 index 000000000..428747870 Binary files /dev/null and b/cmd/mist/assets/backButtonDisabled.png differ diff --git a/cmd/mist/assets/backButtonDisabled@2x.png b/cmd/mist/assets/backButtonDisabled@2x.png new file mode 100644 index 000000000..0eaa6daa5 Binary files /dev/null and b/cmd/mist/assets/backButtonDisabled@2x.png differ diff --git a/cmd/mist/assets/backButtonHover.png b/cmd/mist/assets/backButtonHover.png new file mode 100644 index 000000000..8c5226f5a Binary files /dev/null and b/cmd/mist/assets/backButtonHover.png differ diff --git a/cmd/mist/assets/backButtonHover@2x.png b/cmd/mist/assets/backButtonHover@2x.png new file mode 100644 index 000000000..406601ebc Binary files /dev/null and b/cmd/mist/assets/backButtonHover@2x.png differ diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index c9505806c..1272f8761 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -485,7 +485,7 @@ ApplicationWindow { label.visible = !on buttonLabel.visible = on } - + width: 192 height: 55 color: "#00000000" diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml index a6f4e3d92..3a35c2a65 100644 --- a/cmd/mist/assets/qml/views/browser.qml +++ b/cmd/mist/assets/qml/views/browser.qml @@ -129,9 +129,9 @@ Rectangle { Button { id: back - - onClicked: { - webview.goBack() + z: 30 + onClicked: { + webview.goBack() } anchors { @@ -140,21 +140,23 @@ Rectangle { } style: ButtonStyle { - background: Image { - source: "../../backButton.png" - width: 20 - height: 30 - } + background: Image { + source: (webview.canGoBack) ? + (control.hovered ? "../../backButtonHover.png" : "../../backButton.png") : + "../../backButtonDisabled.png" + width: 20 + height: 30 + } } } Rectangle { - id: appInfoPane - height: 28 - color: "#FFFFFF" - radius: 6 - - MouseArea { + id: appInfoPane + height: 28 + color: "#FFFFFF" + radius: 6 + z:2 + MouseArea { anchors.fill: parent z: 10 hoverEnabled: true @@ -247,7 +249,7 @@ Rectangle { } } - z:2 + } Rectangle { @@ -256,6 +258,7 @@ Rectangle { height: 30 color: "#BDB6B6" radius: 6 + z:1 anchors { left: back.right @@ -264,19 +267,17 @@ Rectangle { rightMargin:10 top: parent.top topMargin: 23 - } - - z:1 + } } Rectangle { id: navBarBackground anchors.fill: parent + z:-1 gradient: Gradient { GradientStop { position: 0.0; color: "#F6F1F2" } GradientStop { position: 1.0; color: "#DED5D5" } } - z:-1 } states: [ -- cgit v1.2.3 From 666ef482392340ba111fa3347160468266ff3cb5 Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Mon, 16 Feb 2015 20:55:14 +0100 Subject: SideIcons work. Copy paste still doesn't. --- cmd/mist/assets/ext/mist.js | 35 +++++++++++++++++++++++++++++++++++ cmd/mist/assets/qml/views/browser.qml | 23 +++++++++++------------ cmd/mist/assets/qml/views/catalog.qml | 10 +++++++++- 3 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 cmd/mist/assets/ext/mist.js (limited to 'cmd/mist') diff --git a/cmd/mist/assets/ext/mist.js b/cmd/mist/assets/ext/mist.js new file mode 100644 index 000000000..8734f8dc7 --- /dev/null +++ b/cmd/mist/assets/ext/mist.js @@ -0,0 +1,35 @@ +// Copyright (c) 2015, ETHDEV. All rights reserved. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +// MA 02110-1301 USA + +// this function is included locally, but you can also include separately via a header definition + +console.log("loaded?"); + +document.onkeydown = function(evt) { + evt = evt || window.event; + if (evt.ctrlKey && evt.keyCode == 67) { + window.document.execCommand("copy"); + console.log("Ctrl-C"); + } else if (evt.ctrlKey && evt.keyCode == 88) { + window.document.execCommand("cut"); + console.log("Ctrl-X"); + } if (evt.ctrlKey && evt.keyCode == 86) { + console.log("Ctrl-V"); + } if (evt.ctrlKey && evt.keyCode == 90) { + console.log("Ctrl-Z"); + } +}; \ No newline at end of file diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml index 6ded02fcb..9bee12cc6 100644 --- a/cmd/mist/assets/qml/views/browser.qml +++ b/cmd/mist/assets/qml/views/browser.qml @@ -3,7 +3,7 @@ import QtQuick.Controls 1.0; import QtQuick.Controls.Styles 1.0 import QtQuick.Layouts 1.0; import QtWebEngine 1.0 -import QtWebEngine.experimental 1.0 +//import QtWebEngine.experimental 1.0 import QtQuick.Window 2.0; Rectangle { @@ -340,8 +340,8 @@ Rectangle { WebEngineView { objectName: "webView" id: webview - experimental.settings.javascriptCanAccessClipboard: true - experimental.settings.localContentCanAccessRemoteUrls: true + //experimental.settings.javascriptCanAccessClipboard: true + //experimental.settings.localContentCanAccessRemoteUrls: true anchors { left: parent.left right: parent.right @@ -367,7 +367,12 @@ Rectangle { menuItem.title = pageTitle; }); - + webView.runJavaScript("document.querySelector(\"link[rel='icon']\").getAttribute(\"href\")", function(sideIcon){ + if(sideIcon){ + menuItem.icon = "http://localhost:3000/whisper-icon@2x.png" + }; + }); + webView.runJavaScript("try{document.querySelector(\"meta[name='ethereum-dapp-url-bar-style']\").getAttribute(\"content\")}catch(e){}", function(topBarStyle){ if (!topBarStyle) { showFullUrlBar(true); @@ -397,15 +402,9 @@ Rectangle { }; }); - // webView.runJavaScript("document.querySelector(\"link[rel='icon']\").getAttribute(\"href\")", function(sideIcon){ - // if(sideIcon){ - // window.iconSource = "http://localhost:3000/whisper-icon@2x.png" //webview.url + sideIcon - // console.log(iconSource) - // }; - // }); - + webview.runJavaScript(eth.readFile("bignumber.min.js")); - webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js")); + webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js")); var cleanTitle = webview.url.toString() var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); diff --git a/cmd/mist/assets/qml/views/catalog.qml b/cmd/mist/assets/qml/views/catalog.qml index 18a835ad2..497d69ed1 100644 --- a/cmd/mist/assets/qml/views/catalog.qml +++ b/cmd/mist/assets/qml/views/catalog.qml @@ -85,7 +85,7 @@ Rectangle { property var domain: "ethereum-dapp-catalog.meteor.com" url: protocol + domain - + //experimental.settings.javascriptCanAccessClipboard: true onJavaScriptConsoleMessage: { @@ -112,10 +112,18 @@ Rectangle { } } + // onLoadingChanged: { + // if (loadRequest.status == WebEngineView.LoadSucceededStatus) { + // webview.runJavaScript(eth.readFile("mist.js")); + // } + // } } + + + WebEngineView { id: inspector visible: false -- cgit v1.2.3 From c4b8c115294ea34d3e820c9e39bdda80af8026ff Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Tue, 17 Feb 2015 00:52:40 +0100 Subject: side icons --- cmd/mist/assets/browser.png | Bin 5329 -> 756 bytes cmd/mist/assets/browser@2x.png | Bin 0 -> 1603 bytes cmd/mist/assets/qml/main.qml | 67 ++++++++++++++++++++++++++++------ cmd/mist/assets/qml/views/browser.qml | 55 ++++++++++++++++++++++++---- 4 files changed, 103 insertions(+), 19 deletions(-) create mode 100644 cmd/mist/assets/browser@2x.png (limited to 'cmd/mist') diff --git a/cmd/mist/assets/browser.png b/cmd/mist/assets/browser.png index 7b3b0870c..074c9ae3c 100644 Binary files a/cmd/mist/assets/browser.png and b/cmd/mist/assets/browser.png differ diff --git a/cmd/mist/assets/browser@2x.png b/cmd/mist/assets/browser@2x.png new file mode 100644 index 000000000..8ca417608 Binary files /dev/null and b/cmd/mist/assets/browser@2x.png differ diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 03c8e4518..09a25b431 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -40,10 +40,14 @@ ApplicationWindow { // Takes care of loading all default plugins Component.onCompleted: { - catalog = addPlugin("./views/catalog.qml", {noAdd: true, close: false, section: "begin"}); - var wallet = addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "ethereum", active: true}); + catalog = addPlugin("./views/catalog.qml", {noAdd: true, close: false, section: "begin", active: true}); + var wallet = addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "ethereum"}); - addPlugin("./views/miner.qml", {noAdd: true, close: false, section: "ethereum", active: true}); + var walletWeb = addPlugin("./views/browser.qml", {noAdd: true, close: false, section: "ethereum", active: false}); + walletWeb.view.url = "http://ethereum-dapp-wallet.meteor.com/"; + walletWeb.menuItem.title = "Wallet"; + + addPlugin("./views/miner.qml", {noAdd: true, close: false, section: "ethereum", active: false}); addPlugin("./views/transaction.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/whisper.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/chain.qml", {noAdd: true, close: false, section: "legacy"}); @@ -443,10 +447,14 @@ ApplicationWindow { property var view; property var path; property var closable; + property var badgeContent; property alias title: label.text property alias icon: icon.source property alias secondaryTitle: secondary.text + property alias badgeNumber: badgeNumberLabel.text + property alias badgeIcon: badgeIconLabel.text + function setSelection(on) { sel.visible = on @@ -539,9 +547,6 @@ ApplicationWindow { if (parent.closable == true) { closeIcon.visible = sel.visible } - /*if(view.hasOwnProperty("iconSource")) { - icon.source = view.iconSource; - }*/ } onExited: { closeIcon.visible = false @@ -550,8 +555,8 @@ ApplicationWindow { Image { id: icon - height: 24 - width: 24 + height: 28 + width: 28 anchors { left: parent.left verticalCenter: parent.verticalCenter @@ -581,7 +586,7 @@ ApplicationWindow { verticalCenter: parent.verticalCenter leftMargin: 6 rightMargin: 8 - // verticalCenterOffset: -10 + verticalCenterOffset: (secondaryTitle == "") ? 0 : -10; } x:250 color: "#665F5F" @@ -607,7 +612,7 @@ ApplicationWindow { visible: false width: 10 height: 10 - color: "#FFFFFF" + color: "#FAFAFA" anchors { fill: icon } @@ -626,9 +631,49 @@ ApplicationWindow { centerIn: parent } color: "#665F5F" - font.pixelSize: 18 + font.pixelSize: 20 text: "\ue082" } + } + + Rectangle { + id: badge + visible: (badgeContent == "icon" || badgeContent == "number" )? true : false + width: 32 + color: "#05000000" + anchors { + right: parent.right; + top: parent.top; + bottom: parent.bottom; + rightMargin: 4; + } + + Text { + id: badgeIconLabel + visible: (badgeContent == "icon") ? true : false; + font.family: simpleLineIcons.name + anchors { + centerIn: parent + } + horizontalAlignment: Text.AlignCenter + color: "#AAA0A0" + font.pixelSize: 20 + text: badgeIcon + } + + Text { + id: badgeNumberLabel + visible: (badgeContent == "number") ? true : false; + anchors { + centerIn: parent + } + horizontalAlignment: Text.AlignCenter + font.family: sourceSansPro.name + font.weight: Font.Light + color: "#AAA0A0" + font.pixelSize: 18 + text: badgeNumber + } } diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml index 9bee12cc6..16290578a 100644 --- a/cmd/mist/assets/qml/views/browser.qml +++ b/cmd/mist/assets/qml/views/browser.qml @@ -351,13 +351,50 @@ Rectangle { z: 10 Timer { - interval: 500; running: true; repeat: true + interval: 2000; running: true; repeat: true onTriggered: { - webview.runJavaScript("try{document.querySelector('meta[name=badge]').getAttribute('content')}catch(e){}", function(badge) { - if (badge) { - menuItem.secondaryTitle = badge; - } - }); + webview.runJavaScript("try{document.querySelector('meta[name=ethereum-dapp-info]').getAttribute('content')}catch(e){}", function(extraInfo) { + if (extraInfo) { + menuItem.secondaryTitle = extraInfo; + } + }); + webview.runJavaScript("try{document.querySelector('meta[name=ethereum-dapp-badge]').getAttribute('content')}catch(e){}", function(badge) { + if (badge) { + if (Number(badge)>0 && Number(badge)<999) { + menuItem.badgeNumber = Number(badge); + menuItem.badgeContent = "number" + } else if (badge == "warning") { + menuItem.badgeIcon = "\ue00e" + menuItem.badgeContent = "icon" + + } else if (badge == "ghost") { + menuItem.badgeIcon = "\ue01a" + menuItem.badgeContent = "icon" + + } else if (badge == "question") { + menuItem.badgeIcon = "\ue05d" + menuItem.badgeContent = "icon" + + } else if (badge == "info") { + menuItem.badgeIcon = "\ue08b" + menuItem.badgeContent = "icon" + + } else if (badge == "check") { + menuItem.badgeIcon = "\ue080" + menuItem.badgeContent = "icon" + + } else if (badge == "gear") { + menuItem.badgeIcon = "\ue09a" + menuItem.badgeContent = "icon" + + } + + + console.log(menuItem.badgeContent); + } else { + menuItem.badgeContent = "" + } + }); } } @@ -367,10 +404,12 @@ Rectangle { menuItem.title = pageTitle; }); - webView.runJavaScript("document.querySelector(\"link[rel='icon']\").getAttribute(\"href\")", function(sideIcon){ + webView.runJavaScript("try{document.querySelector(\"link[rel='icon']\").getAttribute(\"href\")}catch(e){}", function(sideIcon){ if(sideIcon){ - menuItem.icon = "http://localhost:3000/whisper-icon@2x.png" + menuItem.icon = webview.url + sideIcon; + console.log("icon: " + webview.url + sideIcon ); }; + console.log("no icon!" ); }); webView.runJavaScript("try{document.querySelector(\"meta[name='ethereum-dapp-url-bar-style']\").getAttribute(\"content\")}catch(e){}", function(topBarStyle){ -- cgit v1.2.3 From a22711a7b569fd9d29fe03591ef2c39d793877b1 Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Tue, 17 Feb 2015 11:22:52 +0100 Subject: badge support --- cmd/mist/assets/qml/main.qml | 11 +++++++---- cmd/mist/assets/qml/views/browser.qml | 7 ++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'cmd/mist') diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 09a25b431..07e6d36da 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -580,6 +580,9 @@ ApplicationWindow { font.family: sourceSansPro.name font.weight: Font.DemiBold elide: Text.ElideRight + x:250 + color: "#665F5F" + font.pixelSize: 14 anchors { left: icon.right right: parent.right @@ -588,12 +591,12 @@ ApplicationWindow { rightMargin: 8 verticalCenterOffset: (secondaryTitle == "") ? 0 : -10; } - x:250 - color: "#665F5F" - font.pixelSize: 14 - } + + + } + Text { id: secondary font.family: sourceSansPro.name diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml index 16290578a..54f5d755e 100644 --- a/cmd/mist/assets/qml/views/browser.qml +++ b/cmd/mist/assets/qml/views/browser.qml @@ -387,10 +387,9 @@ Rectangle { menuItem.badgeIcon = "\ue09a" menuItem.badgeContent = "icon" + } else { + menuItem.badgeContent = "" } - - - console.log(menuItem.badgeContent); } else { menuItem.badgeContent = "" } @@ -407,9 +406,7 @@ Rectangle { webView.runJavaScript("try{document.querySelector(\"link[rel='icon']\").getAttribute(\"href\")}catch(e){}", function(sideIcon){ if(sideIcon){ menuItem.icon = webview.url + sideIcon; - console.log("icon: " + webview.url + sideIcon ); }; - console.log("no icon!" ); }); webView.runJavaScript("try{document.querySelector(\"meta[name='ethereum-dapp-url-bar-style']\").getAttribute(\"content\")}catch(e){}", function(topBarStyle){ -- cgit v1.2.3 From 0de1d1dd588266961740b598da4e01e5efdf2d1f Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Tue, 17 Feb 2015 11:23:28 +0100 Subject: removed status bar code --- cmd/mist/assets/qml/main.qml | 73 -------------------------------------------- 1 file changed, 73 deletions(-) (limited to 'cmd/mist') diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 07e6d36da..0a8776345 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -249,79 +249,6 @@ ApplicationWindow { } } - statusBar: StatusBar { - //height: 32 - visible: false - - id: statusBar - Label { - //y: 6 - id: walletValueLabel - - font.pixelSize: 10 - styleColor: "#797979" - } - - /* - Label { - //y: 6 - objectName: "miningLabel" - visible: true - font.pixelSize: 10 - anchors.right: lastBlockLabel.left - anchors.rightMargin: 5 - } - - Label { - id: lastBlockLabel - objectName: "lastBlockLabel" - visible: true - text: "---" - font.pixelSize: 10 - anchors.right: peerGroup.left - anchors.rightMargin: 5 - } - */ - - ProgressBar { - visible: false - id: downloadIndicator - value: 0 - objectName: "downloadIndicator" - y: -4 - x: statusBar.width / 2 - this.width / 2 - width: 160 - } - - Label { - visible: false - objectName: "downloadLabel" - //y: 7 - anchors.left: downloadIndicator.right - anchors.leftMargin: 5 - font.pixelSize: 10 - text: "0 / 0" - } - - - RowLayout { - id: peerGroup - //y: 7 - anchors.right: parent.right - MouseArea { - onDoubleClicked: peerWindow.visible = true - anchors.fill: parent - } - - Label { - id: peerCounterLabel - font.pixelSize: 10 - text: "0 / 0" - } - } - } - - property var blockModel: ListModel { id: blockModel } -- cgit v1.2.3 From fbd5e4d5afeaff6c250a3a953b18476cdb4b86ae Mon Sep 17 00:00:00 2001 From: Alexandre Van de Sande Date: Tue, 17 Feb 2015 11:52:22 +0100 Subject: Updated icons --- cmd/mist/assets/miner.png | Bin 2100 -> 0 bytes cmd/mist/assets/mining-icon.png | Bin 0 -> 1029 bytes cmd/mist/assets/mining-icon@2x.png | Bin 0 -> 2312 bytes cmd/mist/assets/qml/main.qml | 4 ++-- cmd/mist/assets/qml/views/miner.qml | 2 +- cmd/mist/assets/qml/views/wallet.qml | 1 - 6 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 cmd/mist/assets/miner.png create mode 100644 cmd/mist/assets/mining-icon.png create mode 100644 cmd/mist/assets/mining-icon@2x.png (limited to 'cmd/mist') diff --git a/cmd/mist/assets/miner.png b/cmd/mist/assets/miner.png deleted file mode 100644 index 58e3f4dfe..000000000 Binary files a/cmd/mist/assets/miner.png and /dev/null differ diff --git a/cmd/mist/assets/mining-icon.png b/cmd/mist/assets/mining-icon.png new file mode 100644 index 000000000..db611e5c0 Binary files /dev/null and b/cmd/mist/assets/mining-icon.png differ diff --git a/cmd/mist/assets/mining-icon@2x.png b/cmd/mist/assets/mining-icon@2x.png new file mode 100644 index 000000000..16466d338 Binary files /dev/null and b/cmd/mist/assets/mining-icon@2x.png differ diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 0a8776345..9a6bf5273 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -41,12 +41,12 @@ ApplicationWindow { Component.onCompleted: { catalog = addPlugin("./views/catalog.qml", {noAdd: true, close: false, section: "begin", active: true}); - var wallet = addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "ethereum"}); var walletWeb = addPlugin("./views/browser.qml", {noAdd: true, close: false, section: "ethereum", active: false}); walletWeb.view.url = "http://ethereum-dapp-wallet.meteor.com/"; walletWeb.menuItem.title = "Wallet"; - + + addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/miner.qml", {noAdd: true, close: false, section: "ethereum", active: false}); addPlugin("./views/transaction.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/whisper.qml", {noAdd: true, close: false, section: "legacy"}); diff --git a/cmd/mist/assets/qml/views/miner.qml b/cmd/mist/assets/qml/views/miner.qml index 6a199a925..e239c7d7b 100644 --- a/cmd/mist/assets/qml/views/miner.qml +++ b/cmd/mist/assets/qml/views/miner.qml @@ -9,7 +9,7 @@ import Ethereum 1.0 Rectangle { id: root property var title: "Miner" - property var iconSource: "../miner.png" + property var iconSource: "../mining-icon.png" property var menuItem color: "#00000000" diff --git a/cmd/mist/assets/qml/views/wallet.qml b/cmd/mist/assets/qml/views/wallet.qml index 59dbae848..2369390c3 100644 --- a/cmd/mist/assets/qml/views/wallet.qml +++ b/cmd/mist/assets/qml/views/wallet.qml @@ -9,7 +9,6 @@ import Ethereum 1.0 Rectangle { id: root property var title: "Wallet" - property var iconSource: "../facet.png" property var menuItem objectName: "walletView" -- cgit v1.2.3