2020-10-29 16:07:52 -04:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import QtWebEngine 1.9
|
2021-09-30 11:43:29 +02:00
|
|
|
import "../../../../shared"
|
2021-10-14 13:48:03 +02:00
|
|
|
import "../../../../shared/popups"
|
2021-10-14 14:37:59 +02:00
|
|
|
import "../../../../shared/panels"
|
2021-09-30 11:43:29 +02:00
|
|
|
import "../../../../shared/status"
|
|
|
|
import "../stores"
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-09-30 11:43:29 +02:00
|
|
|
import "../../Chat/ChatColumn/ChatComponents"
|
2020-10-29 16:07:52 -04:00
|
|
|
|
2021-10-14 13:48:03 +02:00
|
|
|
// TODO: replace with StatusPopupMenu
|
2020-10-29 16:07:52 -04:00
|
|
|
PopupMenu {
|
|
|
|
property var openInNewTab: function () {}
|
|
|
|
property string url
|
2021-09-30 11:43:29 +02:00
|
|
|
property var currentFavorite: BookmarksStore.getCurrentFavorite(url)
|
2020-10-29 16:07:52 -04:00
|
|
|
|
|
|
|
id: root
|
|
|
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
|
|
|
|
|
|
|
Action {
|
2021-02-18 11:36:05 -05:00
|
|
|
//% "Open in new Tab"
|
|
|
|
text: qsTrId("open-in-new-tab")
|
2021-09-28 18:04:06 +03:00
|
|
|
icon.source: Style.svg("generate_account")
|
2020-11-27 15:31:50 -05:00
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
2020-10-29 16:07:52 -04:00
|
|
|
onTriggered: {
|
|
|
|
openInNewTab(root.url)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {}
|
|
|
|
|
|
|
|
Action {
|
2021-02-18 11:36:05 -05:00
|
|
|
//% "Edit"
|
|
|
|
text: qsTrId("edit")
|
2021-09-28 18:04:06 +03:00
|
|
|
icon.source: Style.svg("edit")
|
2020-10-29 16:07:52 -04:00
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
|
|
|
onTriggered: {
|
|
|
|
addFavoriteModal.modifiyModal = true
|
|
|
|
addFavoriteModal.ogUrl = root.currentFavorite ? root.currentFavorite.url : currentWebView.url
|
|
|
|
addFavoriteModal.ogName = root.currentFavorite ? root.currentFavorite.name : currentWebView.title
|
|
|
|
addFavoriteModal.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Action {
|
2021-02-18 11:36:05 -05:00
|
|
|
//% "Remove"
|
|
|
|
text: qsTrId("remove")
|
2021-09-28 18:04:06 +03:00
|
|
|
icon.source: Style.svg("remove")
|
2020-10-29 16:07:52 -04:00
|
|
|
icon.color: Style.current.danger
|
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
|
|
|
onTriggered: {
|
2021-09-30 11:43:29 +02:00
|
|
|
BookmarksStore.removeBookmark(root.url)
|
2020-10-29 16:07:52 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|