2020-12-29 17:10:22 +00:00
|
|
|
import QtQuick 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2022-07-20 14:54:30 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2020-12-29 17:10:22 +00:00
|
|
|
|
2021-12-07 23:15:17 +00:00
|
|
|
import "../controls"
|
|
|
|
|
2022-07-20 14:54:30 +00:00
|
|
|
StatusGridView {
|
2021-08-17 17:03:03 +00:00
|
|
|
id: bookmarkGrid
|
2021-12-07 23:15:17 +00:00
|
|
|
|
|
|
|
property var determineRealURLFn: function(url){}
|
|
|
|
property var setAsCurrentWebUrl: function(url){}
|
|
|
|
property var favMenu
|
|
|
|
property var addFavModal
|
|
|
|
|
2021-08-17 17:03:03 +00:00
|
|
|
cellWidth: 100
|
|
|
|
cellHeight: 100
|
2021-12-07 23:15:17 +00:00
|
|
|
|
2021-08-17 17:03:03 +00:00
|
|
|
delegate: BookmarkButton {
|
|
|
|
id: bookmarkBtn
|
|
|
|
text: name
|
|
|
|
source: imageUrl
|
2021-12-07 23:15:17 +00:00
|
|
|
webUrl: determineRealURLFn(url)
|
2021-08-17 17:03:03 +00:00
|
|
|
onClicked: {
|
|
|
|
if (!webUrl.toString()) {
|
2021-12-14 17:56:59 +00:00
|
|
|
Global.openPopup(addFavModal)
|
2021-08-17 17:03:03 +00:00
|
|
|
} else {
|
2021-12-07 23:15:17 +00:00
|
|
|
setAsCurrentWebUrl(webUrl)
|
2020-12-29 17:10:22 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-17 17:03:03 +00:00
|
|
|
onRightClicked: {
|
2021-12-07 23:15:17 +00: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 17:03:03 +00:00
|
|
|
}
|
2020-12-29 17:10:22 +00:00
|
|
|
}
|
|
|
|
}
|