mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-06 10:32:44 +00:00
WIP: implement search
This commit is contained in:
parent
79d378c9ed
commit
eac8faf173
9 changed files with 356 additions and 77 deletions
|
@ -30,6 +30,7 @@ SilicaItem {
|
|||
property string fallbackImage
|
||||
property bool usingFallbackImage
|
||||
property color fallbackColor: Theme.highlightColor
|
||||
property bool hideFallbackColor: false
|
||||
|
||||
property var __parentPage : null
|
||||
property bool alreadyLoaded: false
|
||||
|
@ -56,7 +57,7 @@ SilicaItem {
|
|||
anchors.fill: parent
|
||||
asynchronous: true
|
||||
fillMode: root.fillMode
|
||||
opacity: 1
|
||||
opacity: hideFallbackColor ? 0.0 : 1.0
|
||||
source: alreadyLoaded || [PageStatus.Active, PageStatus.Deactivating].indexOf(__parentPage.status) >= 0 ? root.source : ""
|
||||
onStatusChanged: {
|
||||
if (status == Image.Ready) {
|
||||
|
@ -73,6 +74,7 @@ SilicaItem {
|
|||
GradientStop { position: 1.0; color: Theme.highlightDimmerFromColor(fallbackColor, Theme.colorScheme); }
|
||||
}
|
||||
opacity: 0
|
||||
visible: !hideFallbackColor
|
||||
}
|
||||
|
||||
Image {
|
||||
|
@ -132,7 +134,7 @@ SilicaItem {
|
|||
when: realImage.status === Image.Ready
|
||||
PropertyChanges {
|
||||
target: realImage
|
||||
//opacity: 1
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
40
sailfish/qml/components/search/SearchResults.qml
Normal file
40
sailfish/qml/components/search/SearchResults.qml
Normal file
|
@ -0,0 +1,40 @@
|
|||
import QtQuick 2.6
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
import nl.netsoj.chris.Jellyfin 1.0
|
||||
|
||||
SilicaListView {
|
||||
id: root
|
||||
model: query.length ? searchModel : 0
|
||||
property alias query: searchModel.searchTerm
|
||||
delegate: ListItem {
|
||||
width: parent.width
|
||||
height: Theme.itemSizeLarge
|
||||
Label {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width
|
||||
text: model.name
|
||||
}
|
||||
}
|
||||
add: Transition {
|
||||
NumberAnimation { property: "scale"; from: 0.0001; to: 1.0; }
|
||||
FadeAnimation { from: 0.0; to: 1.0; }
|
||||
}
|
||||
|
||||
move: Transition {
|
||||
NumberAnimation {
|
||||
properties: "x,y"
|
||||
}
|
||||
}
|
||||
|
||||
remove: Transition {
|
||||
NumberAnimation { property: "scale"; from: 1.0; to: 0.0001; }
|
||||
FadeAnimation { from: 1.0; to: 0.0; }
|
||||
}
|
||||
|
||||
SearchModel {
|
||||
id: searchModel
|
||||
apiClient: ApiClient
|
||||
recursive: true
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue