Browse Source

Updated Gimbal Indicator - now reflects custom theme

Added gimbal pitch SVGs for indoors and outdoors theme
QGC4.4
Yasen 6 years ago
parent
commit
4a6492d55b
  1. 3
      custom-example/custom.qrc
  2. 8
      custom-example/res/CustomCameraControl.qml
  3. 11
      custom-example/res/Images/gimbal_pitch_indoors.svg
  4. 11
      custom-example/res/Images/gimbal_pitch_outdoors.svg

3
custom-example/custom.qrc

@ -25,8 +25,9 @@ @@ -25,8 +25,9 @@
<file alias="compass_pointer.svg">res/Images/compass_pointer.svg</file>
<file alias="distance.svg">res/Images/distance.svg</file>
<file alias="gimbal_icon.svg">res/Images/gimbal_icon.svg</file>
<file alias="gimbal_pitch.svg">res/Images/gimbal_pitch.svg</file>
<file alias="gimbal_position.svg">res/Images/gimbal_position.svg</file>
<file alias="gimbal_pitch_indoors.svg">res/Images/gimbal_pitch_indoors.svg</file>
<file alias="gimbal_pitch_outdoors.svg">res/Images/gimbal_pitch_outdoors.svg</file>
<file alias="horizontal_speed.svg">res/Images/horizontal_speed.svg</file>
<file alias="microSD.svg">res/Images/microSD.svg</file>
<file alias="odometer.svg">res/Images/odometer.svg</file>

8
custom-example/res/CustomCameraControl.qml

@ -409,8 +409,9 @@ Item { @@ -409,8 +409,9 @@ Item {
id: gimbalCol
spacing: ScreenTools.defaultFontPixelHeight * 0.75
anchors.centerIn: parent
Image {
QGCColoredImage {
source: "/custom/img/gimbal_icon.svg"
color: qgcPal.text
width: ScreenTools.defaultFontPixelWidth * 2
height: width
smooth: true
@ -419,11 +420,12 @@ Item { @@ -419,11 +420,12 @@ Item {
fillMode: Image.PreserveAspectFit
sourceSize.width: width
anchors.horizontalCenter: parent.horizontalCenter
}
Image {
id: pitchScale
height: cameraRect.height * 0.65
source: "/custom/img/gimbal_pitch.svg"
source: qgcPal.globalTheme === QGCPalette.Light ? "/custom/img/gimbal_pitch_indoors.svg" : "/custom/img/gimbal_pitch_outdoors.svg"
fillMode: Image.PreserveAspectFit
sourceSize.height: height
smooth: true
@ -451,7 +453,7 @@ Item { @@ -451,7 +453,7 @@ Item {
QGCLabel {
id: gimbalLabel
text: _gimbalPitch ? _gimbalPitch.toFixed(0) : 0
color: "#FFF"
color: qgcPal.text
font.pointSize: ScreenTools.smallFontPointSize
anchors.horizontalCenter: parent.horizontalCenter
}

11
custom-example/res/Images/gimbal_pitch_indoors.svg

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<svg width="72" height="756" viewBox="0 0 72 756" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M36 0V108" stroke="#C92A30" stroke-width="3" stroke-miterlimit="10"/>
<path d="M18 108H54" stroke="#212529" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 324H54" stroke="#212529" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 540H54" stroke="#212529" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 753H54" stroke="#212529" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 3H54" stroke="#9F0B10" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 216H54" stroke="#212529" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 432H54" stroke="#212529" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 648H54" stroke="#212529" stroke-width="6" stroke-miterlimit="10"/>
</svg>

After

Width:  |  Height:  |  Size: 822 B

11
custom-example/res/Images/gimbal_pitch_outdoors.svg

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<svg width="72" height="756" viewBox="0 0 72 756" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M36 0V108" stroke="#E03131" stroke-width="3" stroke-miterlimit="10"/>
<path d="M18 108H54" stroke="white" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 324H54" stroke="white" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 540H54" stroke="white" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 753H54" stroke="white" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 3H54" stroke="#E03131" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 216H54" stroke="white" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 432H54" stroke="white" stroke-width="6" stroke-miterlimit="10"/>
<path d="M18 648H54" stroke="white" stroke-width="6" stroke-miterlimit="10"/>
</svg>

After

Width:  |  Height:  |  Size: 808 B

Loading…
Cancel
Save