From cc928bcd1f9642764f7141f4946cb7a0856f9634 Mon Sep 17 00:00:00 2001 From: pmoise Date: Thu, 25 Jan 2024 20:22:25 -0500 Subject: [PATCH 1/3] Created a Critical Fault Icon --- NERODesign/content/CriticalFaultIcon.qml | 67 ++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 NERODesign/content/CriticalFaultIcon.qml diff --git a/NERODesign/content/CriticalFaultIcon.qml b/NERODesign/content/CriticalFaultIcon.qml new file mode 100644 index 0000000..732b247 --- /dev/null +++ b/NERODesign/content/CriticalFaultIcon.qml @@ -0,0 +1,67 @@ +import QtQuick 2.15 +import QtQuick.Shapes 1.15 + +Item { + id: critical + property int dimension: 200 + property int numWarnings: 3 + + width: dimension * 1.2 + height: dimension * 1.2 + + Shape { + id: shape + width: parent.width + height: parent.height + anchors.centerIn: parent + + ShapePath { + id: triangle + dashPattern: 5.6 + simplify: true + fillColor: "red" + strokeColor: "transparent" + strokeWidth: 1 + capStyle: ShapePath.RoundCap + + startX: 200/2 + startY: 0 + + PathLine { x: 0; y: 200 } + PathLine { x: 200; y: 200 } + PathLine { x: 200/2; y: 0 } + + } + + Text { + id: text1 + x: 200/2 -20 + y: 25 + color: "white" + text: qsTr("!") + font.pixelSize: 150 + } + + Rectangle { + id: faultCircle + x: 115 + y: 128 + width: 100 + height: 100 + radius: 100 + + Text { + id: faultNum + anchors.centerIn: parent + color: "black" + text: numWarnings + font.pixelSize: 0.75 * parent.width + } + + } + + + + } + +} From 12f193e314fc4b7ad45ac48c91a86495a09954c2 Mon Sep 17 00:00:00 2001 From: pmoise Date: Thu, 25 Jan 2024 20:45:33 -0500 Subject: [PATCH 2/3] Updated variables --- NERODesign/content/CriticalFaultIcon.qml | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/NERODesign/content/CriticalFaultIcon.qml b/NERODesign/content/CriticalFaultIcon.qml index 732b247..35449f1 100644 --- a/NERODesign/content/CriticalFaultIcon.qml +++ b/NERODesign/content/CriticalFaultIcon.qml @@ -4,15 +4,15 @@ import QtQuick.Shapes 1.15 Item { id: critical property int dimension: 200 - property int numWarnings: 3 + property int numWarnings: 1 width: dimension * 1.2 height: dimension * 1.2 Shape { id: shape - width: parent.width - height: parent.height + width: critical.width + height: critical.height anchors.centerIn: parent ShapePath { @@ -24,30 +24,30 @@ Item { strokeWidth: 1 capStyle: ShapePath.RoundCap - startX: 200/2 + startX: (shape.width)/2 startY: 0 - PathLine { x: 0; y: 200 } - PathLine { x: 200; y: 200 } - PathLine { x: 200/2; y: 0 } + PathLine { x: 0; y: (shape.height) } + PathLine { x: (shape.width); y: (shape.height) } + PathLine { x: (shape.width)/2; y: 0 } } Text { id: text1 - x: 200/2 -20 + x: (shape.width)/2 -20 y: 25 color: "white" text: qsTr("!") - font.pixelSize: 150 + font.pixelSize: .75 * shape.width } Rectangle { id: faultCircle - x: 115 - y: 128 - width: 100 - height: 100 + x: 131 + y: 154 + width: (critical.dimension/2) * 1.2 + height: (critical.dimension/2) * 1.2 radius: 100 Text { @@ -55,7 +55,7 @@ Item { anchors.centerIn: parent color: "black" text: numWarnings - font.pixelSize: 0.75 * parent.width + font.pixelSize: 0.75 * faultCircle.width } } From e622caf6fbabf5d687028ce2f91a7fd6ed41ca69 Mon Sep 17 00:00:00 2001 From: pmoise Date: Mon, 29 Jan 2024 00:11:45 -0500 Subject: [PATCH 3/3] #24-removed-absolutes --- NERODesign/content/CriticalFaultIcon.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/NERODesign/content/CriticalFaultIcon.qml b/NERODesign/content/CriticalFaultIcon.qml index 35449f1..eec648f 100644 --- a/NERODesign/content/CriticalFaultIcon.qml +++ b/NERODesign/content/CriticalFaultIcon.qml @@ -3,7 +3,7 @@ import QtQuick.Shapes 1.15 Item { id: critical - property int dimension: 200 + property int dimension: 20 property int numWarnings: 1 width: dimension * 1.2 @@ -35,8 +35,8 @@ Item { Text { id: text1 - x: (shape.width)/2 -20 - y: 25 + x: (shape.width)/2 - font.pixelSize/8 + y: (shape.height - (font.pixelSize * 1.2)) color: "white" text: qsTr("!") font.pixelSize: .75 * shape.width @@ -44,8 +44,8 @@ Item { Rectangle { id: faultCircle - x: 131 - y: 154 + x: text1.x + width/3 + y: critical.height - height/1.5 width: (critical.dimension/2) * 1.2 height: (critical.dimension/2) * 1.2 radius: 100