2021-11-30 13:51:01 +01:00
/*
* This file is part of the Flowee project
* Copyright (C) 2021 Tom Zander <tom@flowee.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2022-11-26 10:46:57 +01:00
import QtQuick
import QtQuick . Controls
2022-11-14 21:19:31 +01:00
import "../Flowee" as Flowee
2021-11-24 19:20:06 +01:00
Item {
id: root
Rectangle {
id: background
color: "black"
opacity: priv . collapsed ? 0 : 0.2
anchors.fill: parent
Behavior on opacity { NumberAnimation { } }
}
MouseArea {
// area over the background to close our screen should the user click there.
width: parent . width
y: priv . y + priv . height
height: parent . height - y
enabled: ! priv . collapsed
visible: enabled
onClicked: priv . collapsed = true
cursorShape: Qt . UpArrowCursor
}
Item {
id: priv
width: parent . width
height: content . height + content . y
clip: true
property bool collapsed: true
Rectangle {
x: - width / 2
y: - height / 2
radius: width / 2
width: priv . collapsed ? 70 : priv . width * 2.9
height: priv . collapsed ? 70 : priv . height * 2.9
2023-02-21 16:40:46 +01:00
color: priv . collapsed ? palette.windowText : palette . window
2021-11-24 19:20:06 +01:00
Behavior on color { ColorAnimation { duration: 400 } }
Behavior on width { NumberAnimation { duration: 400 } }
Behavior on height { NumberAnimation { duration: 400 } }
}
MouseArea {
visible: ! priv . collapsed
anchors.fill: parent
// dummy, just make sure that the background doensn't get them.
}
Item {
id: content
y: 20
opacity: priv . collapsed ? 0 : 1
visible: opacity != 0
width: parent . width
2021-11-30 13:50:40 +01:00
height: randomRect . height + title . height + 30
2021-11-24 19:20:06 +01:00
Label {
id: title
2021-11-30 13:50:40 +01:00
text: qsTr ( "Add Detail" )
2021-11-24 19:20:06 +01:00
font.pointSize: 20
anchors.horizontalCenter: parent . horizontalCenter
}
2021-11-30 13:50:40 +01:00
Rectangle {
id: randomRect
width: inputSelectorButton . width + 30
height: width
2021-11-24 19:20:06 +01:00
anchors.top: title . bottom
2021-11-30 13:50:40 +01:00
anchors.topMargin: 10
x: 10
2023-02-21 16:40:46 +01:00
color: palette . light
2021-11-30 13:50:40 +01:00
border.width: 2
2023-02-21 16:40:46 +01:00
border.color: palette . shadow
2021-11-24 19:20:06 +01:00
Flowee . Button {
2021-11-30 13:50:40 +01:00
id: inputSelectorButton
text: qsTr ( "Coin Selector" )
y: 15
2021-11-24 19:20:06 +01:00
anchors.horizontalCenter: parent . horizontalCenter
onClicked: {
payment . addInputSelector ( ) ;
priv . collapsed = true
}
}
2021-11-30 13:50:40 +01:00
}
Label {
id: helpText
anchors.top: randomRect . top
anchors.topMargin: 20
anchors.left: randomRect . right
anchors.leftMargin: 10
anchors.right: parent . right
wrapMode: Label . Wrap
text: qsTr ( "To override the default selection of coins that are used to pay a transaction, you can add the 'Coin Selector' where the wallets coins will be made visible." )
2021-11-24 19:20:06 +01:00
}
// line
Rectangle {
color: "black"
height: 4
width: parent . width
anchors.bottom: parent . bottom
}
Flowee . CloseIcon {
anchors.right: parent . right
anchors.rightMargin: 10
onClicked: priv . collapsed = true
}
}
MouseArea {
visible: priv . collapsed
width: 60
height: 30
cursorShape: Qt . ClosedHandCursor
onClicked: priv . collapsed = false
}
}
// the two lines that make up the "+" icon
Rectangle {
opacity: priv . collapsed ? 1 : 0
2023-02-21 16:40:46 +01:00
color: palette . window
2021-11-24 19:20:06 +01:00
width: 17
height: 3
x: 6
y: 13
}
Rectangle {
opacity: priv . collapsed ? 1 : 0
2023-02-21 16:40:46 +01:00
color: palette . window
2021-11-24 19:20:06 +01:00
width: 3
height: 17
y: 6
x: 13
}
}