2020-10-27 20:53:22 +00:00
|
|
|
import QtQuick 2.13
|
2021-08-17 17:03:03 +00:00
|
|
|
|
|
|
|
import StatusQ.Components 0.1 as StatusQ
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2020-10-27 20:53:22 +00:00
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../shared/status"
|
|
|
|
import "../../../../imports"
|
|
|
|
|
|
|
|
Item {
|
2021-08-17 17:03:03 +00:00
|
|
|
property url webUrl
|
2020-10-30 15:46:47 +00:00
|
|
|
property url source
|
2020-10-27 20:53:22 +00:00
|
|
|
property string text
|
2020-10-29 20:07:52 +00:00
|
|
|
signal clicked(mouse: var)
|
|
|
|
signal rightClicked(mouse: var)
|
2020-10-27 20:53:22 +00:00
|
|
|
|
|
|
|
id: root
|
|
|
|
width: 74
|
2021-08-17 17:03:03 +00:00
|
|
|
height: 48 + Style.current.halfPadding
|
2020-10-27 20:53:22 +00:00
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: bookmarkImage
|
|
|
|
width: 48
|
|
|
|
height: 48
|
2021-08-17 17:03:03 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
source: !!root.source && !!root.source.toString() ? root.source :"../../../img/compassActive.svg"
|
|
|
|
visible: root.source && root.source.toString()
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusQ.StatusRoundIcon {
|
|
|
|
id: addButton
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
icon.name: "add"
|
|
|
|
icon.color: Theme.palette.baseColor1
|
|
|
|
color: Theme.palette.baseColor2
|
|
|
|
visible: !webUrl.toString()
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusQ.StatusLetterIdenticon {
|
|
|
|
id: identicon
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
color: Theme.palette.baseColor2
|
|
|
|
identiconText.text: text.charAt(0)
|
|
|
|
identiconText.color: Theme.palette.baseColor1
|
|
|
|
visible: !bookmarkImage.visible && !addButton.visible
|
2020-10-27 20:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: bookmarkName
|
|
|
|
text: root.text
|
2021-08-17 17:03:03 +00:00
|
|
|
width: 67
|
2020-10-27 20:53:22 +00:00
|
|
|
anchors.top: bookmarkImage.bottom
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2021-08-17 17:03:03 +00:00
|
|
|
font.pixelSize: Style.current.additionalTextSize
|
2020-10-27 20:53:22 +00:00
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
2021-08-17 17:03:03 +00:00
|
|
|
maximumLineCount: 2
|
|
|
|
elide: Text.ElideRight
|
2020-10-27 20:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
2020-10-29 20:07:52 +00:00
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
|
|
onClicked: {
|
2020-12-29 17:10:22 +00:00
|
|
|
if (mouse.button === Qt.RightButton) {
|
2020-10-29 20:07:52 +00:00
|
|
|
root.rightClicked(mouse)
|
|
|
|
} else {
|
|
|
|
root.clicked(mouse)
|
|
|
|
}
|
|
|
|
}
|
2020-10-27 20:53:22 +00:00
|
|
|
}
|
|
|
|
}
|