@@ -28,56 +28,39 @@ import "../../Components"
2828
2929PreviewWidget {
3030 id: root
31− implicitHeight: commentContainer.implicitHeight
32−
33− property alias commentText: commentTextArea.text
31+ implicitHeight: Math.max(commentTextArea.implicitHeight, submitButton.implicitHeight)
3432
3533 function submit() {
3634 var data = { "comment": commentTextArea.text };
3735 triggered(root.widgetId, "commented", data);
3836 }
3937
40− Item {
41− id: commentContainer
42− implicitHeight: commentSubmitContainer.implicitHeight + anchors.topMargin
43−
44− readonly property real innerMargin: units.gu(1)
45−
46− anchors.fill: parent
47−
48− Item {
49− id: commentSubmitContainer
50− anchors.fill: parent
51− implicitHeight: commentTextArea.implicitHeight + anchors.topMargin
52−
53− TextArea {
54− id: commentTextArea
55− objectName: "commentTextArea"
56− anchors {
57− top: parent.top
58− left: parent.left
59− right: submitButton.left
60− rightMargin: commentContainer.innerMargin
61− }
62− autoSize: true
63− }
38+ TextArea {
39+ id: commentTextArea
40+ objectName: "commentTextArea"
41+ anchors {
42+ top: parent.top
43+ left: parent.left
44+ right: submitButton.left
45+ rightMargin: units.gu(1)
46+ }
47+ autoSize: true
48+ }
6449
65− Button {
66− id: submitButton
67− objectName: "submitButton"
50+ Button {
51+ id: submitButton
52+ objectName: "submitButton"
6853
69− readonly property bool readyToSubmit: commentTextArea.text.trim().length > 0
54+ readonly property bool readyToSubmit: commentTextArea.text.trim().length > 0
7055
71− anchors {
72− top: parent.top
73− right: parent.right
74− }
75− color: readyToSubmit ? Theme.palette.selected.base : Theme.palette.normal.base
76− text: widgetData["submit-label"] || i18n.tr("Send")
77− onClicked: {
78− if (readyToSubmit) root.submit()
79− }
80− }
56+ anchors {
57+ top: parent.top
58+ right: parent.right
59+ }
60+ color: readyToSubmit ? Theme.palette.selected.base : Theme.palette.normal.base
61+ text: widgetData["submit-label"] || i18n.tr("Send")
62+ onClicked: {
63+ if (readyToSubmit) root.submit()
8164 }
8265 }
8366}