mirror of
https://github.com/elementary/gala.git
synced 2024-08-17 02:50:38 +03:00
Add keybinding
This commit is contained in:
parent
5041a0f63a
commit
8312895b99
@ -282,6 +282,8 @@ namespace Gala {
|
|||||||
|
|
||||||
screenshot_accellabel.accel_string = gala_keybind_settings.get_strv ("window-screenshot")[0];
|
screenshot_accellabel.accel_string = gala_keybind_settings.get_strv ("window-screenshot")[0];
|
||||||
|
|
||||||
|
hide_others_accellabel.accel_string = gala_keybind_settings.get_strv ("hide-others")[0];
|
||||||
|
|
||||||
close.visible = Gala.WindowFlags.CAN_CLOSE in flags;
|
close.visible = Gala.WindowFlags.CAN_CLOSE in flags;
|
||||||
if (close.visible) {
|
if (close.visible) {
|
||||||
close_accellabel.accel_string = keybind_settings.get_strv ("close")[0];
|
close_accellabel.accel_string = keybind_settings.get_strv ("close")[0];
|
||||||
|
@ -206,6 +206,11 @@
|
|||||||
<summary>The shortcut to enable picture-in-picture window</summary>
|
<summary>The shortcut to enable picture-in-picture window</summary>
|
||||||
<description>The shortcut to show the selection area to choose a window.</description>
|
<description>The shortcut to show the selection area to choose a window.</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="as" name="hide-others">
|
||||||
|
<default><![CDATA[['<Super><Shift>h']]]></default>
|
||||||
|
<summary>Shortcut to hide other windows</summary>
|
||||||
|
<description></description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
|
|
||||||
<schema path="/org/pantheon/desktop/gala/appearance/" id="org.pantheon.desktop.gala.appearance">
|
<schema path="/org/pantheon/desktop/gala/appearance/" id="org.pantheon.desktop.gala.appearance">
|
||||||
|
@ -261,6 +261,9 @@ namespace Gala {
|
|||||||
display.add_keybinding ("area-screenshot-clip", keybinding_settings, 0, (Meta.KeyHandlerFunc) handle_screenshot);
|
display.add_keybinding ("area-screenshot-clip", keybinding_settings, 0, (Meta.KeyHandlerFunc) handle_screenshot);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
var gala_keybinding_settings = new GLib.Settings ("org.pantheon.desktop.gala.keybindings");
|
||||||
|
display.add_keybinding ("hide-others", gala_keybinding_settings, 0, (Meta.KeyHandlerFunc) handle_hide_others);
|
||||||
|
|
||||||
display.overlay_key.connect (() => {
|
display.overlay_key.connect (() => {
|
||||||
launch_action ("overlay-action");
|
launch_action ("overlay-action");
|
||||||
});
|
});
|
||||||
@ -481,6 +484,12 @@ namespace Gala {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CCode (instance_pos = -1)]
|
||||||
|
void handle_hide_others (Meta.Display display, Meta.Window? window,
|
||||||
|
Clutter.KeyEvent event, Meta.KeyBinding binding) {
|
||||||
|
perform_action (Gala.ActionType.HIDE_OTHERS);
|
||||||
|
}
|
||||||
|
|
||||||
private void on_gesture_detected (Gesture gesture) {
|
private void on_gesture_detected (Gesture gesture) {
|
||||||
if (workspace_view.is_opened ()) {
|
if (workspace_view.is_opened ()) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user