Hide browser bar when coming from a DApp url

This commit is contained in:
obscuren 2015-01-20 15:48:38 +01:00
parent 4dd7be7ed0
commit 375cc67ba6
1 changed files with 28 additions and 24 deletions

View File

@ -63,6 +63,17 @@ ApplicationWindow {
gui.sendCommand(0) gui.sendCommand(0)
} }
function activeView(view, menuItem) {
mainSplit.setView(view, menuItem)
if (view.objectName === "browserView") {
urlPane.visible = false;
mainView.anchors.top = rootView.top
} else {
urlPane.visible = true;
mainView.anchors.top = divider.bottom
}
}
function addViews(view, path, options) { function addViews(view, path, options) {
var views = mainSplit.addComponent(view, options) var views = mainSplit.addComponent(view, options)
views.menuItem.path = path views.menuItem.path = path
@ -284,6 +295,7 @@ ApplicationWindow {
} }
ProgressBar { ProgressBar {
visible: false
id: downloadIndicator id: downloadIndicator
value: 0 value: 0
objectName: "downloadIndicator" objectName: "downloadIndicator"
@ -293,6 +305,7 @@ ApplicationWindow {
} }
Label { Label {
visible: false
objectName: "downloadLabel" objectName: "downloadLabel"
//y: 7 //y: 7
anchors.left: downloadIndicator.right anchors.left: downloadIndicator.right
@ -445,15 +458,7 @@ ApplicationWindow {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
mainSplit.setView(view, menuItem) activeView(view, menuItem);
console.log(view);
if (view.objectName === "browserView") {
urlPane.visible = false;
mainView.anchors.top = rootView.top
} else {
urlPane.visible = true;
mainView.anchors.top = divider.bottom
}
} }
} }
@ -520,14 +525,14 @@ ApplicationWindow {
var section; var section;
switch(options.section) { switch(options.section) {
case "ethereum": case "ethereum":
section = menuDefault; section = menuDefault;
break; break;
case "legacy": case "legacy":
section = menuLegacy; section = menuLegacy;
break; break;
default: default:
section = menuApps; section = menuApps;
break; break;
} }
var comp = menuItemTemplate.createObject(section) var comp = menuItemTemplate.createObject(section)
@ -614,7 +619,7 @@ ApplicationWindow {
* Main view * Main view
********************/ ********************/
Rectangle { Rectangle {
id: rootView id: rootView
anchors.right: parent.right anchors.right: parent.right
anchors.left: menu.right anchors.left: menu.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
@ -648,8 +653,7 @@ ApplicationWindow {
Keys.onReturnPressed: { Keys.onReturnPressed: {
if(/^https?/.test(this.text)) { if(/^https?/.test(this.text)) {
root.browser.view.open(this.text); activeView(root.browser.view, root.browser.menuItem);
mainSplit.setView(root.browser.view, root.browser.menuItem);
} else { } else {
addPlugin(this.text, {close: true, section: "apps"}) addPlugin(this.text, {close: true, section: "apps"})
} }
@ -873,13 +877,13 @@ ApplicationWindow {
Component.onCompleted: { Component.onCompleted: {
pastPeers.insert(0, {text: "poc-8.ethdev.com:30303"}) pastPeers.insert(0, {text: "poc-8.ethdev.com:30303"})
/* /*
var ips = eth.pastPeers() var ips = eth.pastPeers()
for(var i = 0; i < ips.length; i++) { for(var i = 0; i < ips.length; i++) {
pastPeers.append({text: ips.get(i)}) pastPeers.append({text: ips.get(i)})
} }
pastPeers.insert(0, {text: "poc-7.ethdev.com:30303"}) pastPeers.insert(0, {text: "poc-7.ethdev.com:30303"})
*/ */
} }
} }