mirror of
https://github.com/overte-org/overte.git
synced 2025-04-29 19:42:36 +02:00
193 lines
5.3 KiB
QML
193 lines
5.3 KiB
QML
//
|
|
// NeedsLogIn.qml
|
|
// qml/hifi/commerce/wallet
|
|
//
|
|
// NeedsLogIn
|
|
//
|
|
// Created by Zach Fox on 2017-08-18
|
|
// Copyright 2017 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
import Hifi 1.0 as Hifi
|
|
import QtQuick 2.5
|
|
import stylesUit 1.0
|
|
import controlsUit 1.0 as HifiControlsUit
|
|
import "../../../controls" as HifiControls
|
|
|
|
// references XXX from root context
|
|
|
|
Item {
|
|
HifiConstants { id: hifi; }
|
|
|
|
id: root;
|
|
|
|
Image {
|
|
anchors.fill: parent;
|
|
source: "images/wallet-bg.jpg";
|
|
}
|
|
|
|
Connections {
|
|
target: Commerce;
|
|
}
|
|
|
|
//
|
|
// LOGIN PAGE START
|
|
//
|
|
Item {
|
|
id: loginPageContainer;
|
|
// Anchors
|
|
anchors.fill: parent;
|
|
|
|
Item {
|
|
id: loginTitle;
|
|
// Size
|
|
width: parent.width;
|
|
height: 50;
|
|
// Anchors
|
|
anchors.left: parent.left;
|
|
anchors.top: parent.top;
|
|
|
|
// Title Bar text
|
|
RalewaySemiBold {
|
|
text: "Log in to continue";
|
|
// Text size
|
|
size: hifi.fontSizes.overlayTitle;
|
|
// Anchors
|
|
anchors.top: parent.top;
|
|
anchors.left: parent.left;
|
|
anchors.leftMargin: 16;
|
|
anchors.bottom: parent.bottom;
|
|
width: paintedWidth;
|
|
// Style
|
|
color: hifi.colors.faintGray;
|
|
// Alignment
|
|
horizontalAlignment: Text.AlignHLeft;
|
|
verticalAlignment: Text.AlignVCenter;
|
|
}
|
|
}
|
|
|
|
// Text below title bar
|
|
RalewaySemiBold {
|
|
id: loginTitleHelper;
|
|
text: "Please Log In to High Fidelity";
|
|
// Text size
|
|
size: 24;
|
|
// Anchors
|
|
anchors.top: loginTitle.bottom;
|
|
anchors.topMargin: 100;
|
|
anchors.left: parent.left;
|
|
anchors.leftMargin: 16;
|
|
anchors.right: parent.right;
|
|
anchors.rightMargin: 16;
|
|
height: 50;
|
|
// Style
|
|
color: hifi.colors.faintGray;
|
|
// Alignment
|
|
horizontalAlignment: Text.AlignHCenter;
|
|
verticalAlignment: Text.AlignVCenter;
|
|
}
|
|
|
|
// Text below helper text
|
|
RalewayRegular {
|
|
id: loginDetailText;
|
|
text: "To get items on the <b>Marketplace</b>, or to use your <b>Assets</b>, you must first log in to High Fidelity.";
|
|
// Text size
|
|
size: 18;
|
|
// Anchors
|
|
anchors.top: loginTitleHelper.bottom;
|
|
anchors.topMargin: 25;
|
|
anchors.left: parent.left;
|
|
anchors.leftMargin: 16;
|
|
anchors.right: parent.right;
|
|
anchors.rightMargin: 16;
|
|
height: 50;
|
|
// Style
|
|
color: hifi.colors.faintGray;
|
|
wrapMode: Text.WordWrap;
|
|
// Alignment
|
|
horizontalAlignment: Text.AlignHCenter;
|
|
verticalAlignment: Text.AlignVCenter;
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
// Size
|
|
width: root.width;
|
|
height: 70;
|
|
// Anchors
|
|
anchors.top: loginDetailText.bottom;
|
|
anchors.topMargin: 40;
|
|
anchors.left: parent.left;
|
|
|
|
// "Cancel" button
|
|
HifiControlsUit.Button {
|
|
id: cancelButton;
|
|
color: hifi.buttons.black;
|
|
colorScheme: hifi.colorSchemes.dark;
|
|
anchors.top: parent.top;
|
|
anchors.topMargin: 3;
|
|
anchors.bottom: parent.bottom;
|
|
anchors.bottomMargin: 3;
|
|
anchors.left: parent.left;
|
|
anchors.leftMargin: 20;
|
|
width: parent.width/2 - anchors.leftMargin*2;
|
|
text: "Cancel"
|
|
onClicked: {
|
|
sendToScript({method: 'passphrasePopup_cancelClicked'});
|
|
}
|
|
}
|
|
|
|
// "Set Up" button
|
|
HifiControlsUit.Button {
|
|
id: setUpButton;
|
|
color: hifi.buttons.blue;
|
|
colorScheme: hifi.colorSchemes.dark;
|
|
anchors.top: parent.top;
|
|
anchors.topMargin: 3;
|
|
anchors.bottom: parent.bottom;
|
|
anchors.bottomMargin: 3;
|
|
anchors.right: parent.right;
|
|
anchors.rightMargin: 20;
|
|
width: parent.width/2 - anchors.rightMargin*2;
|
|
text: "Log In"
|
|
onClicked: {
|
|
sendToScript({method: 'marketplace_loginClicked'});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//
|
|
// LOGIN PAGE END
|
|
//
|
|
|
|
//
|
|
// FUNCTION DEFINITIONS START
|
|
//
|
|
//
|
|
// Function Name: fromScript()
|
|
//
|
|
// Relevant Variables:
|
|
// None
|
|
//
|
|
// Arguments:
|
|
// message: The message sent from the JavaScript.
|
|
// Messages are in format "{method, params}", like json-rpc.
|
|
//
|
|
// Description:
|
|
// Called when a message is received from a script.
|
|
//
|
|
function fromScript(message) {
|
|
switch (message.method) {
|
|
default:
|
|
console.log('NeedsLogIn.qml: Unrecognized message from wallet.js');
|
|
}
|
|
}
|
|
signal sendSignalToWallet(var msg);
|
|
//
|
|
// FUNCTION DEFINITIONS END
|
|
//
|
|
}
|