changes to top bar

This commit is contained in:
Alexandre Van de Sande 2015-02-06 09:56:57 -02:00
parent 2d8614482f
commit e32473b8da

View file

@ -75,8 +75,7 @@ Rectangle {
RowLayout { RowLayout {
id: navBar id: navBar
height: 74 height: 74
z: 20
anchors { anchors {
left: parent.left left: parent.left
right: parent.right right: parent.right
@ -109,6 +108,7 @@ Rectangle {
color: "#FFFFFF" color: "#FFFFFF"
radius: 6 radius: 6
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
z: 10 z: 10
@ -244,6 +244,7 @@ Rectangle {
}*/ }*/
Rectangle { Rectangle {
id: navBarBackground
anchors.fill: parent anchors.fill: parent
gradient: Gradient { gradient: Gradient {
GradientStop { position: 0.0; color: "#F6F1F2" } GradientStop { position: 0.0; color: "#F6F1F2" }
@ -276,12 +277,31 @@ Rectangle {
bottom: parent.bottom bottom: parent.bottom
top: divider.bottom top: divider.bottom
} }
z: 10
onLoadingChanged: { onLoadingChanged: {
if (loadRequest.status == WebEngineView.LoadSucceededStatus) { if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
webview.runJavaScript("document.title", function(pageTitle) { 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){
if (topBarStyle=="transparent") {
// Adjust for a transparent sidebar Dapp
navBarBackground.visible = false;
back.visible = false;
appInfoPane.anchors.leftMargin = -16;
appInfoPaneShadow.anchors.leftMargin = -16;
webview.anchors.topMargin = -74;
webview.runJavaScript("$('body').addClass('ethereum-dapp-url-bar-style-transparent')")
};
});
webview.runJavaScript(eth.readFile("bignumber.min.js")); 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"));