@ -15,16 +15,16 @@ import "../components" as NeroshopComponents
Page {
id: main_page
title: qsTr ( "Main Page" )
/ / R e c t a n g l e {
/ / c o l o r : " r e d "
/ / }
Rectangle {
color: "transparent "
}
/ / / / / / / / / / / / / / / / / / / / / / / / / / /
function copy _to_c lipboard( ) {
function copy ToC lipboard( ) {
/ / I f t e x t e d i t s t r i n g i s e m p t y , e x i t f u n c t i o n
if ( ! seed _display_e dit. text ) return ;
if ( ! seed DisplayE dit. text ) return ;
/ / S e l e c t a l l t e x t f r o m e d i t t h e n c o p y t h e s e l e c t e d t e x t
seed _display_e dit. selectAll ( )
seed _display_e dit. copy ( )
seed DisplayE dit. selectAll ( )
seed DisplayE dit. copy ( )
console . log ( "Copied to clipboard" ) ;
}
/ / / / / / / / / / / / / / / / / / / / / / / / / / /
@ -32,42 +32,38 @@ Page {
/ / i d : w a l l e t
/ / }
/ / / / / / / / / / / / / / / / / / / / / / / / / / /
function generate _k eys( ) {
function generate WalletK eys( ) {
/ / g e n e r a t e a u n i q u e w a l l e t s e e d ( m n e m o n i c )
let error = Wallet . create_random_wallet ( wallet _password_create_edit. text , wallet_password_confirm_edit . text , neroshopWalletDir + "/auth" ) / / " w a l l e t " )
let error = Wallet . create_random_wallet ( wallet PasswordField. text , walletPasswordConfirmField . text , neroshopWalletDir + "/auth" ) / / " w a l l e t " )
/ / i f w a l l e t p a s s w o r d s d o n ' t m a t c h , d i s p l a y e r r o r m e s s a g e
let WALLET_PASSWORD_NO_MATCH = 2
let WALLET_ALREADY_EXISTS = 3 ;
if ( error == WALLET_PASSWORD_NO_MATCH ) { / / i f ( w a l l e t _ p a s s w o r d _ c o n f i r m _ e d i t . t e x t ! = w a l l e t _ p a s s w o r d _ c r e a t e _ e d i t . t e x t ) {
/ / i m p o r t a n t _ m e s s a g e _ f i e l d . x = w a l l e t _ p a s s w o r d _ c o n f i r m _ e d i t . x
important_message_field . text = qsTr ( "Wallet passwords do not match" )
important_message_field . visible = true
/ * m e s s a g e _ b o x . t e x t = q s T r ( " W a l l e t p a s s w o r d s d o n o t m a t c h " )
message_box . open ( ) * /
if ( error == WALLET_PASSWORD_NO_MATCH ) { / / i f ( w a l l e t P a s s w o r d C o n f i r m F i e l d . t e x t ! = w a l l e t P a s s w o r d F i e l d . t e x t ) {
/ / w a l l e t M e s s a g e F i e l d . x = w a l l e t P a s s w o r d C o n f i r m F i e l d . x
walletHint . show ( qsTr ( "Wallet passwords do not match" ) , - 1 )
}
else if ( error == WALLET_ALREADY_EXISTS ) {
important_message_field . text = qsTr ( "A wallet file with the same name already exists" )
important_message_field . visible = true
walletHint . show ( qsTr ( "A wallet file with the same name already exists" ) , - 1 )
}
/ / t h e n c o p y t h e m n e m o n i c t o t h e s e e d d i s p l a y e d i t
seed _display_e dit. text = Wallet . get_mnemonic ( )
seed DisplayE dit. text = Wallet . get_mnemonic ( )
/ / s h o w i m p o r t a n t m e s s a g e ( o n l y i f w a l l e t k e y s w e r e s u c c e s s f u l l y c r e a t e d )
if ( seed _display_e dit. text ) {
/ / im p o r t a n t _ m e s s a g e _ f i e l d . x = ( g e n k e y _ p a g e . w i d t h / 2 ) - ( im p o r t a n t _ m e s s a g e _ f i e l d . w i d t h / 2 ) / / p l a c e a t c e n t e r o f ge n k e y _ p a g e / / g e n e r a t e _ k e y _ b u t t o n . x
/ / im p o r t a n t _ m e s s a g e _ f i e l d . y = g e n e r a t e _ k e y _ b u t t o n . y + g e n e r a t e _ k e y _ b u t t o n . h e i g h t + 2 0
important_message_f ield. text = qsTr ( "These words are the key to your account. Please store them safely!" )
important_message_f ield. visible = true
if ( seed DisplayE dit. text ) {
/ / wa l l e t M e s s a g e F i e l d . x = ( r e g i s t e r P a g e . w i d t h / 2 ) - ( wa l l e t M e s s a g e F i e l d . w i d t h / 2 ) / / p l a c e a t c e n t e r o f re g i s t e r P a g e / / g e n e r a t e _ k e y _ b u t t o n . x
/ / wa l l e t M e s s a g e F i e l d . y = g e n e r a t e _ k e y _ b u t t o n . y + g e n e r a t e _ k e y _ b u t t o n . h e i g h t + 2 0
walletMessageF ield. text = qsTr ( "These words are the key to your account. Please store them safely!" )
walletMessageF ield. visible = true
/ / c l e a r w a l l e t p a s s w o r d t e x t f i e l d s
wallet _password_create_edit . text = "" ;
wallet _password_confirm_edit . text = "" ;
wallet PasswordField . text = "" ;
wallet PasswordConfirmField . text = "" ;
}
}
/ / / / / / / / / / / / / / / / / / / / / / / / / / /
function register _w allet( ) {
function register W allet( ) {
/ / i f n o t k e y g e n e r a t e d , t h e n g e n e r a t e k e y
if ( ! seed _display_e dit. text ) {
message _b ox. text = qsTr ( "Please generate your keys before registering" )
message _b ox. open ( )
if ( ! seed DisplayE dit. text ) {
message B ox. text = qsTr ( "Please generate your keys before registering" )
message B ox. open ( )
return ; / / e x i t f u n c t i o n a n d d o n o t p r o c e e d a n y f u r t h e r
}
/ / d o a r e g e x c h e c k o n t h e u s e r n a m e b e f o r e p r o c e e d i n g
@ -75,12 +71,12 @@ Page {
/ / r e g i s t e r t h e w a l l e t p r i m a r y k e y t o t h e d a t a b a s e
/ / s w i t c h ( l o g i n ) t o h o m e p a g e
/ / s t a c k . p u s h ( h o m e _ p a g e )
page _loader. source = "home_p age.qml"
page Loader. source = "HomeP age.qml"
}
/ / / / / / / / / / / / / / / / / / / / / / / / / / /
/ / c o n s i s t s o f l o g i n a n d r e g i s t r a t i o n m e n u s
MessageDialog {
id: message _b ox
id: message B ox
/ / v i s i b l e : f a l s e
title: "message"
text: "It's so cool that you are using Qt Quick."
@ -94,7 +90,7 @@ Page {
}
/ / / / / / / / / / / / / / / / / / / / / / / / / / /
FileDialog {
id: wallet _file_d ialog
id: wallet FileD ialog
fileMode: FileDialog . OpenFile
currentFile: wallet_upload_edit . text / / c u r r e n t F i l e i s d e p r e c a t e d s i n c e Q t 6 . 3 . U s e s e l e c t e d F i l e i n s t e a d
folder: neroshopWalletDir / / S t a n d a r d P a t h s . w r i t a b l e L o c a t i o n ( S t a n d a r d P a t h s . H o m e L o c a t i o n ) + " / n e r o s h o p " / / S t a n d a r d P a t h s . w r i t a b l e L o c a t i o n ( S t a n d a r d P a t h s . A p p D a t a L o c a t i o n ) / / r e f e r t o h t t p s : / / d o c . q t . i o / q t - 5 / q s t a n d a r d p a t h s . h t m l # S t a n d a r d L o c a t i o n - e n u m
@ -102,74 +98,95 @@ Page {
/ / o p t i o n s : F i l e D i a l o g . R e a d O n l y / / w i l l n o t a l l o w y o u t o c r e a t e f o l d e r s w h i l e f i l e d i a l o g i s o p e n e d
}
/ / / / / / / / / / / / / / / / / / / / / / / / / / /
TabBar {
id: buttonsBar
width: parent . width
anchors.top: parent . top
anchors.topMargin: 0 / / 2 0
anchors.horizontalCenter: parent . horizontalCenter / /x: authStack.x + (authStack.width / 2 ) - ( this . width / 2 ) / / c e n t e r t h e x
/ / y : ( a u t h S t a c k . y + a u t h S t a c k . h e i g h t ) + 5 / / 5 i s t h e p a d d i n g / / l o w e r t h e y
property string buttonColor: NeroshopComponents . Style . moneroGrayColor
TabButton { / / m u s t b e u s e d i n c o n j u n c t i o n w i t h a T a b B a r a c c o r d i n g t o : h t t p s : / / d o c . q t . i o / q t - 5 / q m l - q t q u i c k - c o n t r o l s 2 - t a b b u t t o n . h t m l
text: qsTr ( "Register" )
width: implicitWidth
onClicked: authStack . currentIndex = 0
background: Rectangle {
color: buttonsBar . buttonColor / / " # 0 0 a e b f "
}
}
TabButton {
id: login_button / / a u t h _ w a l l e t f i l e _ b u t t o n
text: qsTr ( "Login with Wallet file" )
width: implicitWidth
onClicked: authStack . currentIndex = 1
contentItem: Text {
/ / f o n t . f a m i l y : " C o n s o l a s " ;
/ / f o n t . p o i n t S i z e : 1 0 ;
/ / f o n t . b o l d : t r u e
text: login_button . text
color: "#ffffff" / / w h i t e t e x t
}
background: Rectangle {
color: buttonsBar . buttonColor / /NeroshopComponents.Style.moneroOrangeColor/ / "#ff6600" / / p a r e n t . d o w n ? " # b b b b b b " :
/ / ( p a r e n t . h o v e r e d ? " # d 6 d 6 d 6 " : " # f 6 f 6 f 6 " )
radius: 0
/ / b o r d e r . c o l o r : l o g i n _ b u t t o n . h o v e r e d ? " # f f f f f f " : t h i s . c o l o r / / " # f f f f f f " / / c o n t r o l . d o w n ? " # 1 7 a 8 1 a " : " # 2 1 b e 2 b "
}
}
TabButton {
text: qsTr ( "Login with Seed (Mnemonic)" )
width: implicitWidth
onClicked: authStack . currentIndex = 2
background: Rectangle {
color: buttonsBar . buttonColor / / N e r o s h o p C o m p o n e n t s . S t y l e . m o n e r o G r a y C o l o r
}
}
TabButton {
text: qsTr ( "Login with Keys" )
width: implicitWidth
onClicked: authStack . currentIndex = 3
background: Rectangle {
color: buttonsBar . buttonColor / / " # 4 0 2 e f 7 "
}
}
TabButton {
text: qsTr ( "Login with Hardware wallet" )
width: implicitWidth
/ / o n C l i c k e d : a u t h S t a c k . c u r r e n t I n d e x = 4
background: Rectangle {
color: buttonsBar . buttonColor / / " r e d "
}
}
}
/ / / / / / / / / / / / / / / / / / / / / / / / / / /
StackLayout { / / P e r f e c t f o r a s t a c k o f i t e m s w h e r e o n l y o n e i t e m i s v i s i b l e a t a t i m e / / C o l u m n L a y o u t { / / F r o m t o p t o b o t t o m
id: auth_stack / / a u t h _ m e n u i n s i d e h o m e m e n u
id: auth S tack / / a u t h _ m e n u i n s i d e h o m e m e n u
/ / a n c h o r s . f i l l : p a r e n t / / w i l l f i l l e n t i r e W i n d o w a r e a
currentIndex: 1
width: 800 / / 5 0 0
height: 500 / / 3 0 0
x: parent . width / 2 - this . width / 2 / / w i n d o w i s t h e i d o f A p p l i c a t i o n W i n d o w
y: parent . height / 2 - this . height / 2
currentIndex: buttonsBar . currentIndex / / c u r r e n t I n d e x : 1
width: parent . width
height: parent . height
anchors.top: buttonsBar . bottom / /y: parent.height / 2 - this . height / 2
anchors.topMargin: 0
anchors.left: buttonsBar . left
anchors.leftMargin: 0
/ / g e n e r a t e a u t h k e y s p a g e
Rectangle {
id: genkey_page
id: registerP age
color: ( NeroshopComponents . Style . darkTheme ) ? "#2e2e2e" : "#a0a0a0" / / 1 6 0 , 1 6 0 , 1 6 0
/ / o p t i o n a l p s e u d o n y m e d i t
TextField {
id: opt_username_edit
placeholderText: qsTr ( "Pseudonym (optional)" )
placeholderTextColor: "#696969" / / d i m g r a y
color: "#6b5b95"
/ / x : s e e d _ d i s p l a y _ s c r o l l v i e w . x
anchors.left: seed_display_scrollview . left
/ / y : s e e d _ d i s p l a y _ s c r o l l v i e w . y + s e e d _ d i s p l a y _ s c r o l l v i e w . h e i g h t + 3 0
anchors.top: seed_display_scrollview . bottom
anchors.topMargin: 30
selectByMouse: true
width: 300
background: Rectangle {
color: ( NeroshopComponents . Style . darkTheme ) ? "transparent" : "#101010" / / " # 1 0 1 0 1 0 " = r g b ( 1 6 , 1 6 , 1 6 )
border.color: "#696969" / / dim gray/ / "#ffffff"
border.width: ( NeroshopComponents . Style . darkTheme ) ? 1 : 0
}
/ / v a l i d a t o r : R e g E x p V a l i d a t o r { r e g E x p : / ^ ( ? = . { 8 , 2 0 } $ ) ( ? ! [ _ . ] ) ( ? ! . * [ _ . ] { 2 } ) [ a - z A - Z 0 - 9 . _ ] + ( ? < ! [ _ . ] ) $ / } / / v a l i d a t o r : R e g u l a r E x p r e s s i o n V a l i d a t o r { r e g u l a r E x p r e s s i o n : / [ 0 - 9 A - F ] + / } / / s i n c e Q t 5 . 1 4
}
/ / r e g i s t e r b u t t o n
Button {
id: wallet_register_button
text: qsTr ( "Register" )
/ / x : c o p y _ b u t t o n . x / / o p t _ u s e r n a m e _ e d i t . x + o p t _ u s e r n a m e _ e d i t . w i d t h + 5 0
anchors.left: opt_username_edit . right / / c o p y _ b u t t o n . l e f t
anchors.leftMargin: 20
/ / y : o p t _ u s e r n a m e _ e d i t . y + v e r t i c a l C e n t e r o f u s e r n a m e _ e d i t
anchors.top: opt_username_edit . top
anchors.topMargin: ( opt_username_edit . height / 2 ) - ( this . height / 2 )
width: 180 / / c o p y _ b u t t o n . w i d t h
height: 60 + 5 / /50 / / width will be set automatically based on text length
onClicked: register_wallet ( )
contentItem: Text {
font.family: "Consolas" ; / / f o n t . f a m i l y : N e r o s h o p C o m p o n e n t s . S t y l e . f o n t F i r a C o d e L i g h t . n a m e
/ / f o n t . p o i n t S i z e : 1 0
font.bold: true
text: wallet_register_button . text
color: "#ffffff" / / w h i t e
horizontalAlignment: Text . AlignHCenter
verticalAlignment: Text . AlignVCenter
}
background: Rectangle {
color: "#6b5b95" / / # f f 6 6 0 0 i s t h e m o n e r o o r a n g e c o l o r
radius: 0
}
}
/ / c h a n g e w a l l e t p a t h e d i t
/ / . . .
/ / w a l l e t p a s s w o r d c r e a t e e d i t
TextField {
id: wallet_password_create_edit
id: walletPasswordField
placeholderText: qsTr ( "Wallet Password" )
placeholderTextColor: "#a9a9a9" / / d a r k g r a y
color: NeroshopComponents . Style . moneroOrangeColor / /"#ff6600" / / textColor
@ -193,22 +210,39 @@ Page {
}
/ / w a l l e t p a s s w o r d c o n f i r m e d i t
TextField {
id: wallet _password_confirm_edit
id: wallet PasswordConfirmField
placeholderText: qsTr ( "Confirm Wallet Password" )
placeholderTextColor: "#a9a9a9" / / d a r k g r a y
color: NeroshopComponents . Style . moneroOrangeColor / /"#ff6600" / / textColor
echoMode: TextInput . Password
inputMethodHints: Qt . ImhSensitiveData
selectByMouse: true
x: wallet _password_create_edit . x
y: wallet _password_create_edit. y + wallet_password_create_edit . height + 5
width: wallet _password_create_edit. width ; height: wallet_password_create_edit . height
x: wallet PasswordField . x
y: wallet PasswordField. y + walletPasswordField . height + 5
width: wallet PasswordField. width ; height: walletPasswordField . height
background: Rectangle {
color: NeroshopComponents . Style . moneroGrayColor
border.color: parent . placeholderTextColor
border.width: ( NeroshopComponents . Style . darkTheme ) ? 1 : 0
}
}
/ / t o o l t i p
NeroshopComponents . Hint {
id: walletHint
text: "This is the wallet password and psuedonym error message tooltip"
height: walletPasswordField . height + walletPasswordConfirmField . height + 5 / / 5 i s t h e g a p b e t w e e n t h e t w o
x: walletPasswordField . x + walletPasswordField . width + 5 / / a n c h o r s . l e f t : w a l l e t P a s s w o r d F i e l d . r i g h t
/ / a n c h o r s . l e f t M a r g i n : 0
y: walletPasswordField . y / / a n c h o r s . t o p : w a l l e t P a s s w o r d F i e l d . t o p
visible: false
color: "firebrick"
rect.opacity: 1.0
/ / t e x t C o l o r : " # f f f f f f "
/ / b o r d e r C o l o r :
/ / b o r d e r W i d t h :
radius: 0
}
/ / g e n e r a t e k e y b u t t o n
Button {
id: generate_key_button
@ -218,11 +252,11 @@ Page {
width: 150
height: 60 + 5 / /50 / / width will be set automatically based on text length
onClicked: generate _k eys( )
onClicked: generate WalletK eys( )
contentItem: Text {
font.family: "Consolas" ;
font.pointSize: 10 ;
/ / f o n t . f a m i l y : " C o n s o l a s " ;
/ / f o n t . p o i n t S i z e : 1 0 ;
font.bold: true
text: generate_key_button . text
color: "#ffffff" / / w h i t e
@ -237,12 +271,13 @@ Page {
}
/ / I m p o r t a n t m e s s a g e b o x
TextField {
id: important_message_f ield
id: walletMessageF ield
visible: false
x: ( genkey_page . width / 2 ) - ( this . width / 2 ) / / place at center of genkey_page/ / generate_key_button . x
y: generate_key_button . y + generate_key_button . height + 20
/ * x : s e e d _ d i s p l a y _ s c r o l l v i e w . x
y: seed_display_scrollview . y + seed_display_scrollview . height + 10 * /
anchors.horizontalCenter: registerPage . horizontalCenter / / place at center of registerPage/ / generate_key_button . x
anchors.top: generate_key_button . bottom
anchors.topMargin: 20
/ * x : s e e d D i s p l a y S c r o l l V i e w . x
y: seedDisplayScrollView . y + seedDisplayScrollView . height + 10 * /
readOnly: true
/ / t e x t : q s T r ( " " )
color: "#ffffff" / / t e x t c o l o r
@ -252,15 +287,15 @@ Page {
}
/ / w a l l e t s e e d d i s p l a y
ScrollView {
id: seed _display_scrollv iew
id: seed DisplayScrollV iew
/ / a n c h o r s . f i l l : p a r e n t
width: 500 / / 3 0 0
height: 250 / / 1 5 0
x: generate_key_button . x / / 2 0
y: ( important_message_field. visible ) ? important_message_field . y + important_message_f ield. height + 20 : generate_key_button . y + generate_key_button . height + 20 / / ge n k e y _ p a g e . h e i g h t - t h i s . h e i g h t - 2 0
y: ( walletMessageField. visible ) ? walletMessageField . y + walletMessageF ield. height + 20 : generate_key_button . y + generate_key_button . height + 20 / / re g i s t e r P a g e . h e i g h t - t h i s . h e i g h t - 2 0
TextArea {
id: seed _display_e dit
id: seed DisplayE dit
readOnly: true
/ / t e x t : q s T r ( " " )
color: "#000000" / / t e x t c o l o r
@ -279,11 +314,11 @@ Page {
onClicked: ( mouse ) = > {
/ / l e f t m o u s e = d i s p l a y L i s t O p t i o n s ( )
if ( ( mouse . button == Qt . LeftButton ) ) {
/ / c o n s o l e . l o g ( " L e f t m o u s e c l i c k e d o n s e e d _d i s p l a y _ e d i t " ) ;
/ / c o n s o l e . l o g ( " L e f t m o u s e c l i c k e d o n s e e d Di s p l a y E d i t " ) ;
}
/ / r i g h t m o u s e = s e l e c t A l l ( )
if ( ( mouse . button == Qt . RightButton ) ) {
/ / c o n s o l e . l o g ( " R i g h t m o u s e c l i c k e d o n s e e d _d i s p l a y _ e d i t " ) ;
/ / c o n s o l e . l o g ( " R i g h t m o u s e c l i c k e d o n s e e d Di s p l a y E d i t " ) ;
}
}
/ * o n E n t e r e d : {
@ -299,23 +334,23 @@ Page {
focus: true
x: seed_display_mouse_area . mouseX
y: seed_display_mouse_area . mouseY
} * /
} * /
}
}
/ / c o p y _ b u t t o n ( c o p i e s t o t h e c l i p b o a r d )
Button {
id: copy_button
width: 100 ; height: seed _display_scrollv iew. height / / 5 0
/ / x : ( s e e d _d i s p l a y _ s c r o l l v i e w . x + s e e d _d i s p l a y _ s c r o l l v i e w . w i d t h ) + ( ge n k e y _ p a g e . w i d t h / 2 ) - ( ( t h i s . w i d t h + s e e d _d i s p l a y _ s c r o l l v i e w . w i d t h + 1 0 ) / 2 ) / / ( s e e d _d i s p l a y _ s c r o l l v i e w . x + s e e d _d i s p l a y _ s c r o l l v i e w . w i d t h ) + 5
anchors.left: seed _display_scrollview. right / / s e e d _ d i s p l a y _ s c r o l l v i e w . h o r i z o n t a l C e n t e r
anchors.leftMargin: ( parent . width / 2 ) - ( ( this . width + seed _display_scrollv iew. width + 10 ) / 2 )
/ / y : s e e d _d i s p l a y _ s c r o l l v i e w . y + ( s e e d _d i s p l a y _ s c r o l l v i e w . h e i g h t / 2 ) - ( t h i s . h e i g h t / 2 )
anchors.top: seed _display_scrollv iew. top
anchors.topMargin: ( seed _display_scrollv iew. height / 2 ) - ( this . height / 2 )
width: 100 ; height: seed DisplayScrollV iew. height / / 5 0
/ / x : ( s e e d Di s p l a y S c r o l l V i e w . x + s e e d Di s p l a y S c r o l l V i e w . w i d t h ) + ( re g i s t e r P a g e . w i d t h / 2 ) - ( ( t h i s . w i d t h + s e e d Di s p l a y S c r o l l V i e w . w i d t h + 1 0 ) / 2 ) / / ( s e e d Di s p l a y S c r o l l V i e w . x + s e e d Di s p l a y S c r o l l V i e w . w i d t h ) + 5
anchors.left: seed DisplayScrollView. right / / s e e d D i s p l a y S c r o l l V i e w . h o r i z o n t a l C e n t e r
anchors.leftMargin: ( parent . width / 2 ) - ( ( this . width + seed DisplayScrollV iew. width + 10 ) / 2 )
/ / y : s e e d Di s p l a y S c r o l l V i e w . y + ( s e e d Di s p l a y S c r o l l V i e w . h e i g h t / 2 ) - ( t h i s . h e i g h t / 2 )
anchors.top: seed DisplayScrollV iew. top
anchors.topMargin: ( seed DisplayScrollV iew. height / 2 ) - ( this . height / 2 )
text: qsTr ( "Copy" ) / / r a t h e r h a v e a n i c o n w i t h a t o o l t i p t h a n a t e x t
display: AbstractButton . IconOnly / / w i l l o n l y s h o w t h e i c o n a n d n o t t h e t e x t
/ / t h i s o n l y w o r k s o n s e l e c t e d t e x t
onClicked: copy _to_clipboard( ) / /seed_display_edit.copy()/ / copy_to_c lipboard( )
onClicked: copy ToClipboard( ) / /seedDisplayEdit.copy()/ / copyToC lipboard( )
ToolTip.delay: 500 / / s h o w s t o o l t i p a f t e r h o v e r i n g f o r 0 . 5 s e c o n d
ToolTip.visible: hovered
@ -331,7 +366,55 @@ Page {
border.color: this . parent . hovered ? "#ffffff" : this . color
}
}
} / / e o f g e n k e y _ p a g e
/ / o p t i o n a l p s e u d o n y m e d i t
TextField {
id: optNameEdit
placeholderText: qsTr ( "Pseudonym (optional)" )
placeholderTextColor: "#696969" / / d i m g r a y
color: "#6b5b95"
/ / x : s e e d D i s p l a y S c r o l l V i e w . x
anchors.left: seedDisplayScrollView . left
/ / y : s e e d D i s p l a y S c r o l l V i e w . y + s e e d D i s p l a y S c r o l l V i e w . h e i g h t + 3 0
anchors.top: seedDisplayScrollView . bottom
anchors.topMargin: 30
selectByMouse: true
width: 300
background: Rectangle {
color: ( NeroshopComponents . Style . darkTheme ) ? "transparent" : "#101010" / / " # 1 0 1 0 1 0 " = r g b ( 1 6 , 1 6 , 1 6 )
border.color: "#696969" / / dim gray/ / "#ffffff"
border.width: ( NeroshopComponents . Style . darkTheme ) ? 1 : 0
}
/ / v a l i d a t o r : R e g E x p V a l i d a t o r { r e g E x p : / ^ ( ? = . { 8 , 2 0 } $ ) ( ? ! [ _ . ] ) ( ? ! . * [ _ . ] { 2 } ) [ a - z A - Z 0 - 9 . _ ] + ( ? < ! [ _ . ] ) $ / } / / v a l i d a t o r : R e g u l a r E x p r e s s i o n V a l i d a t o r { r e g u l a r E x p r e s s i o n : / [ 0 - 9 A - F ] + / } / / s i n c e Q t 5 . 1 4
}
/ / r e g i s t e r b u t t o n
Button {
id: wallet_register_button
text: qsTr ( "Register" )
anchors.left: optNameEdit . right
anchors.leftMargin: 20
anchors.verticalCenter: optNameEdit . verticalCenter
width: 180 / / c o p y _ b u t t o n . w i d t h
height: 60 + 5 / /50 / / width will be set automatically based on text length
onClicked: registerWallet ( )
contentItem: Text {
/ / f o n t . f a m i l y : " C o n s o l a s " ; / / f o n t . f a m i l y : N e r o s h o p C o m p o n e n t s . S t y l e . f o n t F i r a C o d e L i g h t . n a m e
/ / f o n t . p o i n t S i z e : 1 0
font.bold: true
text: wallet_register_button . text
color: "#ffffff" / / w h i t e
horizontalAlignment: Text . AlignHCenter
verticalAlignment: Text . AlignVCenter
}
background: Rectangle {
color: "#6b5b95" / / # f f 6 6 0 0 i s t h e m o n e r o o r a n g e c o l o r
radius: 0
}
}
} / / e o f r e g i s t e r P a g e
/ / w a l l e t f i l e a u t h p a g e
/ / U p l o a d b u t t o n w i t h r e a d - o n l y t e x t f i e l d
Rectangle {
@ -354,7 +437,7 @@ Page {
y: 20 / / t o p _ m a r g i n
width: 300 ; height: 30
readOnly: true
text: wallet _file_d ialog. file / / p r o p e r t y u r l s o u r c e : w a l l e t _f i l e _ d i a l o g . f i l e ; t e x t : t h i s . s o u r c e
text: wallet FileD ialog. file / / p r o p e r t y u r l s o u r c e : w a l l e t Fi l e D i a l o g . f i l e ; t e x t : t h i s . s o u r c e
/ / / / p l a c e h o l d e r T e x t : q s T r ( " . . . " ) / / e h . . . p r o b a b l y n o t n e c e s s a r y ( b e t t e r t o j u s t l e a v e i t b l a n k )
/ / c h a n g e T e x t F i e l d c o l o r
background: Rectangle {
@ -367,7 +450,7 @@ Page {
Button {
id: wallet_upload_button
text: qsTr ( "Upload" )
onClicked: wallet _file_d ialog. open ( )
onClicked: wallet FileD ialog. open ( )
display: AbstractButton . IconOnly / /AbstractButton.TextBesideIcon/ / AbstractButton . TextOnly
/ / h o v e r E n a b l e d : t r u e
x: wallet_upload_edit . x + wallet_upload_edit . width + 5
@ -455,65 +538,5 @@ Page {
id: keys_auth_page
color: ( NeroshopComponents . Style . darkTheme ) ? "#2e2e2e" : "#a0a0a0"
}
}
/ / / / / / / / / / / / / / / / / / / / / / / / / / /
RowLayout { / / T a b B a r {
/ / i d : a c c e s s _ b u t t o n s _ c o n t a i n e r
x: auth_stack . x + ( auth_stack . width / 2 ) - ( this . width / 2 ) / / c e n t e r t h e x
y: ( auth_stack . y + auth_stack . height ) + 5 / / 5 is the padding / / lower the y
Button { / / T a b B u t t o n { / / m u s t b e u s e d i n c o n j u n c t i o n w i t h a T a b B a r a c c o r d i n g t o : h t t p s : / / d o c . q t . i o / q t - 5 / q m l - q t q u i c k - c o n t r o l s 2 - t a b b u t t o n . h t m l
text: qsTr ( "register (genkey)" )
onClicked: auth_stack . currentIndex = 0
background: Rectangle {
color: "#00aebf"
}
}
Button { / / T a b B u t t o n {
id: login_button / / a u t h _ w a l l e t f i l e _ b u t t o n
text: qsTr ( "auth_with_walletfile" )
onClicked: auth_stack . currentIndex = 1
contentItem: Text {
font.family: "Consolas" ;
font.pointSize: 10 ;
font.bold: true
text: login_button . text
color: "#ffffff" / / w h i t e t e x t
}
background: Rectangle {
color: NeroshopComponents . Style . moneroOrangeColor / /"#ff6600"/ / parent . down ? "#bbbbbb" :
/ / ( p a r e n t . h o v e r e d ? " # d 6 d 6 d 6 " : " # f 6 f 6 f 6 " )
radius: 0
border.color: login_button . hovered ? "#ffffff" : this . color / /"#ffffff"/ / control . down ? "#17a81a" : "#21be2b"
}
}
Button { / / T a b B u t t o n {
text: qsTr ( "auth_with_seed" )
onClicked: auth_stack . currentIndex = 2
background: Rectangle {
color: NeroshopComponents . Style . moneroGrayColor
}
}
Button { / / T a b B u t t o n {
text: qsTr ( "auth_with_keys" )
onClicked: auth_stack . currentIndex = 3
background: Rectangle {
color: "#402ef7"
}
}
Button { / / T a b B u t t o n {
text: qsTr ( "auth_with_hw" )
/ / o n C l i c k e d : a u t h _ s t a c k . c u r r e n t I n d e x = 4
background: Rectangle {
color: "red"
}
}
}
}