2020-12-29 12:10:22 -05:00
|
|
|
import QtQuick 2.13
|
2021-09-28 18:04:06 +03:00
|
|
|
|
2022-07-20 17:54:30 +03:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
2021-09-28 18:04:06 +03:00
|
|
|
import utils 1.0
|
2020-12-29 12:10:22 -05:00
|
|
|
|
2021-12-08 00:15:17 +01:00
|
|
|
import "../controls"
|
|
|
|
|
2022-07-20 17:54:30 +03:00
|
|
|
StatusGridView {
|
2021-08-17 19:03:03 +02:00
|
|
|
id: bookmarkGrid
|
2021-12-08 00:15:17 +01:00
|
|
|
|
|
|
|
property var determineRealURLFn: function(url){}
|
|
|
|
property var setAsCurrentWebUrl: function(url){}
|
|
|
|
property var favMenu
|
|
|
|
property var addFavModal
|
|
|
|
|
2021-08-17 19:03:03 +02:00
|
|
|
cellWidth: 100
|
|
|
|
cellHeight: 100
|
2021-12-08 00:15:17 +01:00
|
|
|
|
2021-08-17 19:03:03 +02:00
|
|
|
delegate: BookmarkButton {
|
|
|
|
id: bookmarkBtn
|
|
|
|
text: name
|
|
|
|
source: imageUrl
|
2021-12-08 00:15:17 +01:00
|
|
|
webUrl: determineRealURLFn(url)
|
2021-08-17 19:03:03 +02:00
|
|
|
onClicked: {
|
|
|
|
if (!webUrl.toString()) {
|
2021-12-14 18:56:59 +01:00
|
|
|
Global.openPopup(addFavModal)
|
2021-08-17 19:03:03 +02:00
|
|
|
} else {
|
2021-12-08 00:15:17 +01:00
|
|
|
setAsCurrentWebUrl(webUrl)
|
2020-12-29 12:10:22 -05:00
|
|
|
}
|
|
|
|
}
|
2021-08-17 19:03:03 +02:00
|
|
|
onRightClicked: {
|
2021-12-08 00:15:17 +01:00
|
|
|
favMenu.url = url
|
|
|
|
favMenu.x = bookmarkGrid.x + bookmarkBtn.x + mouse.x
|
|
|
|
favMenu.y = Qt.binding(function () {return bookmarkGrid.y + mouse.y + favMenu.height})
|
|
|
|
favMenu.open()
|
2021-08-17 19:03:03 +02:00
|
|
|
}
|
2020-12-29 12:10:22 -05:00
|
|
|
}
|
|
|
|
}
|