forked from Silverfish/proton-bridge
Other: Fix activeFocus color for components
This commit is contained in:
@ -155,7 +155,7 @@ T.Button {
|
|||||||
return control.colorScheme.interaction_norm_active
|
return control.colorScheme.interaction_norm_active
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control.enabled && (control.highlighted || control.hovered || control.checked)) {
|
if (control.enabled && (control.highlighted || control.hovered || control.checked || control.activeFocus)) {
|
||||||
return control.colorScheme.interaction_norm_hover
|
return control.colorScheme.interaction_norm_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ T.Button {
|
|||||||
return control.colorScheme.interaction_default_active
|
return control.colorScheme.interaction_default_active
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control.enabled && (control.highlighted || control.hovered || control.checked)) {
|
if (control.enabled && (control.highlighted || control.hovered || control.checked || control.activeFocus)) {
|
||||||
return control.colorScheme.interaction_default_hover
|
return control.colorScheme.interaction_default_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ T.Button {
|
|||||||
return control.colorScheme.interaction_default_active
|
return control.colorScheme.interaction_default_active
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control.enabled && (control.highlighted || control.hovered || control.checked)) {
|
if (control.enabled && (control.highlighted || control.hovered || control.checked || control.activeFocus)) {
|
||||||
return control.colorScheme.interaction_default_hover
|
return control.colorScheme.interaction_default_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ T.Button {
|
|||||||
return control.colorScheme.interaction_default_active
|
return control.colorScheme.interaction_default_active
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control.enabled && (control.highlighted || control.hovered || control.checked)) {
|
if (control.enabled && (control.highlighted || control.hovered || control.checked || control.activeFocus)) {
|
||||||
return control.colorScheme.interaction_default_hover
|
return control.colorScheme.interaction_default_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ T.CheckBox {
|
|||||||
return control.colorScheme.signal_danger
|
return control.colorScheme.signal_danger
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control.hovered) {
|
if (control.hovered || control.activeFocus) {
|
||||||
return control.colorScheme.interaction_norm_hover
|
return control.colorScheme.interaction_norm_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ T.CheckBox {
|
|||||||
return control.colorScheme.signal_danger
|
return control.colorScheme.signal_danger
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control.hovered) {
|
if (control.hovered || control.activeFocus) {
|
||||||
return control.colorScheme.interaction_norm_hover
|
return control.colorScheme.interaction_norm_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,7 @@ T.ComboBox {
|
|||||||
return root.colorScheme.interaction_norm
|
return root.colorScheme.interaction_norm
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root.hovered) {
|
if (root.hovered || root.activeFocus) {
|
||||||
return root.colorScheme.field_hover
|
return root.colorScheme.field_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ T.ComboBox {
|
|||||||
return root.colorScheme.interaction_default_active
|
return root.colorScheme.interaction_default_active
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root.enabled && root.hovered) {
|
if (root.enabled && root.hovered || root.activeFocus) {
|
||||||
return root.colorScheme.interaction_default_hover
|
return root.colorScheme.interaction_default_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,14 +121,25 @@ T.ComboBox {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
text: root.textRole ? (Array.isArray(root.model) ? modelData[root.textRole] : model[root.textRole]) : modelData
|
text: root.textRole ? (Array.isArray(root.model) ? modelData[root.textRole] : model[root.textRole]) : modelData
|
||||||
|
|
||||||
palette.text: root.enabled ? root.colorScheme.text_norm : root.colorScheme.text_disabled
|
palette.text: {
|
||||||
|
if (!root.enabled) {
|
||||||
|
return root.colorScheme.text_disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selected) {
|
||||||
|
return root.colorScheme.text_invert
|
||||||
|
}
|
||||||
|
|
||||||
|
return root.colorScheme.text_norm
|
||||||
|
}
|
||||||
font: root.font
|
font: root.font
|
||||||
|
|
||||||
hoverEnabled: root.hoverEnabled
|
hoverEnabled: root.hoverEnabled
|
||||||
|
|
||||||
// we use highlighted to indicate currently selected delegate
|
property bool selected: root.currentIndex === index
|
||||||
highlighted: root.currentIndex === index
|
|
||||||
palette.highlightedText: root.enabled ? root.colorScheme.text_invert : root.colorScheme.text_disabled
|
highlighted: root.highlightedIndex === index
|
||||||
|
palette.highlightedText: selected ? root.colorScheme.text_invert : root.colorScheme.text_norm
|
||||||
|
|
||||||
background: PaddedRectangle {
|
background: PaddedRectangle {
|
||||||
radius: 4
|
radius: 4
|
||||||
@ -137,11 +148,11 @@ T.ComboBox {
|
|||||||
return root.colorScheme.interaction_default_active
|
return root.colorScheme.interaction_default_active
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parent.highlighted) {
|
if (parent.selected) {
|
||||||
return root.colorScheme.interaction_norm
|
return root.colorScheme.interaction_norm
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parent.hovered) {
|
if (parent.hovered || parent.highlighted) {
|
||||||
return root.colorScheme.interaction_default_hover
|
return root.colorScheme.interaction_default_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ T.RadioButton {
|
|||||||
return control.colorScheme.signal_danger
|
return control.colorScheme.signal_danger
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control.hovered) {
|
if (control.hovered || control.activeFocus) {
|
||||||
return control.colorScheme.interaction_norm_hover
|
return control.colorScheme.interaction_norm_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ T.RadioButton {
|
|||||||
return control.colorScheme.signal_danger
|
return control.colorScheme.signal_danger
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control.hovered) {
|
if (control.hovered || control.activeFocus) {
|
||||||
return control.colorScheme.interaction_norm_hover
|
return control.colorScheme.interaction_norm_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ T.Switch {
|
|||||||
padding: 0
|
padding: 0
|
||||||
spacing: 7
|
spacing: 7
|
||||||
|
|
||||||
indicator: PaddedRectangle {
|
indicator: Rectangle {
|
||||||
implicitWidth: 40
|
implicitWidth: 40
|
||||||
implicitHeight: 24
|
implicitHeight: 24
|
||||||
|
|
||||||
@ -54,9 +54,6 @@ T.Switch {
|
|||||||
y: control.topPadding + (control.availableHeight - height) / 2
|
y: control.topPadding + (control.availableHeight - height) / 2
|
||||||
|
|
||||||
radius: 12
|
radius: 12
|
||||||
leftPadding: 0
|
|
||||||
rightPadding: 0
|
|
||||||
padding: 0
|
|
||||||
color: control.enabled || control.loading ? control.colorScheme.background_norm : control.colorScheme.background_strong
|
color: control.enabled || control.loading ? control.colorScheme.background_norm : control.colorScheme.background_strong
|
||||||
border.width: control.enabled && !loading ? 1 : 0
|
border.width: control.enabled && !loading ? 1 : 0
|
||||||
border.color: control.hovered ? control.colorScheme.field_hover : control.colorScheme.field_norm
|
border.color: control.hovered ? control.colorScheme.field_hover : control.colorScheme.field_norm
|
||||||
@ -76,14 +73,14 @@ T.Switch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (control.checked) {
|
if (control.checked) {
|
||||||
if (control.hovered) {
|
if (control.hovered || control.activeFocus) {
|
||||||
return control.colorScheme.interaction_norm_hover
|
return control.colorScheme.interaction_norm_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
return control.colorScheme.interaction_norm
|
return control.colorScheme.interaction_norm
|
||||||
}
|
}
|
||||||
|
|
||||||
if (control.hovered) {
|
if (control.hovered || control.activeFocus) {
|
||||||
return control.colorScheme.field_hover
|
return control.colorScheme.field_hover
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -279,7 +279,6 @@ Item {
|
|||||||
|
|
||||||
visible: root.echoMode === TextInput.Password
|
visible: root.echoMode === TextInput.Password
|
||||||
icon.color: control.color
|
icon.color: control.color
|
||||||
background: Item { }
|
|
||||||
checkable: true
|
checkable: true
|
||||||
icon.source: checked ? "../icons/ic-eye-slash.svg" : "../icons/ic-eye.svg"
|
icon.source: checked ? "../icons/ic-eye-slash.svg" : "../icons/ic-eye.svg"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user