-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActionBarMultiActionButton.qml
More file actions
45 lines (39 loc) · 1.1 KB
/
ActionBarMultiActionButton.qml
File metadata and controls
45 lines (39 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import qmlcomponents
import qmlenumvalues
ActionBarButton {
id: root
property alias direction: expandable.direction
property bool showMultiAction: controller != null ? root.buttonData.multiActionExpanded : false
ActionBarMultiActionExpandable {
id: expandable
controller: root.controller
buttonData: root.buttonData.multiActions
visible: root.showMultiAction
}
states: [
State {
name: "showMultiAction"
when: root.showMultiAction
}
]
transitions: [
Transition {
to: "showMultiAction"
ParentAnimation {
target: expandable
}
PropertyAction { target: expandable; property: "parent"; value: root.parentWhileDragging }
ScriptAction {
script: {
let expandableOffset = expandable.getPositioningOffset();
let posAtRoot = root.mapToItem(root.parentWhileDragging, 0, 0);
expandable.x = posAtRoot.x + expandableOffset.x;
expandable.y = posAtRoot.y + expandableOffset.y;
}
}
} //Transition
] //transitions
}