|
@@ -2,9 +2,10 @@ import QtQml 2.15
|
|
|
import QtQuick 2.9
|
|
import QtQuick 2.9
|
|
|
import QtQuick.Controls 2.3
|
|
import QtQuick.Controls 2.3
|
|
|
import QtQuick.Layouts 1.2
|
|
import QtQuick.Layouts 1.2
|
|
|
-import Style 1.0
|
|
|
|
|
import QtGraphicalEffects 1.0
|
|
import QtGraphicalEffects 1.0
|
|
|
|
|
|
|
|
|
|
+import Style 1.0
|
|
|
|
|
+
|
|
|
RowLayout {
|
|
RowLayout {
|
|
|
id: unifiedSearchResultItemDetails
|
|
id: unifiedSearchResultItemDetails
|
|
|
|
|
|
|
@@ -12,14 +13,11 @@ RowLayout {
|
|
|
property string subline: ""
|
|
property string subline: ""
|
|
|
property string icons: ""
|
|
property string icons: ""
|
|
|
property string iconPlaceholder: ""
|
|
property string iconPlaceholder: ""
|
|
|
- property bool isRounded: false
|
|
|
|
|
|
|
|
|
|
|
|
+ property bool iconsIsThumbnail: false
|
|
|
|
|
+ property bool isRounded: false
|
|
|
|
|
|
|
|
- property int textLeftMargin: Style.unifiedSearchResultTextLeftMargin
|
|
|
|
|
- property int textRightMargin: Style.unifiedSearchResultTextRightMargin
|
|
|
|
|
- property int iconWidth: Style.unifiedSearchResultIconWidth
|
|
|
|
|
- property int iconLeftMargin: Style.unifiedSearchResultIconLeftMargin
|
|
|
|
|
-
|
|
|
|
|
|
|
+ property int iconWidth: iconsIsThumbnail && icons !== "" ? Style.unifiedSearchResultIconWidth : Style.unifiedSearchResultSmallIconWidth
|
|
|
property int titleFontSize: Style.unifiedSearchResultTitleFontSize
|
|
property int titleFontSize: Style.unifiedSearchResultTitleFontSize
|
|
|
property int sublineFontSize: Style.unifiedSearchResultSublineFontSize
|
|
property int sublineFontSize: Style.unifiedSearchResultSublineFontSize
|
|
|
|
|
|
|
@@ -30,76 +28,78 @@ RowLayout {
|
|
|
Accessible.name: resultTitle
|
|
Accessible.name: resultTitle
|
|
|
Accessible.onPressAction: unifiedSearchResultMouseArea.clicked()
|
|
Accessible.onPressAction: unifiedSearchResultMouseArea.clicked()
|
|
|
|
|
|
|
|
- ColumnLayout {
|
|
|
|
|
|
|
+ spacing: Style.trayHorizontalMargin
|
|
|
|
|
+
|
|
|
|
|
+ Item {
|
|
|
id: unifiedSearchResultImageContainer
|
|
id: unifiedSearchResultImageContainer
|
|
|
- visible: true
|
|
|
|
|
- Layout.preferredWidth: unifiedSearchResultItemDetails.iconWidth + 10
|
|
|
|
|
- Layout.preferredHeight: unifiedSearchResultItemDetails.height
|
|
|
|
|
|
|
+
|
|
|
|
|
+ property int whiteSpace: (Style.trayListItemIconSize - unifiedSearchResultItemDetails.iconWidth)
|
|
|
|
|
+
|
|
|
|
|
+ Layout.preferredWidth: unifiedSearchResultItemDetails.iconWidth
|
|
|
|
|
+ Layout.preferredHeight: unifiedSearchResultItemDetails.iconWidth
|
|
|
|
|
+ Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
|
|
|
|
+ Layout.leftMargin: Style.trayHorizontalMargin + (whiteSpace * (0.5 - Style.thumbnailImageSizeReduction))
|
|
|
|
|
+ Layout.rightMargin: whiteSpace * (0.5 + Style.thumbnailImageSizeReduction)
|
|
|
|
|
+
|
|
|
Image {
|
|
Image {
|
|
|
id: unifiedSearchResultThumbnail
|
|
id: unifiedSearchResultThumbnail
|
|
|
|
|
+ anchors.fill: parent
|
|
|
visible: false
|
|
visible: false
|
|
|
asynchronous: true
|
|
asynchronous: true
|
|
|
- source: "image://tray-image-provider/" + icons
|
|
|
|
|
|
|
+ source: "image://tray-image-provider/" + unifiedSearchResultItemDetails.icons
|
|
|
cache: true
|
|
cache: true
|
|
|
- sourceSize.width: imageData.width
|
|
|
|
|
- sourceSize.height: imageData.height
|
|
|
|
|
- width: imageData.width
|
|
|
|
|
- height: imageData.height
|
|
|
|
|
|
|
+ verticalAlignment: Qt.AlignVCenter
|
|
|
|
|
+ horizontalAlignment: Qt.AlignHCenter
|
|
|
|
|
+ sourceSize.width: width
|
|
|
|
|
+ sourceSize.height: height
|
|
|
}
|
|
}
|
|
|
Rectangle {
|
|
Rectangle {
|
|
|
id: mask
|
|
id: mask
|
|
|
|
|
+ anchors.fill: unifiedSearchResultThumbnail
|
|
|
visible: false
|
|
visible: false
|
|
|
- radius: isRounded ? width / 2 : 0
|
|
|
|
|
- width: imageData.width
|
|
|
|
|
- height: imageData.height
|
|
|
|
|
|
|
+ radius: unifiedSearchResultItemDetails.isRounded ? width / 2 : 3
|
|
|
}
|
|
}
|
|
|
OpacityMask {
|
|
OpacityMask {
|
|
|
id: imageData
|
|
id: imageData
|
|
|
- visible: !unifiedSearchResultThumbnailPlaceholder.visible && icons
|
|
|
|
|
- Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
|
|
|
|
- Layout.leftMargin: iconLeftMargin
|
|
|
|
|
- Layout.preferredWidth: unifiedSearchResultItemDetails.iconWidth
|
|
|
|
|
- Layout.preferredHeight: unifiedSearchResultItemDetails.iconWidth
|
|
|
|
|
|
|
+ anchors.fill: unifiedSearchResultThumbnail
|
|
|
|
|
+ visible: unifiedSearchResultItemDetails.icons !== ""
|
|
|
source: unifiedSearchResultThumbnail
|
|
source: unifiedSearchResultThumbnail
|
|
|
maskSource: mask
|
|
maskSource: mask
|
|
|
}
|
|
}
|
|
|
Image {
|
|
Image {
|
|
|
id: unifiedSearchResultThumbnailPlaceholder
|
|
id: unifiedSearchResultThumbnailPlaceholder
|
|
|
- Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
|
|
|
|
|
- Layout.leftMargin: iconLeftMargin
|
|
|
|
|
- verticalAlignment: Qt.AlignCenter
|
|
|
|
|
|
|
+ anchors.fill: parent
|
|
|
|
|
+ verticalAlignment: Qt.AlignVCenter
|
|
|
|
|
+ horizontalAlignment: Qt.AlignHCenter
|
|
|
cache: true
|
|
cache: true
|
|
|
- source: "image://tray-image-provider/" + iconPlaceholder
|
|
|
|
|
- visible: false
|
|
|
|
|
|
|
+ source: "image://tray-image-provider/" + unifiedSearchResultItemDetails.iconPlaceholder
|
|
|
|
|
+ visible: unifiedSearchResultItemDetails.iconPlaceholder !== "" && unifiedSearchResultItemDetails.icons === ""
|
|
|
sourceSize.height: unifiedSearchResultItemDetails.iconWidth
|
|
sourceSize.height: unifiedSearchResultItemDetails.iconWidth
|
|
|
sourceSize.width: unifiedSearchResultItemDetails.iconWidth
|
|
sourceSize.width: unifiedSearchResultItemDetails.iconWidth
|
|
|
- Layout.preferredWidth: unifiedSearchResultItemDetails.iconWidth
|
|
|
|
|
- Layout.preferredHeight: unifiedSearchResultItemDetails.iconWidth
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
ColumnLayout {
|
|
|
id: unifiedSearchResultTextContainer
|
|
id: unifiedSearchResultTextContainer
|
|
|
|
|
+
|
|
|
Layout.fillWidth: true
|
|
Layout.fillWidth: true
|
|
|
|
|
+ Layout.rightMargin: Style.trayHorizontalMargin
|
|
|
|
|
+ spacing: Style.standardSpacing
|
|
|
|
|
|
|
|
Label {
|
|
Label {
|
|
|
id: unifiedSearchResultTitleText
|
|
id: unifiedSearchResultTitleText
|
|
|
- text: title.replace(/[\r\n]+/g, " ")
|
|
|
|
|
- Layout.leftMargin: textLeftMargin
|
|
|
|
|
- Layout.rightMargin: textRightMargin
|
|
|
|
|
Layout.fillWidth: true
|
|
Layout.fillWidth: true
|
|
|
|
|
+ text: unifiedSearchResultItemDetails.title.replace(/[\r\n]+/g, " ")
|
|
|
elide: Text.ElideRight
|
|
elide: Text.ElideRight
|
|
|
font.pixelSize: unifiedSearchResultItemDetails.titleFontSize
|
|
font.pixelSize: unifiedSearchResultItemDetails.titleFontSize
|
|
|
color: unifiedSearchResultItemDetails.titleColor
|
|
color: unifiedSearchResultItemDetails.titleColor
|
|
|
}
|
|
}
|
|
|
Label {
|
|
Label {
|
|
|
id: unifiedSearchResultTextSubline
|
|
id: unifiedSearchResultTextSubline
|
|
|
- text: subline.replace(/[\r\n]+/g, " ")
|
|
|
|
|
|
|
+ Layout.fillWidth: true
|
|
|
|
|
+ text: unifiedSearchResultItemDetails.subline.replace(/[\r\n]+/g, " ")
|
|
|
elide: Text.ElideRight
|
|
elide: Text.ElideRight
|
|
|
font.pixelSize: unifiedSearchResultItemDetails.sublineFontSize
|
|
font.pixelSize: unifiedSearchResultItemDetails.sublineFontSize
|
|
|
- Layout.leftMargin: textLeftMargin
|
|
|
|
|
- Layout.rightMargin: textRightMargin
|
|
|
|
|
- Layout.fillWidth: true
|
|
|
|
|
color: unifiedSearchResultItemDetails.sublineColor
|
|
color: unifiedSearchResultItemDetails.sublineColor
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|