实现调用系统程序打开文件

main
wuyize 2023-07-07 01:36:34 +08:00
parent 3a79d7b0d2
commit b8581ba3df
2 changed files with 17 additions and 2 deletions

View File

@ -117,6 +117,20 @@ Rectangle {
Layout.rightMargin: 10 Layout.rightMargin: 10
iconSource: FluentIcons.PenPalette iconSource: FluentIcons.PenPalette
iconSize: 14 iconSize: 14
onClicked: {
note_menu.open()
}
FluMenu {
id: note_menu
x: parent ? (parent.width - width) / 2 : 0
y: parent ? parent.height : 0
FluMenuItem {
text: "收藏的笔记"
}
FluMenuItem {
text: "我的笔记"
}
}
} }
Text { Text {
@ -218,5 +232,6 @@ Rectangle {
frameless_helper.setHitTestVisible(btn_maximize) frameless_helper.setHitTestVisible(btn_maximize)
frameless_helper.setHitTestVisible(btn_close) frameless_helper.setHitTestVisible(btn_close)
frameless_helper.setHitTestVisible(btn_transfer) frameless_helper.setHitTestVisible(btn_transfer)
frameless_helper.setHitTestVisible(btn_note)
} }
} }

View File

@ -66,7 +66,7 @@ FluArea {
property int shareCount: 0 property int shareCount: 0
property int browsCount: 555 property int browsCount: 555
property bool isFavorite: false property bool isFavorite: false
property bool isDownload: false property bool isDownload: UserData.downloadedFiles.indexOf(fileId) != -1
property double fileSize: 0 property double fileSize: 0
property string title: "文章标题" property string title: "文章标题"
property list<string> tags: ["tag 1", "tag 2", "tag 3"] property list<string> tags: ["tag 1", "tag 2", "tag 3"]
@ -249,7 +249,7 @@ FluArea {
FileTransferManager.download(content_page.fileId, FileTransferManager.download(content_page.fileId,
content_page.title) content_page.title)
else { else {
FileTransferManager.openLocalFile(content_page.title)
} }
} }
} }