Commit 14e2cf6a authored by Jan Blackquill's avatar Jan Blackquill 🌈

Improve presentation of error plasmoid

parent 0676646a
......@@ -19,33 +19,64 @@
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
RowLayout {
Item {
id: root
Layout.minimumWidth: PlasmaCore.Units.gridUnit * 20
Layout.minimumHeight: PlasmaCore.Units.gridUnit * 8
Layout.minimumWidth: PlasmaCore.Units.gridUnit * 15
Layout.minimumHeight: PlasmaCore.Units.gridUnit * 15
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 15
Layout.maximumHeight: PlasmaCore.Units.gridUnit * 15
property alias reason: messageText.text
property var reason
property var errorInformation: {}
clip: true
PlasmaCore.IconItem {
id: icon
Layout.alignment: Qt.AlignVCenter
Layout.minimumWidth: PlasmaCore.Units.iconSizes.huge
Layout.minimumHeight: PlasmaCore.Units.iconSizes.huge
source: "dialog-error"
}
ColumnLayout {
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
right: parent.right
}
PlasmaCore.IconItem {
Layout.minimumWidth: PlasmaCore.Units.iconSizes.huge
Layout.minimumHeight: PlasmaCore.Units.iconSizes.huge
source: "data-warning"
Layout.alignment: Qt.AlignHCenter
}
PlasmaExtras.Heading {
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Oops! There was an error loading %1.", root.errorInformation.appletName)
level: 2
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
Layout.fillWidth: true
}
PlasmaComponents.Button {
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Copy Error Details to Clipboard")
icon.name: "edit-copy"
onClicked: copyHelper.copyText()
Layout.alignment: Qt.AlignHCenter
}
PlasmaComponents.TextArea {
id: copyHelper
visible: root.errorInformation.isDebugMode
text: root.errorInformation.errors.join("\n\n")
readOnly: true
Layout.fillHeight: true
Layout.fillWidth: true
PlasmaComponents.TextArea {
id: messageText
Layout.fillWidth: true
Layout.fillHeight: true
verticalAlignment: TextEdit.AlignVCenter
backgroundVisible: false
readOnly: true
width: parent.width - icon.width
wrapMode: Text.Wrap
function copyText() {
selectAll()
copy()
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment