mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 03:53:52 +02:00
Add "home" button to address bar
This commit is contained in:
parent
7406e5fd9c
commit
f74be226c8
5 changed files with 99 additions and 32 deletions
|
@ -15,7 +15,7 @@
|
|||
viewBox="0 0 1440 200"
|
||||
id="svg4136"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="address-bar.002.svg">
|
||||
sodipodi:docname="address-bar.svg">
|
||||
<metadata
|
||||
id="metadata4144">
|
||||
<rdf:RDF>
|
||||
|
@ -39,16 +39,16 @@
|
|||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1835"
|
||||
inkscape:window-height="1057"
|
||||
inkscape:window-width="1536"
|
||||
inkscape:window-height="687"
|
||||
id="namedview4140"
|
||||
showgrid="false"
|
||||
inkscape:zoom="0.61319416"
|
||||
inkscape:cx="132.58366"
|
||||
inkscape:cx="670.06567"
|
||||
inkscape:cy="52.468468"
|
||||
inkscape:window-x="77"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:window-x="105"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg4136" />
|
||||
<rect
|
||||
style="fill:#ededed;fill-opacity:1;stroke:none;stroke-linejoin:round;stroke-opacity:1"
|
||||
|
@ -60,14 +60,14 @@
|
|||
rx="16.025024"
|
||||
ry="17.019567" />
|
||||
<rect
|
||||
style="fill:#dadada;fill-opacity:1;stroke:#cbcbcb;stroke-width:0.33821851;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
|
||||
style="fill:#dadada;fill-opacity:1;stroke:#cbcbcb;stroke-width:0.35830048;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect4135"
|
||||
width="292.86267"
|
||||
height="139.66179"
|
||||
x="150.32542"
|
||||
y="30.169102"
|
||||
rx="16.817432"
|
||||
ry="20.612938" />
|
||||
width="328.72031"
|
||||
height="139.64169"
|
||||
x="150.33546"
|
||||
y="30.179144"
|
||||
rx="18.876532"
|
||||
ry="20.609974" />
|
||||
<circle
|
||||
style="fill:#b8b8b8;fill-opacity:1;stroke:none;stroke-opacity:1"
|
||||
id="path4146"
|
||||
|
@ -78,11 +78,4 @@
|
|||
d="m 100,36.000005 c -22.1,0 -40,17.9 -40,39.999995 0,30 40,88 40,88 0,0 40,-58 40,-88 0,-22.099995 -17.9,-39.999995 -40,-39.999995 z m 0,22 c 9.9,0 18,8.099995 18,17.999995 0,9.9 -8.1,18 -18,18 -9.9,0 -18,-8.1 -18,-18 0,-9.9 8.1,-17.999995 18,-17.999995 z"
|
||||
id="path4138"
|
||||
inkscape:connector-curvature="0" />
|
||||
<rect
|
||||
style="fill:#bdbdbd;fill-opacity:1;stroke:none;stroke-width:0.30000001;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="rect4136"
|
||||
width="4"
|
||||
height="100"
|
||||
x="310.12924"
|
||||
y="50" />
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.5 KiB |
48
interface/resources/images/home-button.svg
Normal file
48
interface/resources/images/home-button.svg
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="Layer_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 320 280"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="home-button.svg"
|
||||
width="320"
|
||||
height="280"><metadata
|
||||
id="metadata4143"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs4141" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1827"
|
||||
inkscape:window-height="1057"
|
||||
id="namedview4139"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1.2263883"
|
||||
inkscape:cx="135.72814"
|
||||
inkscape:cy="175.61874"
|
||||
inkscape:window-x="85"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="Layer_1" /><polyline
|
||||
points="261,116.2 420.4,261.1 361.7,261.1 361.7,394.5 160.4,394.5 160.4,261.1 101.8,261.1 261,116.2 "
|
||||
id="polyline4137"
|
||||
transform="translate(-101.1,-115.35)"
|
||||
style="fill:#535353;fill-opacity:1" /></svg>
|
After Width: | Height: | Size: 1.7 KiB |
|
@ -55,15 +55,35 @@ Window {
|
|||
property int inputAreaHeight: 56.0 * root.scale // Height of the background's input area
|
||||
property int inputAreaStep: (height - inputAreaHeight) / 2
|
||||
|
||||
Image {
|
||||
id: homeButton
|
||||
source: "../images/home-button.svg"
|
||||
width: 29
|
||||
height: 26
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: parent.height + 2 * hifi.layout.spacing
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onClicked: {
|
||||
addressBarDialog.loadHome()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: backArrow
|
||||
source: addressBarDialog.backEnabled ? "../images/left-arrow.svg" : "../images/left-arrow-disabled.svg"
|
||||
width: 22
|
||||
height: 26
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: parent.height + hifi.layout.spacing + 6
|
||||
rightMargin: parent.height + hifi.layout.spacing * 60
|
||||
topMargin: parent.inputAreaStep + parent.inputAreaStep + hifi.layout.spacing
|
||||
bottomMargin: parent.inputAreaStep + parent.inputAreaStep + hifi.layout.spacing
|
||||
left: homeButton.right
|
||||
leftMargin: 2 * hifi.layout.spacing
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
@ -78,12 +98,12 @@ Window {
|
|||
Image {
|
||||
id: forwardArrow
|
||||
source: addressBarDialog.forwardEnabled ? "../images/right-arrow.svg" : "../images/right-arrow-disabled.svg"
|
||||
width: 22
|
||||
height: 26
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: parent.height + hifi.layout.spacing * 9
|
||||
rightMargin: parent.height + hifi.layout.spacing * 53
|
||||
topMargin: parent.inputAreaStep + parent.inputAreaStep + hifi.layout.spacing
|
||||
bottomMargin: parent.inputAreaStep + parent.inputAreaStep + hifi.layout.spacing
|
||||
left: backArrow.right
|
||||
leftMargin: 2 * hifi.layout.spacing
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
@ -101,7 +121,7 @@ Window {
|
|||
focus: true
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: parent.height + parent.height + hifi.layout.spacing * 5
|
||||
leftMargin: parent.height + parent.height + hifi.layout.spacing * 7
|
||||
rightMargin: hifi.layout.spacing * 2
|
||||
topMargin: parent.inputAreaStep + hifi.layout.spacing
|
||||
bottomMargin: parent.inputAreaStep + hifi.layout.spacing
|
||||
|
|
|
@ -50,6 +50,11 @@ void AddressBarDialog::loadAddress(const QString& address) {
|
|||
}
|
||||
}
|
||||
|
||||
void AddressBarDialog::loadHome() {
|
||||
qDebug() << "Called LoadHome";
|
||||
// TODO
|
||||
}
|
||||
|
||||
void AddressBarDialog::loadBack() {
|
||||
qDebug() << "Called LoadBack";
|
||||
DependencyManager::get<AddressManager>()->goBack();
|
||||
|
|
|
@ -36,6 +36,7 @@ protected:
|
|||
void hide();
|
||||
|
||||
Q_INVOKABLE void loadAddress(const QString& address);
|
||||
Q_INVOKABLE void loadHome();
|
||||
Q_INVOKABLE void loadBack();
|
||||
Q_INVOKABLE void loadForward();
|
||||
|
||||
|
|
Loading…
Reference in a new issue