[ui] fix Palette propagation

* bugfix: in latest PySide2 versions, application palette is not properly applied to all QtQuick Controls 2 components. Force this by exposing QApplication palette and bind it to the root ApplicationWindow.
* rename all "palette" ids to "activePalette" to avoid clashes with "palette" property on QtQuick Controls 2
* use parent component palette when it makes sense to propagate active/disabled style (instead of always using Active SystemPalette)
This commit is contained in:
Yann Lanthony 2018-05-28 15:28:47 +02:00
parent 571560a43a
commit 2f2390e465
16 changed files with 46 additions and 43 deletions

View file

@ -20,8 +20,6 @@ FloatingPane {
clip: true
padding: 4
SystemPalette { id: palette }
/**
* Convert GPS metadata to degree coordinates.
*
@ -173,7 +171,7 @@ FloatingPane {
id: sizeHandle
height: parent.contentHeight
width: 1
color: palette.mid
color: root.palette.mid
x: parent.width * 0.4
MouseArea {
anchors.fill: parent
@ -198,7 +196,7 @@ FloatingPane {
Label {
width: parent.width
padding: 2
background: Rectangle { color: palette.mid }
background: Rectangle { color: parent.palette.mid }
text: section
}
}
@ -240,7 +238,7 @@ FloatingPane {
anchorPoint.y: circle.paintedHeight
sourceItem: Text {
id: circle
color: palette.highlight
color: root.palette.highlight
font.pointSize: 18
font.family: MaterialIcons.fontFamily
text: MaterialIcons.location_on