forked from Shinonome/dots-hyprland
removed unnecessary keyboard focus and ESC handler, as they are handled by overlay
This commit is contained in:
committed by
GitHub
parent
5820106e31
commit
631d496001
@@ -165,41 +165,14 @@ Rectangle {
|
|||||||
textFormat: TextEdit.PlainText
|
textFormat: TextEdit.PlainText
|
||||||
background: null
|
background: null
|
||||||
rightPadding: 44
|
rightPadding: 44
|
||||||
// CUSTOM: Adapt text color to theme (light/dark mode) - START
|
// Adapt text color to theme (light/dark mode) - START
|
||||||
color: Appearance.colors.colOnLayer0
|
color: Appearance.colors.colOnLayer0
|
||||||
// CUSTOM: Adapt text color to theme (light/dark mode) - END
|
// Adapt text color to theme (light/dark mode) - END
|
||||||
// CUSTOM: Disable text area when clickthrough enabled - START
|
// Disable text area when clickthrough enabled - START
|
||||||
// Allow editing when overlay is open OR when clickthrough is disabled
|
|
||||||
enabled: GlobalStates.overlayOpen || !root.isClickthrough
|
enabled: GlobalStates.overlayOpen || !root.isClickthrough
|
||||||
activeFocusOnTab: GlobalStates.overlayOpen || !root.isClickthrough
|
activeFocusOnTab: GlobalStates.overlayOpen || !root.isClickthrough
|
||||||
|
// Disable text area when clickthrough enabled - END
|
||||||
|
|
||||||
// Release focus when clickthrough is enabled and overlay closes
|
|
||||||
Connections {
|
|
||||||
target: root
|
|
||||||
function onIsClickthroughChanged() {
|
|
||||||
if (root.isClickthrough && !GlobalStates.overlayOpen && stickypadInput.activeFocus) {
|
|
||||||
stickypadInput.focus = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: GlobalStates
|
|
||||||
function onOverlayOpenChanged() {
|
|
||||||
if (!GlobalStates.overlayOpen && root.isClickthrough && stickypadInput.activeFocus) {
|
|
||||||
stickypadInput.focus = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// CUSTOM: Disable text area when clickthrough enabled - END
|
|
||||||
|
|
||||||
Keys.onPressed: (event) => {
|
|
||||||
if (event.key === Qt.Key_Escape && event.modifiers === Qt.NoModifier) {
|
|
||||||
Persistent.states.overlay.open = Persistent.states.overlay.open.filter(type => type !== "stickypad")
|
|
||||||
event.accepted = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
if (stickypadInput.activeFocus) {
|
if (stickypadInput.activeFocus) {
|
||||||
saveDebounce.restart()
|
saveDebounce.restart()
|
||||||
|
|||||||
Reference in New Issue
Block a user