From 10f8eb854b853bc17bb9c56d1ec0aa0b6e81443d Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Tue, 20 Oct 2020 09:54:47 -0400 Subject: [PATCH] fix: address bar will react to changing tabs and enable mouse selection on text field --- ui/app/AppLayouts/Browser/BrowserHeader.qml | 9 --------- ui/app/AppLayouts/Browser/BrowserLayout.qml | 12 ++++++++++++ ui/shared/StyledTextField.qml | 3 +++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ui/app/AppLayouts/Browser/BrowserHeader.qml b/ui/app/AppLayouts/Browser/BrowserHeader.qml index 6e3a922e6..4db7f9448 100644 --- a/ui/app/AppLayouts/Browser/BrowserHeader.qml +++ b/ui/app/AppLayouts/Browser/BrowserHeader.qml @@ -90,15 +90,6 @@ Rectangle { Layout.leftMargin: -root.innerMargin/2 } - Connections { - target: currentWebView - onUrlChanged: { - var ensAddr = urlENSDictionary[web3Provider.getHost(currentWebView.url)]; - addressBar.text = ensAddr ? web3Provider.replaceHostByENS(currentWebView.url, ensAddr) : currentWebView.url; - } - } - - StyledTextField { id: addressBar height: 40 diff --git a/ui/app/AppLayouts/Browser/BrowserLayout.qml b/ui/app/AppLayouts/Browser/BrowserLayout.qml index be37d85ce..577a2aa05 100644 --- a/ui/app/AppLayouts/Browser/BrowserLayout.qml +++ b/ui/app/AppLayouts/Browser/BrowserLayout.qml @@ -323,9 +323,15 @@ Rectangle { } ] } + + function obtainAddress(){ + var ensAddr = urlENSDictionary[web3Provider.getHost(currentWebView.url)]; + browserHeader.addressBar.text = ensAddr ? web3Provider.replaceHostByENS(currentWebView.url, ensAddr) : currentWebView.url; + } onCurrentWebViewChanged: { findBar.reset(); + obtainAddress(); } Action { @@ -585,6 +591,7 @@ Rectangle { } } } + Component { id: tabComponent WebEngineView { @@ -768,6 +775,11 @@ Rectangle { } } + Connections { + target: currentWebView + onUrlChanged: obtainAddress() + } + ProgressBar { id: progressBar height: 3 diff --git a/ui/shared/StyledTextField.qml b/ui/shared/StyledTextField.qml index 899e3b8ec..d8eacc478 100644 --- a/ui/shared/StyledTextField.qml +++ b/ui/shared/StyledTextField.qml @@ -5,4 +5,7 @@ import "../imports" TextField { font.family: Style.current.fontRegular.name color: Style.current.textColor + selectByMouse: true + selectedTextColor: Style.current.textColor + selectionColor: Style.current.secondaryHover }