Minor UI tweaks and clean up project.

This commit is contained in:
Black Hat
2019-04-30 17:02:00 +08:00
parent 5fe8bafbf3
commit 75eb4c5b52
25 changed files with 489 additions and 1336 deletions

View File

@@ -111,7 +111,7 @@ ColumnLayout {
}
Label {
text: progressInfo.active ? (progressInfo.progress + "/" + progressInfo.total) : content.info.size
text: progressInfo.active ? (progressInfo.progress + "/" + progressInfo.total) : content.info ? content.info.size : "Unknown"
color: MPalette.lighter
}
}
@@ -152,6 +152,12 @@ ColumnLayout {
MessageSourceDialog {}
}
Component {
id: openFileDialog
OpenFileDialog {}
}
Component {
id: fileDelegateContextMenu
@@ -162,7 +168,17 @@ ColumnLayout {
}
}
function saveFileAs() { currentRoom.saveFileAs(eventId) }
function saveFileAs() {
var fileDialog = openFileDialog.createObject(ApplicationWindow.overlay, {"selectFolder": true})
fileDialog.chosen.connect(function(path) {
if (!path) return
currentRoom.downloadFile(eventId, path + "/" + (content.filename || content.body))
})
fileDialog.open()
}
function downloadAndOpen()
{

View File

@@ -170,6 +170,12 @@ ColumnLayout {
MessageSourceDialog {}
}
Component {
id: openFileDialog
OpenFileDialog {}
}
Component {
id: imageDelegateContextMenu
@@ -179,7 +185,17 @@ ColumnLayout {
}
}
function saveFileAs() { currentRoom.saveFileAs(eventId) }
function saveFileAs() {
var fileDialog = openFileDialog.createObject(ApplicationWindow.overlay, {"selectFolder": true})
fileDialog.chosen.connect(function(path) {
if (!path) return
currentRoom.downloadFile(eventId, path + "/" + (content.filename || content.body))
})
fileDialog.open()
}
function downloadAndOpen()
{