Alexandra Betouni 4ee21ada05 feat(desktop) Added image function in Style
Introduced Style.svg() Style.png() Style.emoji() and
Style.icon() in Style.qml. Those should be used to
set the source in Images instead of using relative
paths. Usage:
Image {
   source: Style.svg("check)
   ....

Also moved all Singletons inside a new "utils"
folder and made it a QML module, to use
import utils 1.0 instead of relative paths

Closes #3678
2021-09-28 15:28:00 -04:00

53 lines
1.5 KiB
QML

import QtQuick 2.13
import QtQuick.Layouts 1.13
import "../../../shared"
import "../../../shared/status"
import utils 1.0
RowLayout {
id: favoritesBar
spacing: 0
height: browserModel.bookmarks.rowCount() > 0 ? 38: 0
ListView {
id: bookmarkList
model: browserModel.bookmarks
spacing: Style.current.halfPadding
orientation : ListView.Horizontal
height: parent.height
clip: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
width: parent.width
boundsBehavior: Flickable.StopAtBounds
delegate: StatusButton {
id: favoriteBtn
height: 32
icon.source: imageUrl
disableColorOverlay: true
icon.width: 24
icon.height: 24
text: name
implicitHeight: 32
type: "secondary"
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
z: 51
onClicked: function (mouse) {
if (mouse.button === Qt.RightButton) {
favoriteMenu.url = url
favoriteMenu.x = favoriteBtn.x + mouse.x
favoriteMenu.y = Qt.binding(function () {return mouse.y + favoriteMenu.height})
favoriteMenu.open()
return
}
currentWebView.url = determineRealURL(url)
}
}
}
}
}