qml UI fixes

This commit is contained in:
Evgenii Alekseev 2017-05-15 17:05:22 +03:00
parent 6b8244f3c4
commit 1afc33abef
2 changed files with 87 additions and 84 deletions

View File

@ -16,7 +16,7 @@
***************************************************************************/ ***************************************************************************/
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.0 as QtControls import QtQuick.Controls 1.3 as QtControls
Item { Item {
@ -29,9 +29,6 @@ Item {
QtControls.TextArea { QtControls.TextArea {
id: textArea id: textArea
anchors.fill: parent anchors.fill: parent
background: Rectangle {
color: "white"
}
textFormat: TextEdit.PlainText textFormat: TextEdit.PlainText
Column { Column {
@ -76,7 +73,7 @@ Item {
function changeTooltipPosition() { function changeTooltipPosition() {
tooltip.x = textArea.cursorRectangle.x tooltip.x = textArea.cursorRectangle.x
tooltip.y = textArea.cursorRectangle.y tooltip.y = textArea.cursorRectangle.y + textArea.cursorRectangle.height
} }
function getLastTag() { function getLastTag() {

View File

@ -18,6 +18,7 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 1.3 as QtControls import QtQuick.Controls 1.3 as QtControls
import QtQuick.Dialogs 1.2 as QtDialogs import QtQuick.Dialogs 1.2 as QtDialogs
import QtQuick.Layouts 1.2 as QtLayouts
import org.kde.plasma.private.awesomewidget 1.0 import org.kde.plasma.private.awesomewidget 1.0
@ -31,99 +32,104 @@ QtDialogs.Dialog {
id: awBugReporter id: awBugReporter
} }
width: 480 width: 640
height: 640 height: 480
property bool debug: awActions.isDebugEnabled() property bool debug: awActions.isDebugEnabled()
title: i18n("Report a bug") title: i18n("Report a bug")
standardButtons: QtDialogs.StandardButton.Ok | QtDialogs.StandardButton.Cancel | QtDialogs.StandardButton.Reset standardButtons: QtDialogs.StandardButton.Ok | QtDialogs.StandardButton.Cancel | QtDialogs.StandardButton.Reset
QtControls.TextField { QtLayouts.ColumnLayout {
id: title anchors.fill: parent
width: parent.width
placeholderText: i18n("Report subject")
}
Column {
id: body
width: parent.width
anchors.top: title.bottom
anchors.bottom: parent.bottom
QtControls.GroupBox { QtControls.TextField {
width: parent.width id: title
height: parent.height / 5 anchors.left: parent.left
title: i18n("Description") anchors.right: parent.right
QtControls.TextArea { placeholderText: i18n("Report subject")
id: description
width: parent.width
height: parent.height
textFormat: TextEdit.PlainText
}
} }
QtControls.GroupBox { QtLayouts.ColumnLayout {
width: parent.width anchors.left: parent.left
height: parent.height / 5 anchors.right: parent.right
title: i18n("Steps to reproduce")
QtControls.TextArea { QtControls.GroupBox {
id: reproduce anchors.left: parent.left
width: parent.width anchors.right: parent.right
height: parent.height height: parent.height / 5
textFormat: TextEdit.PlainText title: i18n("Description")
} QtControls.TextArea {
} id: description
QtControls.GroupBox { anchors.fill: parent
width: parent.width textFormat: TextEdit.PlainText
height: parent.height / 5
title: i18n("Expected result")
QtControls.TextArea {
id: expected
width: parent.width
height: parent.height
textFormat: TextEdit.PlainText
}
}
QtControls.GroupBox {
width: parent.width
height: parent.height * 2 / 5
title: i18n("Logs")
Row {
id: debugCmdLabel
width: parent.width
QtControls.Label {
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignJustify
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
text: i18n("Use command")
}
QtControls.TextField {
id: customTime
width: parent.width * 3 / 5
readOnly: true
text: "QT_LOGGING_RULES=*=true plasmawindowed org.kde.plasma.awesomewidget"
} }
} }
QtControls.Button { QtControls.GroupBox {
id: logButton anchors.left: parent.left
anchors.top: debugCmdLabel.bottom anchors.right: parent.right
width: parent.width height: parent.height / 5
text: i18n("Load log file") title: i18n("Steps to reproduce")
onClicked: logPath.open() QtControls.TextArea {
id: reproduce
anchors.fill: parent
textFormat: TextEdit.PlainText
}
} }
QtControls.TextArea { QtControls.GroupBox {
anchors.top: logButton.bottom anchors.left: parent.left
anchors.right: parent.right
height: parent.height / 5
title: i18n("Expected result")
QtControls.TextArea {
id: expected
anchors.fill: parent
textFormat: TextEdit.PlainText
}
}
QtControls.GroupBox {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
id: logBody title: i18n("Logs")
width: parent.width QtLayouts.ColumnLayout {
textFormat: TextEdit.PlainText anchors.fill: parent
} Row {
anchors.left: parent.left
anchors.right: parent.right
QtControls.Label {
width: parent.width * 2 / 5
horizontalAlignment: Text.AlignJustify
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
text: i18n("Use command")
}
QtControls.TextField {
width: parent.width * 3 / 5
readOnly: true
text: "QT_LOGGING_RULES=*=true plasmawindowed org.kde.plasma.awesomewidget"
}
}
QtControls.Button {
anchors.left: parent.left
anchors.right: parent.right
text: i18n("Load log file")
onClicked: logPath.open()
}
QtControls.TextArea {
id: logBody
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
textFormat: TextEdit.PlainText
}
}
QtDialogs.FileDialog { QtDialogs.FileDialog {
id: logPath id: logPath
title: i18n("Open log file") title: i18n("Open log file")
onAccepted: onAccepted:
logBody.text = awActions.getFileContent(logPath.fileUrl.toString().replace("file://", "")) logBody.text = awActions.getFileContent(logPath.fileUrl.toString().replace("file://", ""))
}
} }
} }
} }