From c6feac9ce0907a37333bfb015f713efa4e1a2483 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Mon, 12 Sep 2022 08:12:24 -0400 Subject: [PATCH] taskpanel: Remove keyboard button setting, only show when unsupported --- .../mobileshell/mobileshellsettings.cpp | 13 ------------- components/mobileshell/mobileshellsettings.h | 13 ------------- .../contents/ui/NavigationPanelComponent.qml | 4 ++-- kcms/mobileshell/package/contents/ui/main.qml | 19 ------------------- 4 files changed, 2 insertions(+), 47 deletions(-) diff --git a/components/mobileshell/mobileshellsettings.cpp b/components/mobileshell/mobileshellsettings.cpp index 199a0783..80de24c9 100644 --- a/components/mobileshell/mobileshellsettings.cpp +++ b/components/mobileshell/mobileshellsettings.cpp @@ -107,19 +107,6 @@ void MobileShellSettings::setNavigationPanelEnabled(bool navigationPanelEnabled) m_config->sync(); } -bool MobileShellSettings::keyboardButtonEnabled() const -{ - auto group = KConfigGroup{m_config, GENERAL_CONFIG_GROUP}; - return group.readEntry("keyboardButtonEnabled", false); -} - -void MobileShellSettings::setKeyboardButtonEnabled(bool keyboardButtonEnabled) -{ - auto group = KConfigGroup{m_config, GENERAL_CONFIG_GROUP}; - group.writeEntry("keyboardButtonEnabled", keyboardButtonEnabled, KConfigGroup::Notify); - m_config->sync(); -} - bool MobileShellSettings::taskSwitcherPreviewsEnabled() const { auto group = KConfigGroup{m_config, GENERAL_CONFIG_GROUP}; diff --git a/components/mobileshell/mobileshellsettings.h b/components/mobileshell/mobileshellsettings.h index 81a6a36d..469c9dc1 100644 --- a/components/mobileshell/mobileshellsettings.h +++ b/components/mobileshell/mobileshellsettings.h @@ -28,7 +28,6 @@ class MobileShellSettings : public QObject // navigation panel Q_PROPERTY(bool navigationPanelEnabled READ navigationPanelEnabled WRITE setNavigationPanelEnabled NOTIFY navigationPanelEnabledChanged) - Q_PROPERTY(bool keyboardButtonEnabled READ keyboardButtonEnabled WRITE setKeyboardButtonEnabled NOTIFY keyboardButtonEnabledChanged) // task switcher Q_PROPERTY(bool taskSwitcherPreviewsEnabled READ taskSwitcherPreviewsEnabled WRITE setTaskSwitcherPreviewsEnabled NOTIFY taskSwitcherPreviewsEnabledChanged) @@ -116,18 +115,6 @@ public: */ void setNavigationPanelEnabled(bool navigationPanelEnabled); - /** - * Whether the keyboard toggle button on the navigation panel is enabled. - */ - bool keyboardButtonEnabled() const; - - /** - * Set whether the keyboard toggle button on the navigation panel is enabled. - * - * @param keyboardButtonEnabled Whether the keyboard button on the navigation panel should be enabled. - */ - void setKeyboardButtonEnabled(bool keyboardButtonEnabled); - /** * Whether task switcher application previews are enabled. */ diff --git a/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml b/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml index 5d6deb5e..f5220490 100644 --- a/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml +++ b/containments/taskpanel/package/contents/ui/NavigationPanelComponent.qml @@ -107,8 +107,8 @@ MobileShell.NavigationPanel { rightCornerAction: MobileShell.NavigationPanelAction { id: keyboardToggleAction - visible: MobileShell.MobileShellSettings.keyboardButtonEnabled - enabled: Keyboards.KWinVirtualKeyboard.available + visible: Keyboards.KWinVirtualKeyboard.available && !Keyboards.KWinVirtualKeyboard.activeClientSupportsTextInput + enabled: true iconSource: "input-keyboard-virtual-symbolic" iconSizeFactor: 0.75 diff --git a/kcms/mobileshell/package/contents/ui/main.qml b/kcms/mobileshell/package/contents/ui/main.qml index 9c11aca7..db708e65 100644 --- a/kcms/mobileshell/package/contents/ui/main.qml +++ b/kcms/mobileshell/package/contents/ui/main.qml @@ -80,25 +80,6 @@ KCM.SimpleKCM { } } } - - MobileForm.FormDelegateSeparator { - visible: MobileShell.MobileShellSettings.navigationPanelEnabled - above: gestureDelegate - below: keyboardButtonDelegate - } - - MobileForm.FormSwitchDelegate { - id: keyboardButtonDelegate - visible: MobileShell.MobileShellSettings.navigationPanelEnabled - text: i18n("Keyboard Toggle") - description: i18n("Whether to show a keyboard button on the navigation panel.") - checked: MobileShell.MobileShellSettings.keyboardButtonEnabled - onCheckedChanged: { - if (checked != MobileShell.MobileShellSettings.keyboardButtonEnabled) { - MobileShell.MobileShellSettings.keyboardButtonEnabled = checked; - } - } - } } }