tray: wireless password ripple effect fix / focus
This commit is contained in:
parent
9825ad4d31
commit
f617c15d88
1 changed files with 24 additions and 5 deletions
|
|
@ -206,7 +206,15 @@ ColumnLayout {
|
|||
|
||||
focus: true
|
||||
activeFocusOnTab: true
|
||||
|
||||
property string passwordBuffer: ""
|
||||
|
||||
Keys.onPressed: event => {
|
||||
// Ensure we have focus when receiving keyboard input
|
||||
if (!activeFocus) {
|
||||
forceActiveFocus();
|
||||
}
|
||||
|
||||
if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) {
|
||||
if (connectButton.enabled) {
|
||||
connectButton.clicked();
|
||||
|
|
@ -225,8 +233,6 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
|
||||
property string passwordBuffer: ""
|
||||
|
||||
Connections {
|
||||
target: root
|
||||
function onShouldBeVisibleChanged(): void {
|
||||
|
|
@ -250,18 +256,31 @@ ColumnLayout {
|
|||
StyledRect {
|
||||
anchors.fill: parent
|
||||
radius: Appearance.rounding.normal
|
||||
color: Colours.tPalette.m3surfaceContainer
|
||||
border.width: passwordContainer.activeFocus ? 2 : 1
|
||||
border.color: passwordContainer.activeFocus ? Colours.palette.m3primary : Colours.palette.m3outline
|
||||
color: passwordContainer.activeFocus
|
||||
? Qt.lighter(Colours.tPalette.m3surfaceContainer, 1.05)
|
||||
: Colours.tPalette.m3surfaceContainer
|
||||
border.width: passwordContainer.activeFocus ? 4 : (root.shouldBeVisible ? 1 : 0)
|
||||
border.color: passwordContainer.activeFocus
|
||||
? Colours.palette.m3primary
|
||||
: (root.shouldBeVisible ? Colours.palette.m3outline : "transparent")
|
||||
|
||||
Behavior on border.color {
|
||||
CAnim {}
|
||||
}
|
||||
|
||||
Behavior on border.width {
|
||||
CAnim {}
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
hoverEnabled: false
|
||||
cursorShape: Qt.IBeamCursor
|
||||
radius: Appearance.rounding.normal
|
||||
|
||||
function onClicked(): void {
|
||||
passwordContainer.forceActiveFocus();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue