taskpanel: Use 'visible' to check keyboard state, not 'active'

The virtual keyboard can be active but not visible. We want to use the
visibile property when determining whether there is a keyboard visually
showing.
This commit is contained in:
Devin Lin 2025-07-11 00:17:57 -04:00
parent d3cb51bef6
commit b41a80466a
2 changed files with 5 additions and 5 deletions

View file

@ -86,13 +86,13 @@ MobileShell.NavigationPanel {
rightAction: MobileShell.NavigationPanelAction {
id: closeAppAction
enabled: Keyboards.KWinVirtualKeyboard.active || WindowPlugin.WindowUtil.hasCloseableActiveWindow
iconSource: Keyboards.KWinVirtualKeyboard.active ? "go-down-symbolic" : "mobile-close-app"
enabled: Keyboards.KWinVirtualKeyboard.visible || WindowPlugin.WindowUtil.hasCloseableActiveWindow
iconSource: Keyboards.KWinVirtualKeyboard.visible ? "go-down-symbolic" : "mobile-close-app"
// mobile-close-app (from plasma-frameworks) seems to have fewer margins than icons from breeze-icons
iconSizeFactor: Keyboards.KWinVirtualKeyboard.active ? 1 : 0.75
iconSizeFactor: Keyboards.KWinVirtualKeyboard.visible ? 1 : 0.75
onTriggered: {
if (Keyboards.KWinVirtualKeyboard.active) {
if (Keyboards.KWinVirtualKeyboard.visible) {
// close keyboard if it is open
Keyboards.KWinVirtualKeyboard.active = false;
} else if (WindowPlugin.WindowUtil.hasCloseableActiveWindow) {

View file

@ -172,7 +172,7 @@ ContainmentItem {
Kirigami.Theme.colorSet: root.opaqueBar ? Kirigami.Theme.Window : Kirigami.Theme.Complementary
Kirigami.Theme.inherit: false
color: navigationPanel.state == "default" && (Keyboards.KWinVirtualKeyboard.active || root.opaqueBar) ? Kirigami.Theme.backgroundColor : "transparent"
color: navigationPanel.state == "default" && (Keyboards.KWinVirtualKeyboard.visible || root.opaqueBar) ? Kirigami.Theme.backgroundColor : "transparent"
property real offset: 0