@@ -28,56 +28,39 @@ import "../../Components"
29PreviewWidget {
29PreviewWidget {
31− implicitHeight: commentContainer.implicitHeight
31+ implicitHeight: Math.max(commentTextArea.implicitHeight, submitButton.implicitHeight)
33− property alias commentText: commentTextArea.text
35 function submit() {
33 function submit() {
36 var data = { "comment": commentTextArea.text };
34 var data = { "comment": commentTextArea.text };
37 triggered(root.widgetId, "commented", data);
35 triggered(root.widgetId, "commented", data);
41− id: commentContainer
39+ id: commentTextArea
42− implicitHeight: commentSubmitContainer.implicitHeight + anchors.topMargin
40+ objectName: "commentTextArea"
44− readonly property real innerMargin: units.gu(1)
42+ top: parent.top
46− anchors.fill: parent
44+ right: submitButton.left
47−
45+ rightMargin: units.gu(1)
49− id: commentSubmitContainer
51− implicitHeight: commentTextArea.implicitHeight + anchors.topMargin
55− objectName: "commentTextArea"
59− right: submitButton.left
60− rightMargin: commentContainer.innerMargin
62− autoSize: true
47+ autoSize: true
66− id: submitButton
51+ id: submitButton
67− objectName: "submitButton"
52+ objectName: "submitButton"
69− readonly property bool readyToSubmit: commentTextArea.text.trim().length > 0
54+ readonly property bool readyToSubmit: commentTextArea.text.trim().length > 0
71− anchors {
56+ anchors {
72− top: parent.top
57+ top: parent.top
73− right: parent.right
58+ right: parent.right
75− color: readyToSubmit ? Theme.palette.selected.base : Theme.palette.normal.base
60+ color: readyToSubmit ? Theme.palette.selected.base : Theme.palette.normal.base
76− text: widgetData["submit-label"] || i18n.tr("Send")
61+ text: widgetData["submit-label"] || i18n.tr("Send")
77− onClicked: {
62+ onClicked: {
78− if (readyToSubmit) root.submit()
63+ if (readyToSubmit) root.submit()