From c2b101af63e89023466435499a4c82325a6c0952 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Wed, 22 Oct 2014 15:54:14 +0200 Subject: [PATCH 1/2] OP-1562 Fix all warnings and a little alignement issue in Welcome plugin --- .../src/plugins/welcome/qml/ActivityPanel.qml | 43 ++++++++++--------- .../src/plugins/welcome/qml/main.qml | 9 ++-- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml b/ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml index fdc258500..e1c808969 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/ActivityPanel.qml @@ -131,8 +131,9 @@ Item { id: middleRow anchors.left: parent.left anchors.leftMargin: 25 - property string prefix: "" + Text { + property string prefix: "" width: container.width - anchors.leftMargin - icon.width - 24 - 8 wrapMode: Text.WrapAtWordBoundaryOrAnywhere textFormat: Text.RichText @@ -140,37 +141,37 @@ Item { text: { switch(action) { case "commented": - case "comment": parent.prefix = qsTr("Commented on "); break; + case "comment": prefix = qsTr("Commented on "); break; case "post": - case "created": parent.prefix = qsTr("Created "); break; - case "create-and-start": parent.prefix = qsTr("Created and started "); break; - case "complete": parent.prefix = qsTr("Completed "); break; + case "created": prefix = qsTr("Created "); break; + case "create-and-start": prefix = qsTr("Created and started "); break; + case "complete": prefix = qsTr("Completed "); break; case "close": - case "closed": parent.prefix = qsTr("Closed "); break; - case "abandon": parent.prefix = qsTr("Abandoned "); break; - case "commit": parent.prefix = qsTr("Committed "); break; - case "resolved": parent.prefix = qsTr("Resolved "); break; - case "start": parent.prefix = qsTr("Started "); break; - case "started": parent.prefix = qsTr("Started working on "); break; - case "stopped": parent.prefix = qsTr("Stopped working on "); break; - case "Code Review": parent.prefix = qsTr("Requested code review on "); break; - case "Testing": parent.prefix = qsTr("Requested testing of "); break; - case "": parent.prefix = qsTr("Updated "); break; - default: parent.prefix = action.substr(0, 1).toUpperCase() + action.substr(1) + " " ; break; + case "closed": prefix = qsTr("Closed "); break; + case "abandon": prefix = qsTr("Abandoned "); break; + case "commit": prefix = qsTr("Committed "); break; + case "resolved": prefix = qsTr("Resolved "); break; + case "start": prefix = qsTr("Started "); break; + case "started": prefix = qsTr("Started working on "); break; + case "stopped": prefix = qsTr("Stopped working on "); break; + case "Code Review": prefix = qsTr("Requested code review on "); break; + case "Testing": prefix = qsTr("Requested testing of "); break; + case "": prefix = qsTr("Updated "); break; + default: prefix = action.substr(0, 1).toUpperCase() + action.substr(1) + " " ; break; } - parent.prefix = "" + parent.prefix + "" + prefix = "" + prefix + "" if(action == "commented" || action == "comment" || (action == "" && actionSummary == "")) { if(actionTargetTitle != actionTargetSummary) { - parent.prefix + actionTargetTitle + ": " + actionTargetSummary + prefix + actionTargetTitle + ": " + actionTargetSummary } else { - parent.prefix + actionTargetTitle + prefix + actionTargetTitle } } else { if(actionSummary == "") { - parent.prefix + actionTitle + prefix + actionTitle } else { - parent.prefix + actionTitle + ": " + actionSummary + prefix + actionTitle + ": " + actionSummary } } } diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/main.qml b/ground/openpilotgcs/src/plugins/welcome/qml/main.qml index 97ddb8e5d..a283e8791 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/main.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/main.qml @@ -4,6 +4,7 @@ Rectangle { id: container width: 1024 height: 768 + anchors.horizontalCenter: parent.horizontalCenter color: "#272727" @@ -115,7 +116,7 @@ Rectangle { height: 18 anchors.horizontalCenter: parent.horizontalCenter - width: textOpVersion.width + textOpVersionAvailable.width + width: textOpVersion.width + textOpVersionAvailable.width + 16 spacing: 16 Text { @@ -123,23 +124,19 @@ Rectangle { color: "#c4c0c0" text: welcomePlugin.versionString verticalAlignment: Text.AlignTop - anchors.left: parent.anchors.left font.bold: true styleColor: "#00000000" - horizontalAlignment: Text.AlignHCenter font.pixelSize: 14 } Text { id: textOpVersionAvailable color: "#5fcf07" text: welcomePlugin.newVersionText - anchors.rightMargin: 0 + font.bold: true font.underline: true styleColor: "#00000000" - horizontalAlignment: Text.AlignHCenter font.pixelSize: 14 - anchors.left: textOpVersion.right MouseArea{ id: mouseAreaOpVersionAvailable hoverEnabled: true From 3e62d6337bb70a357ee69563d56e118f52f733af Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Wed, 22 Oct 2014 16:13:53 +0200 Subject: [PATCH 2/2] OP-1562 Cleanup --- ground/openpilotgcs/src/plugins/welcome/qml/main.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/welcome/qml/main.qml b/ground/openpilotgcs/src/plugins/welcome/qml/main.qml index a283e8791..a3d47b56d 100644 --- a/ground/openpilotgcs/src/plugins/welcome/qml/main.qml +++ b/ground/openpilotgcs/src/plugins/welcome/qml/main.qml @@ -116,14 +116,13 @@ Rectangle { height: 18 anchors.horizontalCenter: parent.horizontalCenter - width: textOpVersion.width + textOpVersionAvailable.width + 16 + width: textOpVersion.width + textOpVersionAvailable.width + this.spacing spacing: 16 Text { id: textOpVersion color: "#c4c0c0" text: welcomePlugin.versionString - verticalAlignment: Text.AlignTop font.bold: true styleColor: "#00000000" font.pixelSize: 14 @@ -132,7 +131,6 @@ Rectangle { id: textOpVersionAvailable color: "#5fcf07" text: welcomePlugin.newVersionText - font.bold: true font.underline: true styleColor: "#00000000"