@@ -35,7 +35,6 @@ Rectangle {
3535 property bool _photoCaptureSingleIdle: _camera .photoCaptureStatus === MavlinkCameraControl .PHOTO_CAPTURE_IDLE
3636 property bool _photoCaptureIntervalIdle: _camera .photoCaptureStatus === MavlinkCameraControl .PHOTO_CAPTURE_INTERVAL_IDLE
3737 property bool _photoCaptureIdle: _photoCaptureSingleIdle || _photoCaptureIntervalIdle
38- property color _captureButtonColor: _cameraInPhotoMode ? qgcPal .photoCaptureButtonColor : qgcPal .videoCaptureButtonColor
3938
4039/*
4140 // Used for testing camera ui options. Set _camera to testCamera to use.
@@ -214,18 +213,24 @@ Rectangle {
214213
215214 // Take Photo, Start/Stop Video button
216215 Rectangle {
216+ id: captureButton
217217 Layout .alignment : Qt .AlignHCenter
218- color: qgcPal .button
218+ color: captureButtonPalette .button
219219 width: ScreenTools .defaultFontPixelWidth * 6
220220 height: width
221221 radius: width * 0.5
222222 border .width : 1
223- border .color : qgcPal .buttonBorder
223+ border .color : captureButtonPalette .buttonBorder
224+ enabled: _cameraInPhotoMode || (_cameraInVideoMode && _camera .hasVideoStream )
224225
225- Rectangle {
226+ property color captureButtonColor: _cameraInPhotoMode ? captureButtonPalette .photoCaptureButtonColor : captureButtonPalette .videoCaptureButtonColor
227+
228+ QGCPalette { id: captureButtonPalette; colorGroupEnabled: captureButton .enabled }
229+
230+ Rectangle {
226231 anchors .centerIn : parent
227232 anchors .alignWhenCentered : false // Prevents anchors.centerIn from snapping to integer coordinates, which can throw off centering.
228- color: qgcPal .buttonBorder
233+ color: captureButton . captureButtonPalette .buttonBorder
229234 width: parent .width * 0.75
230235 height: width
231236 radius: width * 0.5
@@ -237,9 +242,9 @@ Rectangle {
237242 width: parent .width * (_isShootingInCurrentMode ? 0.5 : 0.75 )
238243 height: width
239244 radius: _isShootingInCurrentMode ? ScreenTools .defaultFontPixelWidth * 0.5 : width * 0.5
240- color: _captureButtonColor
245+ color: captureButton . captureButtonColor
241246 border .width : 1
242- border .color : qgcPal .buttonBorder
247+ border .color : captureButton . captureButtonPalette .buttonBorder
243248
244249 property bool _isShootingInPhotoMode: _cameraInPhotoMode && _camera .photoCaptureStatus === MavlinkCameraControl .PHOTO_CAPTURE_IN_PROGRESS
245250 property bool _isShootingInVideoMode: (! _cameraInPhotoMode && _camera .videoCaptureStatus === MavlinkCameraControl .VIDEO_CAPTURE_STATUS_RUNNING )
@@ -271,7 +276,7 @@ Rectangle {
271276 // Record time / Capture count
272277 Rectangle {
273278 Layout .alignment : Qt .AlignHCenter
274- color: _videoCaptureIdle && _photoCaptureIdle ? " transparent" : _captureButtonColor
279+ color: _videoCaptureIdle && _photoCaptureIdle ? " transparent" : captureButton . captureButtonColor
275280 Layout .preferredWidth : (_cameraInVideoMode ? videoRecordTime .width : photoCaptureCount .width ) + (_smallMargins * 2 )
276281 Layout .preferredHeight : (_cameraInVideoMode ? videoRecordTime .height : photoCaptureCount .height )
277282 radius: _smallMargins
0 commit comments