animations and relative height based on content

This commit is contained in:
Zacharias-Brohn
2025-11-10 10:05:02 +01:00
parent d02e60a682
commit 2a054f7c1a
+22 -13
View File
@@ -50,22 +50,31 @@ Scope {
id: backgroundRect id: backgroundRect
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 200 anchors.topMargin: 200
implicitHeight: 800 implicitHeight: mainLayout.childrenRect.height + 20
implicitWidth: 600 implicitWidth: 600
x: Math.round(( parent.width - width ) / 2 ) x: Math.round(( parent.width - width ) / 2 )
color: "#d01a1a1a" color: "#d01a1a1a"
radius: 8 radius: 8
border.color: "#444444" border.color: "#444444"
border.width: 1 border.width: 1
ColumnLayout {
Behavior on implicitHeight {
Anim {
duration: MaterialEasing.expressiveFastSpatialTime
easing.bezierCurve: MaterialEasing.expressiveDefaultSpatial
}
}
Column {
id: mainLayout
anchors.fill: parent anchors.fill: parent
anchors.margins: 10 anchors.margins: 10
spacing: 5
TextField { TextField {
id: searchInput id: searchInput
Layout.fillWidth: true implicitHeight: 30
Layout.preferredHeight: 30 implicitWidth: parent.width
Layout.leftMargin: 5
color: "white" color: "white"
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
echoMode: TextInput.Normal echoMode: TextInput.Normal
@@ -142,15 +151,15 @@ Scope {
Rectangle { Rectangle {
id: separator id: separator
Layout.fillWidth: true implicitWidth: parent.width
Layout.preferredHeight: 1 implicitHeight: 1
color: "#444444" color: "#444444"
} }
Rectangle { Rectangle {
id: appListRect id: appListRect
Layout.fillWidth: true implicitWidth: parent.width
Layout.fillHeight: true implicitHeight: appListView.implicitHeight
color: "transparent" color: "transparent"
clip: true clip: true
ListView { ListView {
@@ -164,6 +173,8 @@ Scope {
} }
} }
implicitHeight: Math.min( count, 15 ) * 48
preferredHighlightBegin: 0 preferredHighlightBegin: 0
preferredHighlightEnd: appListRect.height preferredHighlightEnd: appListRect.height
highlightFollowsCurrentItem: false highlightFollowsCurrentItem: false
@@ -255,7 +266,6 @@ Scope {
} }
add: Transition { add: Transition {
enabled: !appListView.state
Anim { Anim {
properties: "opacity" properties: "opacity"
from: 0 from: 0
@@ -264,13 +274,12 @@ Scope {
Anim { Anim {
properties: "scale" properties: "scale"
from: 0.9 from: 0.95
to: 1 to: 1
} }
} }
remove: Transition { remove: Transition {
enabled: !appListView.state
Anim { Anim {
properties: "opacity" properties: "opacity"
from: 1 from: 1
@@ -280,7 +289,7 @@ Scope {
Anim { Anim {
properties: "scale" properties: "scale"
from: 1 from: 1
to: 0.9 to: 0.95
} }
} }