Commit 8a4f3930 authored by Nate Graham's avatar Nate Graham
Browse files

NavigationActionBar: port away from explicit States

Since we have two simple conditions that differ only by the value of one
property, we can avoid explicit States to make the code shorter and
less indirect.
parent 1d36d107
Pipeline #147193 passed with stage
in 3 minutes and 44 seconds
......@@ -283,7 +283,10 @@ Item {
icon.name: 'search'
checkable: true
checked: expandedFilterView
onClicked: persistentSettings.expandedFilterView = !persistentSettings.expandedFilterView
onClicked: {
persistentSettings.expandedFilterView = !persistentSettings.expandedFilterView
filterTextInput.forceActiveFocus()
}
}
]
}
......@@ -356,7 +359,13 @@ Item {
visible: opacity > 0.0
opacity: 0
opacity: expandedFilterView ? 1 : 0
Behavior on opacity {
NumberAnimation {
easing.type: Easing.Linear
duration: Kirigami.Units.longDuration
}
}
contentItems: [
Kirigami.SearchField {
......@@ -456,39 +465,4 @@ Item {
}
}
}
states: [
State {
name: 'collapsed'
when: !expandedFilterView
PropertyChanges {
target: filterRow
opacity: 0.0
}
StateChangeScript {
// Focus main content view since that's probably what the user
// wants to interact with next
script: contentDirectoryView.forceActiveFocus();
}
},
State {
name: 'expanded'
when: expandedFilterView
PropertyChanges {
target: filterRow
opacity: 1.0
}
StateChangeScript {
script: filterTextInput.forceActiveFocus()
}
}
]
transitions: Transition {
from: "expanded,collapsed"
PropertyAnimation {
properties: "opacity"
easing.type: Easing.Linear
duration: Kirigami.Units.longDuration
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment