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

84 lines
2.2 KiB
QML

import QtQuick 2.1
import QtGraphicalEffects 1.13
import utils 1.0
import "../../../shared"
import "../../../shared/status"
Rectangle {
property bool isVisible: false
id: root
visible: isVisible && !!listView.count
color: Style.current.background
width: parent.width
height: 56
border.width: 1
border.color: Style.current.border
// This container is to contain the downloaded elements between the parent buttons and hide the overflow
Item {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: Style.current.smallPadding
anchors.right: showAllBtn.left
anchors.rightMargin: Style.current.smallPadding
height: listView.height
clip: true
ListView {
id: listView
orientation: ListView.Horizontal
model: downloadModel
height: currentItem ? currentItem.height : 0
// This makes it show the newest on the right
layoutDirection: Qt.RightToLeft
spacing: Style.current.smallPadding
anchors.left: parent.left
width: {
// Children rect shows a warning but this works ¯\_(ツ)_/¯
let w = 0
for (let i = 0; i < count; i++) {
w += this.itemAtIndex(i).width + this.spacing
}
return w
}
interactive: false
delegate: Component {
DownloadElement {}
}
}
}
StatusButton {
id: showAllBtn
size: "small"
//% "Show All"
text: qsTrId("show-all")
anchors.verticalCenter: parent.verticalCenter
anchors.right: closeBtn.left
anchors.rightMargin: Style.current.padding
onClicked: {
addNewDownloadTab()
}
}
StatusIconButton {
id: closeBtn
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
icon.name: "browser/close"
iconColor: Style.current.textColor
onClicked: {
root.isVisible = false
}
}
}
/*##^##
Designer {
D{i:0;height:56;width:700}
}
##^##*/