From 1afc33abef971052bfcc55d305ccb4fa38bd7396 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Mon, 15 May 2017 17:05:22 +0300 Subject: [PATCH] qml UI fixes --- sources/qml/AWTextEditor.qml | 7 +- sources/qml/BugReport.qml | 164 ++++++++++++++++++----------------- 2 files changed, 87 insertions(+), 84 deletions(-) diff --git a/sources/qml/AWTextEditor.qml b/sources/qml/AWTextEditor.qml index d9ebe6a..793b326 100644 --- a/sources/qml/AWTextEditor.qml +++ b/sources/qml/AWTextEditor.qml @@ -16,7 +16,7 @@ ***************************************************************************/ import QtQuick 2.0 -import QtQuick.Controls 2.0 as QtControls +import QtQuick.Controls 1.3 as QtControls Item { @@ -29,9 +29,6 @@ Item { QtControls.TextArea { id: textArea anchors.fill: parent - background: Rectangle { - color: "white" - } textFormat: TextEdit.PlainText Column { @@ -76,7 +73,7 @@ Item { function changeTooltipPosition() { tooltip.x = textArea.cursorRectangle.x - tooltip.y = textArea.cursorRectangle.y + tooltip.y = textArea.cursorRectangle.y + textArea.cursorRectangle.height } function getLastTag() { diff --git a/sources/qml/BugReport.qml b/sources/qml/BugReport.qml index 44080a7..1b76e6e 100644 --- a/sources/qml/BugReport.qml +++ b/sources/qml/BugReport.qml @@ -18,6 +18,7 @@ import QtQuick 2.0 import QtQuick.Controls 1.3 as QtControls import QtQuick.Dialogs 1.2 as QtDialogs +import QtQuick.Layouts 1.2 as QtLayouts import org.kde.plasma.private.awesomewidget 1.0 @@ -31,99 +32,104 @@ QtDialogs.Dialog { id: awBugReporter } - width: 480 - height: 640 + width: 640 + height: 480 property bool debug: awActions.isDebugEnabled() title: i18n("Report a bug") standardButtons: QtDialogs.StandardButton.Ok | QtDialogs.StandardButton.Cancel | QtDialogs.StandardButton.Reset - QtControls.TextField { - id: title - width: parent.width - placeholderText: i18n("Report subject") - } - Column { - id: body - width: parent.width - anchors.top: title.bottom - anchors.bottom: parent.bottom + QtLayouts.ColumnLayout { + anchors.fill: parent - QtControls.GroupBox { - width: parent.width - height: parent.height / 5 - title: i18n("Description") - QtControls.TextArea { - id: description - width: parent.width - height: parent.height - textFormat: TextEdit.PlainText - } + QtControls.TextField { + id: title + anchors.left: parent.left + anchors.right: parent.right + placeholderText: i18n("Report subject") } - QtControls.GroupBox { - width: parent.width - height: parent.height / 5 - title: i18n("Steps to reproduce") - QtControls.TextArea { - id: reproduce - width: parent.width - height: parent.height - textFormat: TextEdit.PlainText - } - } - QtControls.GroupBox { - width: parent.width - 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" + QtLayouts.ColumnLayout { + anchors.left: parent.left + anchors.right: parent.right + + QtControls.GroupBox { + anchors.left: parent.left + anchors.right: parent.right + height: parent.height / 5 + title: i18n("Description") + QtControls.TextArea { + id: description + anchors.fill: parent + textFormat: TextEdit.PlainText } } - QtControls.Button { - id: logButton - anchors.top: debugCmdLabel.bottom - width: parent.width - text: i18n("Load log file") - onClicked: logPath.open() + QtControls.GroupBox { + anchors.left: parent.left + anchors.right: parent.right + height: parent.height / 5 + title: i18n("Steps to reproduce") + QtControls.TextArea { + id: reproduce + anchors.fill: parent + textFormat: TextEdit.PlainText + } } - QtControls.TextArea { - anchors.top: logButton.bottom + QtControls.GroupBox { + 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 - id: logBody - width: parent.width - textFormat: TextEdit.PlainText - } + title: i18n("Logs") + QtLayouts.ColumnLayout { + 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 { - id: logPath - title: i18n("Open log file") - onAccepted: + QtDialogs.FileDialog { + id: logPath + title: i18n("Open log file") + onAccepted: logBody.text = awActions.getFileContent(logPath.fileUrl.toString().replace("file://", "")) + } } } }