Browse Source

Forgot to customize TabBar and TabButton

QGC4.4
Gus Grubba 6 years ago
parent
commit
4900b60680
  1. 2
      qgroundcontrol.qrc
  2. 13
      src/QmlControls/QGCTabBar.qml
  3. 22
      src/QmlControls/QGCTabButton.qml
  4. 2
      src/QmlControls/QGroundControl/Controls/qmldir
  5. 10
      src/VehicleSetup/JoystickConfig.qml

2
qgroundcontrol.qrc

@ -125,6 +125,8 @@ @@ -125,6 +125,8 @@
<file alias="QGroundControl/Controls/QGCRadioButton.qml">src/QmlControls/QGCRadioButton.qml</file>
<file alias="QGroundControl/Controls/QGCSlider.qml">src/QmlControls/QGCSlider.qml</file>
<file alias="QGroundControl/Controls/QGCSwitch.qml">src/QmlControls/QGCSwitch.qml</file>
<file alias="QGroundControl/Controls/QGCTabBar.qml">src/QmlControls/QGCTabBar.qml</file>
<file alias="QGroundControl/Controls/QGCTabButton.qml">src/QmlControls/QGCTabButton.qml</file>
<file alias="QGroundControl/Controls/QGCTextField.qml">src/QmlControls/QGCTextField.qml</file>
<file alias="QGroundControl/Controls/QGCToolBarButton.qml">src/QmlControls/QGCToolBarButton.qml</file>
<file alias="QGroundControl/Controls/QGCViewDialog.qml">src/QmlControls/QGCViewDialog.qml</file>

13
src/QmlControls/QGCTabBar.qml

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
import QtQuick 2.11
import QtQuick.Controls 2.4
import QGroundControl 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
TabBar {
background: Rectangle {
color: qgcPal.window
}
}

22
src/QmlControls/QGCTabButton.qml

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
import QtQuick 2.11
import QtQuick.Controls 2.4
import QGroundControl 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
TabButton {
id: control
property bool _showHighlight: (pressed | hovered | checked)
background: Rectangle {
color: _showHighlight ? qgcPal.buttonHighlight : qgcPal.button
}
contentItem: QGCLabel {
text: control.text
color: _showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
}

2
src/QmlControls/QGroundControl/Controls/qmldir

@ -60,6 +60,8 @@ QGCPipable 1.0 QGCPipable.qml @@ -60,6 +60,8 @@ QGCPipable 1.0 QGCPipable.qml
QGCRadioButton 1.0 QGCRadioButton.qml
QGCSlider 1.0 QGCSlider.qml
QGCSwitch 1.0 QGCSwitch.qml
QGCTabBar 1.0 QGCTabBar.qml
QGCTabButton 1.0 QGCTabButton.qml
QGCTextField 1.0 QGCTextField.qml
QGCToolBarButton 1.0 QGCToolBarButton.qml
QGCViewDialog 1.0 QGCViewDialog.qml

10
src/VehicleSetup/JoystickConfig.qml

@ -58,20 +58,20 @@ SetupPage { @@ -58,20 +58,20 @@ SetupPage {
id: controller
}
TabBar {
QGCTabBar {
id: bar
width: parent.width
anchors.top: parent.top
TabButton {
QGCTabButton {
text: qsTr("General")
}
TabButton {
QGCTabButton {
text: qsTr("Button Assigment")
}
TabButton {
QGCTabButton {
text: qsTr("Calibration")
}
TabButton {
QGCTabButton {
text: qsTr("Advanced")
}
}

Loading…
Cancel
Save