diff --git a/ui/app/AppLayouts/Browser/DownloadBar.qml b/ui/app/AppLayouts/Browser/DownloadBar.qml index f66ba9f00f..d4897f0ffd 100644 --- a/ui/app/AppLayouts/Browser/DownloadBar.qml +++ b/ui/app/AppLayouts/Browser/DownloadBar.qml @@ -30,8 +30,11 @@ Rectangle { 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 - width: parent.width + anchors.left: parent.left + width: childrenRect.width interactive: false delegate: Component { DownloadElement { diff --git a/ui/app/AppLayouts/Browser/DownloadElement.qml b/ui/app/AppLayouts/Browser/DownloadElement.qml index 2a0d5e5add..7ad0e24d03 100644 --- a/ui/app/AppLayouts/Browser/DownloadElement.qml +++ b/ui/app/AppLayouts/Browser/DownloadElement.qml @@ -12,6 +12,8 @@ Rectangle { } property bool isCanceled: false property bool hovered: false + // use this to place the newest downloads first + property int reversedIndex: listView.count - 1 - index id: root width: 272 @@ -24,6 +26,10 @@ Rectangle { Qt.openUrlExternally(`file://${downloadDirectory}/${downloadFileName}`) removeDownloadFromModel(index) } + // TODO check if this works in Windows and Mac + function openDirectory() { + Qt.openUrlExternally("file://" + downloadDirectory) + } MouseArea { anchors.fill: parent @@ -36,7 +42,10 @@ Rectangle { root.hovered = false } onClicked: { - openFile() + if (downloadComplete) { + return openFile() + } + openDirectory() } } @@ -137,8 +146,7 @@ Rectangle { icon.width: 13 icon.height: 9 text: qsTr("Show in folder") - // TODO check if this works in Windows and Mac - onTriggered: Qt.openUrlExternally("file://" + downloadDirectory) + onTriggered: openDirectory() } Action { enabled: !downloadComplete && !!downloadModel.downloads[index] && !downloadModel.downloads[index].isPaused