mirror of
https://github.com/elementary/gala.git
synced 2024-12-29 20:21:39 +03:00
Allow switching to a workspace in workspace view with numbers
This commit is contained in:
parent
797a56e030
commit
a753e7fd87
@ -235,6 +235,7 @@ namespace Gala
|
|||||||
if (!released && display.get_current_time_roundtrip () < (last_time + AnimationSettings.get_default ().workspace_switch_duration))
|
if (!released && display.get_current_time_roundtrip () < (last_time + AnimationSettings.get_default ().workspace_switch_duration))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
int switch_index = -1;
|
||||||
switch (event.keyval) {
|
switch (event.keyval) {
|
||||||
case Clutter.Key.Left:
|
case Clutter.Key.Left:
|
||||||
if ((event.modifier_state & Clutter.ModifierType.SHIFT_MASK) == 1)
|
if ((event.modifier_state & Clutter.ModifierType.SHIFT_MASK) == 1)
|
||||||
@ -256,10 +257,43 @@ namespace Gala
|
|||||||
last_time = display.get_current_time_roundtrip ();
|
last_time = display.get_current_time_roundtrip ();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
case Clutter.Key.@1:
|
||||||
|
switch_index = 1;
|
||||||
|
break;
|
||||||
|
case Clutter.Key.@2:
|
||||||
|
switch_index = 2;
|
||||||
|
break;
|
||||||
|
case Clutter.Key.@3:
|
||||||
|
switch_index = 3;
|
||||||
|
break;
|
||||||
|
case Clutter.Key.@4:
|
||||||
|
switch_index = 4;
|
||||||
|
break;
|
||||||
|
case Clutter.Key.@5:
|
||||||
|
switch_index = 5;
|
||||||
|
break;
|
||||||
|
case Clutter.Key.@6:
|
||||||
|
switch_index = 6;
|
||||||
|
break;
|
||||||
|
case Clutter.Key.@7:
|
||||||
|
switch_index = 7;
|
||||||
|
break;
|
||||||
|
case Clutter.Key.@8:
|
||||||
|
switch_index = 8;
|
||||||
|
break;
|
||||||
|
case Clutter.Key.@9:
|
||||||
|
switch_index = 8;
|
||||||
|
break;
|
||||||
|
case Clutter.Key.@0:
|
||||||
|
switch_index = 10;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (switch_index != -1 && switch_index <= screen.n_workspaces)
|
||||||
|
screen.get_workspace_by_index (switch_index - 1).activate (screen.get_display ().get_current_time ());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user