aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiina Puuronen <miina.puuronen@qt.io>2021-03-17 17:08:37 +0200
committerMiina Puuronen <miina.puuronen@qt.io>2021-03-18 10:20:46 +0000
commit3022406a68d81a44a35685f0c793b907616040aa (patch)
tree92317fe7d7078e54f93202ffcfd8b3a78506dcd3
parent167e0d5d58ee4f75c5c5c07c13eac758689729e7 (diff)
QmlDesigner: Fix submit button on user feedback popupv4.15.0-rc1v4.15.0-beta2
Submit button was previously always enabled, now it will stay disabled until user has tapped a rating star. Also made small improvements to the color definitions of buttons. Fixes: QDS-3971 Change-Id: I1e768112f124ba59c61a2ab98cbc3e7707a874d5 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
-rw-r--r--src/ui/FeedbackPopup.qml17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/ui/FeedbackPopup.qml b/src/ui/FeedbackPopup.qml
index 7ec8b3c..705c0ba 100644
--- a/src/ui/FeedbackPopup.qml
+++ b/src/ui/FeedbackPopup.qml
@@ -31,7 +31,7 @@ import QtQuick.Window 2.15
Rectangle {
id: root_rectangle
- property int rating: 1
+ property int rating: 0
signal submitFeedback(string feedback, int rating)
signal closeClicked()
@@ -115,21 +115,18 @@ Rectangle {
height: 28
contentItem: Text {
- id: bskip_text
text: "Skip"
- color: "#999999"
+ color: parent.hovered ? Qt.darker("#999999", 1.9) : Qt.darker("#999999", 1.2)
font { family: "Titillium"; pixelSize: 14 }
horizontalAlignment: Text.AlignHCenter
}
background: Rectangle {
- id: bskip_bg
anchors.fill: parent
color: "#ffffff"
border { color: "#999999"; width: 1 }
}
- onHoveredChanged: bskip_text.color = hovered ? "#666666" : "#999999"
onClicked: root_rectangle.closeClicked()
}
@@ -138,23 +135,21 @@ Rectangle {
width: 80
height: 28
+ enabled: rating > 0
contentItem: Text {
- id: bsub_text
text: "Submit";
- color: "white"
+ color: enabled ? "white" : Qt.lighter("#999999", 1.3)
font { family: "Titillium"; pixelSize: 14 }
horizontalAlignment: Text.AlignHCenter
}
background: Rectangle {
- id: bsub_bg
anchors.fill: parent
- color: "#0094ce"
- border { color: "#999999"; width: 1 }
+ color: enabled ? parent.hovered ? Qt.lighter("#0094ce", 1.2) : "#0094ce" : "white"
+ border { color: enabled ? "#999999" : Qt.lighter("#999999", 1.3); width: 1 }
}
- onHoveredChanged: bsub_bg.color = hovered ? Qt.lighter("#0094ce", 1.2) : "#0094ce"
onClicked: {
root_rectangle.submitFeedback(textarea.text, rating);
root_rectangle.closeClicked();