window: Fix Left/Right button direction for RTL
This also fixes the issue with the buttons triggering focus changes when the action is deactivated because buttons know have their own action. Fixes #44 Issue #38
This commit is contained in:
parent
69889820cd
commit
74a067e3b8
2 changed files with 18 additions and 2 deletions
|
|
@ -106,6 +106,22 @@ mod imp {
|
|||
win.imp().image_view.navigate(Direction::Back);
|
||||
});
|
||||
|
||||
klass.install_action("win.image-right", None, move |win, _, _| {
|
||||
if win.direction() == gtk::TextDirection::Rtl {
|
||||
win.imp().image_view.navigate(Direction::Back);
|
||||
} else {
|
||||
win.imp().image_view.navigate(Direction::Forward);
|
||||
}
|
||||
});
|
||||
|
||||
klass.install_action("win.image-left", None, move |win, _, _| {
|
||||
if win.direction() == gtk::TextDirection::Rtl {
|
||||
win.imp().image_view.navigate(Direction::Forward);
|
||||
} else {
|
||||
win.imp().image_view.navigate(Direction::Back);
|
||||
}
|
||||
});
|
||||
|
||||
klass.install_action("win.first", None, move |win, _, _| {
|
||||
win.imp().image_view.jump(Position::First);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue