Skip to content

Commit c4ea24c

Browse files
committed
Rework visual of QGCDelayButton
1 parent 971f363 commit c4ea24c

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

qgcresources.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<file alias="clockwise-arrow.svg">resources/clockwise-arrow.svg</file>
1818
<file alias="counter-clockwise-arrow.svg">resources/counter-clockwise-arrow.svg</file>
1919
<file alias="chevron-down.svg">resources/chevron-down.svg</file>
20+
<file alias="chevron-double-right.svg">resources/chevron-double-right.svg</file>
2021
<file alias="chevron-up.svg">resources/chevron-up.svg</file>
2122
<file alias="DropArrow.svg">resources/DropArrow.svg</file>
2223
<file alias="gear-black.svg">resources/gear-black.svg</file>

resources/chevron-double-right.svg

Lines changed: 2 additions & 0 deletions
Loading

src/QmlControls/QGCDelayButton.qml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import QtQuick.Layouts
55
import QGroundControl
66
import QGroundControl.Controls
77

8-
98
DelayButton {
109
id: control
1110
hoverEnabled: !ScreenTools.isMobile
@@ -69,19 +68,21 @@ DelayButton {
6968
border.width: showBorder ? 1 : 0
7069
border.color: qgcPal.buttonBorder
7170

72-
gradient: Gradient {
73-
orientation: Gradient.Horizontal
74-
75-
GradientStop { position: 0.0; color: qgcPal.buttonHighlight }
76-
GradientStop { position: 0.15; color: qgcPal.button }
77-
}
71+
QGCColoredImage {
72+
anchors.topMargin: _sliderIndicatorMargin
73+
anchors.bottomMargin: _sliderIndicatorMargin
74+
anchors.leftMargin: control.pressed ? (parent.width - width) * control.progress : 0
75+
anchors.left: parent.left
76+
anchors.top: parent.top
77+
anchors.bottom: parent.bottom
78+
width: height
79+
source: "qrc:/res/chevron-double-right.svg"
80+
sourceSize.height: parent.height
81+
fillMode: Image.PreserveAspectFit
82+
color: qgcPal.buttonText
83+
opacity: 0.2
7884

79-
Rectangle {
80-
anchors.fill: parent
81-
anchors.rightMargin: control.pressed ? parent.width * (1.0 - control.progress) : 0
82-
color: qgcPal.buttonHighlight
83-
opacity: _showHighlight ? 1 : control.enabled && control.hovered ? .2 : 0
84-
radius: parent.radius
85+
property real _sliderIndicatorMargin: ScreenTools.defaultFontPixelWidth * 0.5
8586
}
8687

8788
QGCLabel {

0 commit comments

Comments
 (0)