Refactor ContentView to add animated scrolling
This commit is contained in:
@@ -15,7 +15,13 @@ Column {
|
||||
Row {
|
||||
Item {
|
||||
height: parent.height
|
||||
width: 16
|
||||
width: 16 + (xIndex * 270)
|
||||
Behavior on width {
|
||||
NumberAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.Linear
|
||||
}
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: title
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import QtQuick 2.12
|
||||
|
||||
Row {
|
||||
id: root
|
||||
property string title
|
||||
property int year
|
||||
property string description
|
||||
Item {
|
||||
height: parent.height
|
||||
width: 16
|
||||
}
|
||||
Column {
|
||||
height: parent.height
|
||||
width: parent.width - 16
|
||||
spacing: 20
|
||||
Item {
|
||||
height: 20
|
||||
width: parent.width
|
||||
}
|
||||
Text {
|
||||
text: title
|
||||
font.pointSize: 30
|
||||
color: "#cdd7d9"
|
||||
}
|
||||
Text {
|
||||
text: year
|
||||
font.pointSize: 15
|
||||
color: "#99afb4"
|
||||
}
|
||||
Text {
|
||||
text: description
|
||||
font.pointSize: 13
|
||||
color: "#cdd7d9"
|
||||
width: parent.width * 0.6
|
||||
wrapMode: Text.WordWrap
|
||||
maximumLineCount: 4
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user