mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 22:06:25 +00:00
4ee21ada05
Introduced Style.svg() Style.png() Style.emoji() and Style.icon() in Style.qml. Those should be used to set the source in Images instead of using relative paths. Usage: Image { source: Style.svg("check) .... Also moved all Singletons inside a new "utils" folder and made it a QML module, to use import utils 1.0 instead of relative paths Closes #3678
70 lines
1.6 KiB
QML
70 lines
1.6 KiB
QML
import QtQuick 2.13
|
|
import QtQuick.Controls 2.13
|
|
|
|
import utils 1.0
|
|
|
|
StackView {
|
|
id: root
|
|
default property list<FormGroup> groups
|
|
property int currentIdx: 0
|
|
property bool isLastGroup: currentIdx === groups.length - 1
|
|
property bool isFirstGroup: currentIdx === 0
|
|
signal groupActivated(Item group)
|
|
property alias currentGroup: root.currentItem
|
|
readonly property string uuid: Utils.uuid()
|
|
|
|
property var next: function() {
|
|
if (groups && groups.length <= currentIdx + 1) {
|
|
return
|
|
}
|
|
const group = groups[++currentIdx]
|
|
this.push(group, StackView.Immediate)
|
|
}
|
|
property var back: function() {
|
|
if (currentIdx <= 0) {
|
|
return
|
|
}
|
|
this.pop()
|
|
currentIdx--
|
|
}
|
|
|
|
initialItem: groups[currentIdx]
|
|
anchors.fill: parent
|
|
|
|
// The below transitions are pointless, but without them,
|
|
// the final input in the final TransactionFormGroup will
|
|
// not be able to receive focus! Seems like a Qt bug...
|
|
pushEnter: Transition {
|
|
PropertyAnimation {
|
|
property: "opacity"
|
|
from: 1
|
|
to:1
|
|
duration: 1
|
|
}
|
|
}
|
|
pushExit: Transition {
|
|
PropertyAnimation {
|
|
property: "opacity"
|
|
from: 1
|
|
to:1
|
|
duration: 1
|
|
}
|
|
}
|
|
popEnter: Transition {
|
|
PropertyAnimation {
|
|
property: "opacity"
|
|
from: 1
|
|
to:1
|
|
duration: 1
|
|
}
|
|
}
|
|
popExit: Transition {
|
|
PropertyAnimation {
|
|
property: "opacity"
|
|
from: 1
|
|
to:1
|
|
duration: 1
|
|
}
|
|
}
|
|
}
|