Commit 32bd1eec authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen

MediaLibraryView: Make TextInput for filtering

parent a21c2b35
......@@ -6,25 +6,68 @@ Rectangle {
color: "#999999"
ScrollView {
anchors.fill: parent
GridView {
id: gridView
model: mlModel
anchors.fill: parent
cellHeight: cellWidth
delegate: MediaItem {
width: gridView.cellWidth
height: width
duration: model.duration
thumbnailPath: model.thumbnailPath
title: model.title
}
id: sView
height: parent.height
width: parent.width
readonly property int viewWidth: viewport.width
Flickable {
id: fItem
contentHeight: inputRect.height + gridView.height
contentWidth: parent.width
Column {
Rectangle {
id: inputRect
width: sView.viewport.width
height: 30
color: "#222222"
// Avoid binding loop
onWidthChanged: {
cellWidth = width / 3;
Rectangle {
anchors.centerIn: parent
width: inputRect.width * 0.9
height: inputRect.height * 0.9
radius: 5
gradient: Gradient {
GradientStop {
position: 0.00;
color: "#313131";
}
GradientStop {
position: 1.00;
color: "#515151";
}
}
TextInput {
color: "#DDDDDD"
width: parent.width
anchors.centerIn: parent
}
}
}
GridView {
id: gridView
model: mlModel
width: sView.viewport.width
height: ( count + 3 - ( count % 3 ) ) / 3 * cellHeight
cellHeight: cellWidth
delegate: MediaItem {
width: gridView.cellWidth
height: width
duration: model.duration
thumbnailPath: model.thumbnailPath
title: model.title
}
}
}
}
// Avoid binding loop
onViewWidthChanged: {
gridView.cellWidth = viewWidth / 3;
}
}
}
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