mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
transparent top bar and separated catalog
This commit is contained in:
parent
e32473b8da
commit
95059226a9
4 changed files with 14 additions and 151 deletions
BIN
cmd/mist/assets/backButton.png
Normal file
BIN
cmd/mist/assets/backButton.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 663 B |
BIN
cmd/mist/assets/backButton@2x.png
Normal file
BIN
cmd/mist/assets/backButton@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
|
|
@ -282,11 +282,11 @@ Rectangle {
|
|||
onLoadingChanged: {
|
||||
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
|
||||
webview.runJavaScript("document.title", function(pageTitle) {
|
||||
//menuItem.title = pageTitle;
|
||||
menuItem.title = pageTitle;
|
||||
});
|
||||
|
||||
//var topBarStyle
|
||||
webView.runJavaScript("$(\"meta[name='ethereum-dapp-url-bar-style']\").attr('content');", function(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
|
||||
|
|
@ -295,7 +295,7 @@ Rectangle {
|
|||
appInfoPane.anchors.leftMargin = -16;
|
||||
appInfoPaneShadow.anchors.leftMargin = -16;
|
||||
webview.anchors.topMargin = -74;
|
||||
webview.runJavaScript("$('body').addClass('ethereum-dapp-url-bar-style-transparent')")
|
||||
webview.runJavaScript("document.querySelector('body').classList.add('ethereum-dapp-url-bar-style-transparent')")
|
||||
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -74,35 +74,13 @@ Rectangle {
|
|||
|
||||
RowLayout {
|
||||
id: navBar
|
||||
height: 74
|
||||
|
||||
height: 184
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
Button {
|
||||
id: back
|
||||
|
||||
onClicked: {
|
||||
webview.goBack()
|
||||
}
|
||||
|
||||
anchors{
|
||||
left: parent.left
|
||||
leftMargin: 6
|
||||
}
|
||||
|
||||
style: ButtonStyle {
|
||||
background: Image {
|
||||
source: "../../backButton.png"
|
||||
width: 20
|
||||
height: 30
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: appInfoPane
|
||||
height: 28
|
||||
|
|
@ -120,56 +98,23 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
anchors {
|
||||
left: back.right
|
||||
right: parent.right
|
||||
leftMargin: 10
|
||||
rightMargin: 10
|
||||
}
|
||||
|
||||
Text {
|
||||
id: appTitle
|
||||
text: "LOADING"
|
||||
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: "loading domain"
|
||||
font.bold: false
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
anchors {
|
||||
left: parent.horizontalCenter
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
leftMargin: 10
|
||||
rightMargin: 10
|
||||
top: parent.verticalCenter
|
||||
topMargin: 23
|
||||
}
|
||||
color: "#C0AFAF"
|
||||
}
|
||||
|
||||
|
||||
TextField {
|
||||
id: uriNav
|
||||
visible: false
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin: 16
|
||||
top: parent.verticalCenter
|
||||
topMargin: -10
|
||||
}
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
|
@ -181,28 +126,17 @@ Rectangle {
|
|||
color: "transparent"
|
||||
}
|
||||
}
|
||||
text: webview.url;
|
||||
text: "Type the address of a new Dapp";
|
||||
y: parent.height / 2 - this.height / 2
|
||||
z: 20
|
||||
activeFocusOnPress: true
|
||||
Keys.onReturnPressed: {
|
||||
webview.url = this.text;
|
||||
newBrowserTab(this.text);
|
||||
this.text = "Type the address of a new Dapp";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*text {
|
||||
id: appTitle
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.horizontalCenter
|
||||
text: "APP TITLE"
|
||||
font.bold: true
|
||||
color: "#928484"
|
||||
}*/
|
||||
z:2
|
||||
}
|
||||
|
||||
|
|
@ -214,58 +148,19 @@ Rectangle {
|
|||
radius: 6
|
||||
|
||||
anchors {
|
||||
left: back.right
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin:10
|
||||
rightMargin:10
|
||||
top: parent.top
|
||||
top: parent.verticalCenter
|
||||
topMargin: 23
|
||||
}
|
||||
|
||||
z:1
|
||||
}
|
||||
/*
|
||||
Button {
|
||||
id: toggleInspector
|
||||
anchors {
|
||||
right: parent.right
|
||||
}
|
||||
iconSource: "../../bug.png"
|
||||
onClicked: {
|
||||
// XXX soon
|
||||
return
|
||||
if(inspector.visible == true){
|
||||
inspector.visible = false
|
||||
}else{
|
||||
inspector.visible = true
|
||||
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
|
||||
Rectangle {
|
||||
id: divider
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: navBar.bottom
|
||||
}
|
||||
z: -1
|
||||
height: 1
|
||||
color: "#CCCCCC"
|
||||
}
|
||||
|
||||
WebEngineView {
|
||||
objectName: "webView"
|
||||
|
|
@ -279,22 +174,8 @@ Rectangle {
|
|||
|
||||
onLoadingChanged: {
|
||||
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
|
||||
webview.runJavaScript("document.title", function(pageTitle) {
|
||||
menuItem.title = pageTitle;
|
||||
});
|
||||
webview.runJavaScript(eth.readFile("bignumber.min.js"));
|
||||
webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
|
||||
|
||||
var cleanTitle = webview.url.toString()
|
||||
var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
|
||||
var domain = matches && matches[1];
|
||||
|
||||
uriNav.visible = false
|
||||
appDomain.visible = true
|
||||
appDomain.text = domain //webview.url.replace("a", "z")
|
||||
|
||||
appTitle.visible = true
|
||||
appTitle.text = webview.title
|
||||
}
|
||||
}
|
||||
onJavaScriptConsoleMessage: {
|
||||
|
|
@ -302,25 +183,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: sizeGrip
|
||||
color: "gray"
|
||||
visible: false
|
||||
height: 10
|
||||
anchors {
|
||||
left: root.left
|
||||
right: root.right
|
||||
}
|
||||
y: Math.round(root.height * 2 / 3)
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
drag.target: sizeGrip
|
||||
drag.minimumY: 0
|
||||
drag.maximumY: root.height
|
||||
drag.axis: Drag.YAxis
|
||||
}
|
||||
}
|
||||
|
||||
WebEngineView {
|
||||
id: inspector
|
||||
|
|
|
|||
Loading…
Reference in a new issue