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
|
focus: true
|
||||||
activeFocusOnTab: true
|
activeFocusOnTab: true
|
||||||
|
|
||||||
|
property string passwordBuffer: ""
|
||||||
|
|
||||||
Keys.onPressed: event => {
|
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 (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) {
|
||||||
if (connectButton.enabled) {
|
if (connectButton.enabled) {
|
||||||
connectButton.clicked();
|
connectButton.clicked();
|
||||||
|
|
@ -225,8 +233,6 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property string passwordBuffer: ""
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root
|
target: root
|
||||||
function onShouldBeVisibleChanged(): void {
|
function onShouldBeVisibleChanged(): void {
|
||||||
|
|
@ -250,18 +256,31 @@ ColumnLayout {
|
||||||
StyledRect {
|
StyledRect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
color: Colours.tPalette.m3surfaceContainer
|
color: passwordContainer.activeFocus
|
||||||
border.width: passwordContainer.activeFocus ? 2 : 1
|
? Qt.lighter(Colours.tPalette.m3surfaceContainer, 1.05)
|
||||||
border.color: passwordContainer.activeFocus ? Colours.palette.m3primary : Colours.palette.m3outline
|
: 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 {
|
Behavior on border.color {
|
||||||
CAnim {}
|
CAnim {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Behavior on border.width {
|
||||||
|
CAnim {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
CAnim {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
hoverEnabled: false
|
hoverEnabled: false
|
||||||
cursorShape: Qt.IBeamCursor
|
cursorShape: Qt.IBeamCursor
|
||||||
|
radius: Appearance.rounding.normal
|
||||||
|
|
||||||
function onClicked(): void {
|
function onClicked(): void {
|
||||||
passwordContainer.forceActiveFocus();
|
passwordContainer.forceActiveFocus();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue