2023-05-16 17:48:30 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2021 by Oleksandr Zolotov <alex@nextcloud.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
import QtQml 2.15
|
|
|
|
import QtQuick 2.15
|
2022-08-09 00:40:19 +03:00
|
|
|
import QtQuick.Layouts 1.15
|
2022-11-23 20:58:14 +03:00
|
|
|
import Qt5Compat.GraphicalEffects
|
2022-08-09 00:40:19 +03:00
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
import Style 1.0
|
|
|
|
|
2022-08-09 00:40:19 +03:00
|
|
|
ColumnLayout {
|
2021-09-09 14:33:57 +03:00
|
|
|
id: unifiedSearchResultsListViewSkeletonColumn
|
|
|
|
|
2022-07-11 18:52:31 +03:00
|
|
|
property int animationRectangleWidth: Style.trayWindowWidth
|
|
|
|
|
2022-08-09 00:40:19 +03:00
|
|
|
Item {
|
|
|
|
id: placeholderSectionHeader
|
|
|
|
|
|
|
|
property rect textRect: fontMetrics.boundingRect("Dummy text")
|
|
|
|
|
|
|
|
Layout.topMargin: Style.unifiedSearchResultSectionItemVerticalPadding / 2
|
|
|
|
Layout.bottomMargin: Style.unifiedSearchResultSectionItemVerticalPadding / 2
|
|
|
|
Layout.leftMargin: Style.unifiedSearchResultSectionItemLeftPadding
|
|
|
|
|
|
|
|
width: textRect.width
|
|
|
|
height: textRect.height
|
|
|
|
|
|
|
|
FontMetrics {
|
|
|
|
id: fontMetrics
|
|
|
|
font.pixelSize: Style.unifiedSearchResultTitleFontSize
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: placeholderSectionHeaderRectangle
|
|
|
|
anchors.fill: parent
|
|
|
|
radius: Style.veryRoundedButtonRadius
|
2023-05-25 06:51:51 +03:00
|
|
|
color: palette.light
|
2022-08-09 00:40:19 +03:00
|
|
|
clip: true
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
x: mapFromItem(placeholderSectionHeader, 0, 0).x
|
|
|
|
height: parent.height
|
|
|
|
sourceComponent: UnifiedSearchResultItemSkeletonGradientRectangle {
|
|
|
|
width: unifiedSearchResultsListViewSkeletonColumn.animationRectangleWidth
|
|
|
|
height: parent.height
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: placeholderSectionHeaderMask
|
|
|
|
anchors.fill: placeholderSectionHeaderRectangle
|
|
|
|
color: "white"
|
|
|
|
radius: Style.veryRoundedButtonRadius
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
|
|
|
|
OpacityMask {
|
|
|
|
anchors.fill: placeholderSectionHeaderRectangle
|
|
|
|
source: placeholderSectionHeaderRectangle
|
|
|
|
maskSource: placeholderSectionHeaderMask
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-09 14:33:57 +03:00
|
|
|
Repeater {
|
2022-07-11 18:52:31 +03:00
|
|
|
model: Math.ceil(unifiedSearchResultsListViewSkeletonColumn.height / Style.trayWindowHeaderHeight)
|
2021-09-09 14:33:57 +03:00
|
|
|
UnifiedSearchResultItemSkeleton {
|
|
|
|
width: unifiedSearchResultsListViewSkeletonColumn.width
|
2022-07-11 18:52:31 +03:00
|
|
|
height: Style.trayWindowHeaderHeight
|
|
|
|
animationRectangleWidth: unifiedSearchResultsListViewSkeletonColumn.animationRectangleWidth
|
2021-09-09 14:33:57 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|