mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 14:54:48 +00:00
27ff37e166
Adapted the bookmark list to a grid view to accomodate items when the list gets long. Max column size is 7 and in case screen cannot show 7 columns it will flow to the next row. Also added ideinticon for a website with no icon Fixed the issue of DApps launching on all new tabs. fixes #2009
41 lines
1.1 KiB
QML
41 lines
1.1 KiB
QML
import QtQuick 2.13
|
|
import "../../../shared"
|
|
import "../../../shared/status"
|
|
import "../../../imports"
|
|
import "./components"
|
|
|
|
GridView {
|
|
id: bookmarkGrid
|
|
cellWidth: 100
|
|
cellHeight: 100
|
|
model: browserModel.bookmarks
|
|
delegate: BookmarkButton {
|
|
id: bookmarkBtn
|
|
text: name
|
|
source: imageUrl
|
|
webUrl: determineRealURL(url)
|
|
onClicked: {
|
|
if (!webUrl.toString()) {
|
|
addFavoriteModal.open()
|
|
} else {
|
|
currentWebView.url = webUrl
|
|
}
|
|
}
|
|
onRightClicked: {
|
|
favoriteMenu.url = url
|
|
favoriteMenu.x = bookmarkGrid.x + bookmarkBtn.x + mouse.x
|
|
favoriteMenu.y = Qt.binding(function () {return bookmarkGrid.y + mouse.y + favoriteMenu.height})
|
|
favoriteMenu.open()
|
|
}
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
// Add fav button at the end of the grid
|
|
var index = browserModel.bookmarks.getBookmarkIndexByUrl("")
|
|
if (index !== -1) {
|
|
browserModel.removeBookmark("")
|
|
}
|
|
browserModel.addBookmark("", qsTr("Add Favorite"))
|
|
}
|
|
}
|