forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add icons for lights. Implement simple and night light by default on …
…main UI
- Loading branch information
1 parent
329a485
commit a94f907
Showing
5 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/**************************************************************************** | ||
* | ||
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> | ||
* | ||
* QGroundControl is licensed according to the terms in the file | ||
* COPYING.md in the root of the source code directory. | ||
* | ||
****************************************************************************/ | ||
|
||
import QtQuick 2.11 | ||
import QtQuick.Layouts 1.11 | ||
|
||
import QGroundControl 1.0 | ||
import QGroundControl.Controls 1.0 | ||
import QGroundControl.MultiVehicleManager 1.0 | ||
import QGroundControl.ScreenTools 1.0 | ||
import QGroundControl.Palette 1.0 | ||
|
||
// Joystick Indicator | ||
Item { | ||
id: _root | ||
width: joystickRow.width * 1.1 | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
|
||
property bool showIndicator: true | ||
property bool _joystickEnabled: globals.activeVehicle ? globals.activeVehicle.joystickEnabled : false | ||
|
||
Row { | ||
id: lightRow | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
spacing: ScreenTools.defaultFontPixelWidth | ||
|
||
QGCColoredImage { | ||
width: height | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
sourceSize.height: height | ||
source: "/qmlimages/SimpleLight.png" | ||
fillMode: Image.PreserveAspectFit | ||
color: { | ||
if(globals.activeVehicle && joystickManager.activeJoystick) { | ||
if(globals.activeVehicle.joystickEnabled) { | ||
// Everything ready to use joystick | ||
return qgcPal.buttonText | ||
} | ||
// Joystick is not enabled in the joystick configuration page | ||
return "yellow" | ||
} | ||
// Joystick not available or there is no active vehicle | ||
return "red" | ||
} | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/**************************************************************************** | ||
* | ||
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> | ||
* | ||
* QGroundControl is licensed according to the terms in the file | ||
* COPYING.md in the root of the source code directory. | ||
* | ||
****************************************************************************/ | ||
|
||
import QtQuick 2.11 | ||
import QtQuick.Layouts 1.11 | ||
|
||
import QGroundControl 1.0 | ||
import QGroundControl.Controls 1.0 | ||
import QGroundControl.MultiVehicleManager 1.0 | ||
import QGroundControl.ScreenTools 1.0 | ||
import QGroundControl.Palette 1.0 | ||
|
||
// Joystick Indicator | ||
Item { | ||
id: _root | ||
width: joystickRow.width * 1.1 | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
|
||
property bool showIndicator: true | ||
property bool _joystickEnabled: globals.activeVehicle ? globals.activeVehicle.joystickEnabled : false | ||
|
||
Row { | ||
id: lightRow | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
spacing: ScreenTools.defaultFontPixelWidth | ||
|
||
QGCColoredImage { | ||
width: height | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
sourceSize.height: height | ||
source: "/qmlimages/SimpleLight.png" | ||
fillMode: Image.PreserveAspectFit | ||
color: { | ||
if(globals.activeVehicle && joystickManager.activeJoystick) { | ||
if(globals.activeVehicle.joystickEnabled) { | ||
// Everything ready to use joystick | ||
return qgcPal.buttonText | ||
} | ||
// Joystick is not enabled in the joystick configuration page | ||
return "yellow" | ||
} | ||
// Joystick not available or there is no active vehicle | ||
return "red" | ||
} | ||
} | ||
} | ||
} |