Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-welcome
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-welcome
Commits
a71053e4
Commit
a71053e4
authored
Jan 26, 2022
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a18y: add handy keyboard shortcuts
parent
95775bf4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
application.rs
src/application.rs
+1
-0
paginator.rs
src/widgets/paginator.rs
+14
-0
No files found.
src/application.rs
View file @
a71053e4
...
...
@@ -86,6 +86,7 @@ mod imp {
}),
);
application
.set_accels_for_action
(
"app.quit"
,
&
[
"<Control>q"
]);
application
.set_accels_for_action
(
"app.skip-tour"
,
&
[
"Escape"
]);
self
.parent_startup
(
application
);
}
}
...
...
src/widgets/paginator.rs
View file @
a71053e4
use
gtk
::
prelude
::
*
;
use
gtk
::{
gdk
,
glib
::{
self
,
clone
},
subclass
::
prelude
::
*
,
};
...
...
@@ -68,6 +69,19 @@ mod imp {
.connect_position_notify
(
clone!
(
@
weak
obj
=>
move
|
_
|
{
obj
.update_position
();
}));
let
controller
=
gtk
::
EventControllerKey
::
new
();
controller
.connect_key_pressed
(
clone!
(
@
weak
obj
=>
@
default
-
return
gtk
::
Inhibit
(
true
),
move
|
_controller
,
keyval
,
_keycode
,
_state
|
{
if
keyval
==
gdk
::
Key
::
Right
{
obj
.try_next
();
}
else
if
keyval
==
gdk
::
Key
::
Left
{
obj
.try_previous
();
}
gtk
::
Inhibit
(
false
)
}));
obj
.add_controller
(
&
controller
);
self
.parent_constructed
(
obj
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment