mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
navigationpanel: Add setting to always have keyboard toggle shown
This commit is contained in:
parent
6f296f3e46
commit
f5cdb9a380
4 changed files with 52 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ MobileShellSettings::MobileShellSettings(QObject *parent)
|
|||
Q_EMIT vibrationDurationChanged();
|
||||
Q_EMIT animationsEnabledChanged();
|
||||
Q_EMIT navigationPanelEnabledChanged();
|
||||
Q_EMIT alwaysShowKeyboardToggleOnNavigationPanelChanged();
|
||||
Q_EMIT keyboardButtonEnabledChanged();
|
||||
Q_EMIT taskSwitcherPreviewsEnabledChanged();
|
||||
Q_EMIT actionDrawerTopLeftModeChanged();
|
||||
|
|
@ -107,6 +108,19 @@ void MobileShellSettings::setNavigationPanelEnabled(bool navigationPanelEnabled)
|
|||
updateNavigationBarsInPlasma(navigationPanelEnabled);
|
||||
}
|
||||
|
||||
bool MobileShellSettings::alwaysShowKeyboardToggleOnNavigationPanel() const
|
||||
{
|
||||
auto group = KConfigGroup{m_config, GENERAL_CONFIG_GROUP};
|
||||
return group.readEntry("alwaysShowKeyboardToggleOnNavigationPanel", false);
|
||||
}
|
||||
|
||||
void MobileShellSettings::setAlwaysShowKeyboardToggleOnNavigationPanel(bool alwaysShowKeyboardToggleOnNavigationPanel)
|
||||
{
|
||||
auto group = KConfigGroup{m_config, GENERAL_CONFIG_GROUP};
|
||||
group.writeEntry("alwaysShowKeyboardToggleOnNavigationPanel", alwaysShowKeyboardToggleOnNavigationPanel, KConfigGroup::Notify);
|
||||
m_config->sync();
|
||||
}
|
||||
|
||||
MobileShellSettings::ActionDrawerMode MobileShellSettings::actionDrawerTopLeftMode() const
|
||||
{
|
||||
auto group = KConfigGroup{m_config, GENERAL_CONFIG_GROUP};
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ class MobileShellSettings : public QObject
|
|||
|
||||
// navigation panel
|
||||
Q_PROPERTY(bool navigationPanelEnabled READ navigationPanelEnabled WRITE setNavigationPanelEnabled NOTIFY navigationPanelEnabledChanged)
|
||||
Q_PROPERTY(bool alwaysShowKeyboardToggleOnNavigationPanel READ alwaysShowKeyboardToggleOnNavigationPanel WRITE setAlwaysShowKeyboardToggleOnNavigationPanel
|
||||
NOTIFY alwaysShowKeyboardToggleOnNavigationPanelChanged)
|
||||
|
||||
// action drawer
|
||||
Q_PROPERTY(ActionDrawerMode actionDrawerTopLeftMode READ actionDrawerTopLeftMode WRITE setActionDrawerTopLeftMode NOTIFY actionDrawerTopLeftModeChanged)
|
||||
|
|
@ -117,6 +119,23 @@ public:
|
|||
*/
|
||||
void setNavigationPanelEnabled(bool navigationPanelEnabled);
|
||||
|
||||
/**
|
||||
* Set whether the keyboard toggle button should always show on the navigation panel, regardless of
|
||||
* whether the app properly supports virtual keyboards.
|
||||
*
|
||||
* If this is false, then the keyboard toggle only shows on the navigation panel if the app doesn't
|
||||
* support virtual keyboards.
|
||||
*/
|
||||
bool alwaysShowKeyboardToggleOnNavigationPanel() const;
|
||||
|
||||
/**
|
||||
* Set whether the keyboard toggle button should always show on the navigation panel, regardless of
|
||||
* whether the app properly supports virtual keyboards.
|
||||
*
|
||||
* @param alwaysShowKeyboardToggleOnNavigationPanel
|
||||
*/
|
||||
void setAlwaysShowKeyboardToggleOnNavigationPanel(bool alwaysShowKeyboardToggleOnNavigationPanel);
|
||||
|
||||
/**
|
||||
* The mode of the action drawer when swiped down from the top left.
|
||||
*/
|
||||
|
|
@ -158,6 +177,7 @@ Q_SIGNALS:
|
|||
void vibrationIntensityChanged();
|
||||
void vibrationDurationChanged();
|
||||
void navigationPanelEnabledChanged();
|
||||
void alwaysShowKeyboardToggleOnNavigationPanelChanged();
|
||||
void keyboardButtonEnabledChanged();
|
||||
void animationsEnabledChanged();
|
||||
void taskSwitcherPreviewsEnabledChanged();
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import org.kde.plasma.private.mobileshell as MobileShell
|
|||
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
||||
import org.kde.taskmanager as TaskManager
|
||||
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
|
||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
|
|
@ -104,7 +105,8 @@ MobileShell.NavigationPanel {
|
|||
|
||||
rightCornerAction: MobileShell.NavigationPanelAction {
|
||||
id: keyboardToggleAction
|
||||
visible: Keyboards.KWinVirtualKeyboard.available && !Keyboards.KWinVirtualKeyboard.activeClientSupportsTextInput
|
||||
visible: ShellSettings.Settings.alwaysShowKeyboardToggleOnNavigationPanel ||
|
||||
(Keyboards.KWinVirtualKeyboard.available && !Keyboards.KWinVirtualKeyboard.activeClientSupportsTextInput)
|
||||
enabled: true
|
||||
iconSource: "input-keyboard-virtual-symbolic"
|
||||
iconSizeFactor: 0.75
|
||||
|
|
|
|||
|
|
@ -65,6 +65,21 @@ KCM.SimpleKCM {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { visible: keyboardToggleDelegate.visible; above: gestureDelegate; below: keyboardToggleDelegate }
|
||||
|
||||
FormCard.FormSwitchDelegate {
|
||||
id: keyboardToggleDelegate
|
||||
visible: !gestureDelegate.checked
|
||||
text: i18n("Always show keyboard toggle")
|
||||
description: i18n("Whether to always show the keyboard toggle button on the navigation panel.")
|
||||
checked: ShellSettings.Settings.alwaysShowKeyboardToggleOnNavigationPanel
|
||||
onCheckedChanged: {
|
||||
if (checked != ShellSettings.Settings.alwaysShowKeyboardToggleOnNavigationPanel) {
|
||||
ShellSettings.Settings.alwaysShowKeyboardToggleOnNavigationPanel = checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormHeader {
|
||||
|
|
|
|||
Loading…
Reference in a new issue