Add option to open readme file

This commit is contained in:
woblight
2018-07-13 23:41:21 +02:00
parent f7e61d0c77
commit 47a127b3ef
14 changed files with 370 additions and 1 deletions
+30
View File
@@ -127,6 +127,17 @@ Page {
x: -width
id: addonMenu
visible: false
MenuItem {
id: readmeButton
text: qsTr("readme")
enabled: addon.readme !== ""
icon.name: "help-about"
onTriggered: {
readmeDialog.addon = addon
readmeDialog.visible = true
}
}
MenuItem {
id: repairButton
text: qsTr("repair")
@@ -170,4 +181,23 @@ Page {
}
ScrollBar {id: scrollBar; Layout.fillHeight: true; visible: listView.contentHeight > listView.header}
}
Dialog {
property Addon addon
id: readmeDialog
parent: window.overlay
x: (parent.width - width) / 2
y: (parent.height - height) / 2
title: addon?qsTr("%1 Readme").arg(addon.name):""
standardButtons: Dialog.Close
ScrollView{
anchors.fill: parent
TextArea {
text: readmeDialog.addon?readmeDialog.addon.readme:""
readOnly: true
anchors.fill: parent
wrapMode: Text.NoWrap
font.family: monospaced.name
}
}
}
}