diff options
author | Mavridis Philippe <[email protected]> | 2023-01-06 15:30:57 +0200 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2023-03-24 15:28:11 +0200 |
commit | a67db2d4847d798c01d4fd7584c5bb9297e109e3 (patch) | |
tree | 6cb5bb70f6201fa62dec021b92e838d32a6036ec /kxkb/kcmlayoutwidget.ui | |
parent | b50ab13974adf6f16d72f172f0cf768a44c161da (diff) | |
download | tdebase-a67db2d4847d798c01d4fd7584c5bb9297e109e3.tar.gz tdebase-a67db2d4847d798c01d4fd7584c5bb9297e109e3.zip |
Kxkb: Improve layout switching
1) New layout switching approach
The new approach is based on the "grp" options group of Xkb
and so enables us to use predefined X11 layout (group) switching
hotkeys like "Caps Lock" or "Shift+Alt" (you can see the full list
in the Options tab). The added bonus to this is that we conform
to the Xkb setting.
The code lets Xkb handle the keyboard layout switching hotkey(s)
and is similar to the one that is used in kkbswitch, monitoring
for an Xkb group (layout) change event.
This solution required me to remove some hacky and obsolete code
which was there to support really old pre-XFree-4.2 era systems
and included the "include groups" hack.
This means that the "Enable latin layout" checkbox is now gone
and setxkbmap is only called when the keyboard layouts and/or
options are modified, and not for every layout change.
2) Common layout switching hotkeys combobox
A combobox was added to the first page of the Keyboard Layouts
KCM module. It provides to the users a quick way to set a layout
switching key combination. It also controls the "grp" group in
the Xkb tab.
A special note about this combobox is that, even if Append Mode
was selected in the Xkb Options tab, this hotkey will overwrite
previous hotkey options. This means that all grp: options will
be forced removed before applying the option from the combobox
(in contrast to specifying options via the Xkb Options tab,
which, in Append Mode, will not get overwritten until next login).
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'kxkb/kcmlayoutwidget.ui')
-rw-r--r-- | kxkb/kcmlayoutwidget.ui | 73 |
1 files changed, 29 insertions, 44 deletions
diff --git a/kxkb/kcmlayoutwidget.ui b/kxkb/kcmlayoutwidget.ui index e8dcc3a9e..a36919b77 100644 --- a/kxkb/kcmlayoutwidget.ui +++ b/kxkb/kcmlayoutwidget.ui @@ -86,15 +86,42 @@ </widget> <widget class="TQLabel" row="2" column="2" rowspan="1" colspan="3"> <property name="name"> - <cstring>textLabel1_4_2</cstring> + <cstring>labelLayouts</cstring> </property> <property name="text"> <string>Active layouts:</string> </property> </widget> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>labelHotkey</cstring> + </property> + <property name="text"> + <string>Key combination to &switch layout:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>comboHotkey</cstring> + </property> + </widget> + <widget class="TQComboBox" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>comboHotkey</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="whatsThis" stdset="0"> + <string>Here you can choose the key combination you want to use to switch to the next layout. This list includes only the most common variants. If you choose "Other...", then you will be redirected to the "Options" tab where you can pick from all the available variants.</string> + </property> + </widget> <widget class="TQLabel" row="0" column="2" rowspan="1" colspan="3"> <property name="name"> - <cstring>textLabel1_2</cstring> + <cstring>labelModel</cstring> </property> <property name="text"> <string>Keyboard &model:</string> @@ -167,17 +194,6 @@ </column> <column> <property name="text"> - <string>5</string> - </property> - <property name="clickable"> - <bool>false</bool> - </property> - <property name="resizable"> - <bool>false</bool> - </property> - </column> - <column> - <property name="text"> <string>Label</string> </property> <property name="clickable"> @@ -327,20 +343,6 @@ <string>This is the command which is executed when switching to the selected layout. It may help you if you want to debug layout switching, or if you want to switch layouts without the help of TDE.</string> </property> </widget> - <widget class="TQCheckBox" row="7" column="2" rowspan="1" colspan="3"> - <property name="name"> - <cstring>chkLatin</cstring> - </property> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Include latin layout</string> - </property> - <property name="whatsThis" stdset="0"> - <string>If after you switch to this layout some keyboard shortcuts based on latin keys do not work try to enable this option.</string> - </property> - </widget> <widget class="TQLabel" row="6" column="2"> <property name="name"> <cstring>textLabel1_6</cstring> @@ -832,17 +834,6 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="TQCheckBox"> - <property name="name"> - <cstring>chkEnableOptions</cstring> - </property> - <property name="text"> - <string>&Enable xkb options</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> <widget class="TQGroupBox"> <property name="name"> <cstring>groupBox3_2</cstring> @@ -912,12 +903,6 @@ <slot>setEnabled(bool)</slot> </connection> <connection> - <sender>chkEnableOptions</sender> - <signal>toggled(bool)</signal> - <receiver>groupBox3_2</receiver> - <slot>setEnabled(bool)</slot> - </connection> - <connection> <sender>chkEnableSticky</sender> <signal>toggled(bool)</signal> <receiver>spinStickyDepth</receiver> |