mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 06:19:02 +02:00
Add open-in-externa-window button
This commit is contained in:
parent
9d3b763256
commit
7da2fa1315
1 changed files with 26 additions and 1 deletions
|
@ -49,6 +49,12 @@ ScrollingWindow {
|
||||||
desktop.setAutoAdd(auto);
|
desktop.setAutoAdd(auto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openExternalBrowser() {
|
||||||
|
Qt.openUrlExternally(addressBar.text);
|
||||||
|
root.shown = false;
|
||||||
|
root.windowClosed();
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id:item
|
id:item
|
||||||
width: pane.contentWidth
|
width: pane.contentWidth
|
||||||
|
@ -115,6 +121,25 @@ ScrollingWindow {
|
||||||
anchors.left: buttons.right
|
anchors.left: buttons.right
|
||||||
anchors.leftMargin: 8
|
anchors.leftMargin: 8
|
||||||
|
|
||||||
|
HiFiGlyphs {
|
||||||
|
id: externalBrowser
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 4
|
||||||
|
enabled: !HMD.active && url !== ""
|
||||||
|
font.family: "FontAwesome"
|
||||||
|
text: "\uf24d"
|
||||||
|
rotation: -90
|
||||||
|
color: enabled ? (externalBrowserMouseArea.containsMouse ? hifi.colors.blueHighlight : hifi.colors.faintGray) : hifi.colors.lightGray
|
||||||
|
size: 32
|
||||||
|
MouseArea {
|
||||||
|
id: externalBrowserMouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: openExternalBrowser();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: barIcon
|
id: barIcon
|
||||||
width: parent.height
|
width: parent.height
|
||||||
|
@ -132,7 +157,7 @@ ScrollingWindow {
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: addressBar
|
id: addressBar
|
||||||
anchors.right: parent.right
|
anchors.right: externalBrowser.left
|
||||||
anchors.rightMargin: 8
|
anchors.rightMargin: 8
|
||||||
anchors.left: barIcon.right
|
anchors.left: barIcon.right
|
||||||
anchors.leftMargin: 0
|
anchors.leftMargin: 0
|
||||||
|
|
Loading…
Reference in a new issue