Skip to content

Commit

Permalink
fit: Add focus style
Browse files Browse the repository at this point in the history
Add Switch,Slider,ComboBox focus style

pms: BUG-303539
  • Loading branch information
caixr23 committed Feb 21, 2025
1 parent 92014b5 commit f91669c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions qt6/src/qml/ComboBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ T.ComboBox {
}
}
}
Loader {
anchors.fill: parent
active: control.flat && control.visualFocus
sourceComponent: FocusBoxBorder {
radius: DS.Style.control.radius
color: control.palette.highlight
}
}
}

popup: Popup {
Expand Down
9 changes: 9 additions & 0 deletions qt6/src/qml/Slider.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ T.Slider {
palette: D.DTK.makeIconPalette(control.palette)
mode: control.D.ColorSelector.controlState
theme: control.D.ColorSelector.controlTheme

Loader {
anchors.fill: parent
active: control.visualFocus
sourceComponent: FocusBoxBorder {
radius: DS.Style.control.radius
color: control.palette.highlight
}
}
}

// draw panel
Expand Down
9 changes: 9 additions & 0 deletions qt6/src/qml/Switch.qml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,13 @@ T.Switch {
text: control.text
verticalAlignment: Text.AlignVCenter
}

background: Loader {
anchors.fill: parent
active: control.visualFocus
sourceComponent: FocusBoxBorder {
radius: DS.Style.control.radius
color: control.palette.highlight
}
}
}

0 comments on commit f91669c

Please # to comment.