mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-29 05:06:22 +00:00
feat(Collapse): supports target attribute
This commit is contained in:
parent
7e27ef88fe
commit
9d9e55c5d3
3 changed files with 29 additions and 35 deletions
|
|
@ -7,6 +7,10 @@ import Common.Styles 1.0
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
id: collapse
|
||||||
|
|
||||||
|
property var target
|
||||||
|
|
||||||
property bool _collapsed: false
|
property bool _collapsed: false
|
||||||
|
|
||||||
signal collapsed (bool collapsed)
|
signal collapsed (bool collapsed)
|
||||||
|
|
@ -31,13 +35,12 @@ Item {
|
||||||
icon: 'collapse'
|
icon: 'collapse'
|
||||||
iconSize: CollapseStyle.iconSize
|
iconSize: CollapseStyle.iconSize
|
||||||
|
|
||||||
onClicked: collapse()
|
onClicked: collapse.collapse()
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
|
|
||||||
states: [
|
states: State {
|
||||||
State {
|
|
||||||
name: 'Collapsed'
|
name: 'Collapsed'
|
||||||
when: _collapsed
|
when: _collapsed
|
||||||
|
|
||||||
|
|
@ -45,8 +48,17 @@ Item {
|
||||||
target: button
|
target: button
|
||||||
rotation: 180
|
rotation: 180
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PropertyChanges {
|
||||||
|
target: collapse.target
|
||||||
|
|
||||||
|
height: 480
|
||||||
|
maximumHeight: 99999
|
||||||
|
maximumWidth: 99999
|
||||||
|
minimumHeight: 480
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
|
||||||
|
|
||||||
transitions: Transition {
|
transitions: Transition {
|
||||||
RotationAnimation {
|
RotationAnimation {
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ Item {
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: 'Opened'
|
name: 'opened'
|
||||||
when: _isOpen
|
when: _isOpen
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
|
|
@ -119,7 +119,7 @@ Item {
|
||||||
transitions: [
|
transitions: [
|
||||||
Transition {
|
Transition {
|
||||||
from: ''
|
from: ''
|
||||||
to: 'Opened'
|
to: 'opened'
|
||||||
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: PopupStyle.animation.openingDuration
|
duration: PopupStyle.animation.openingDuration
|
||||||
|
|
@ -134,13 +134,13 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptAction {
|
ScriptAction {
|
||||||
script: menuOpened()
|
script: menuopened()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
Transition {
|
Transition {
|
||||||
from: 'Opened'
|
from: 'opened'
|
||||||
to: ''
|
to: ''
|
||||||
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
|
|
||||||
|
|
@ -37,13 +37,11 @@ ApplicationWindow {
|
||||||
|
|
||||||
// Collapse.
|
// Collapse.
|
||||||
Collapse {
|
Collapse {
|
||||||
Layout.preferredWidth: 25
|
|
||||||
Layout.fillHeight: parent.height
|
|
||||||
id: collapse
|
id: collapse
|
||||||
|
|
||||||
onCollapsed: windowStates.state = collapsed
|
Layout.fillHeight: parent.height
|
||||||
? 'collapsed'
|
Layout.preferredWidth: 25
|
||||||
: ''
|
target: window
|
||||||
}
|
}
|
||||||
|
|
||||||
// User info.
|
// User info.
|
||||||
|
|
@ -221,22 +219,6 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StateGroup {
|
|
||||||
id: windowStates
|
|
||||||
|
|
||||||
states: State {
|
|
||||||
name: 'collapsed'
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
height: 480
|
|
||||||
maximumHeight: 99999
|
|
||||||
maximumWidth: 99999
|
|
||||||
minimumHeight: 480
|
|
||||||
target: window
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: model1
|
id: model1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue