window: Put prev/next accels at window level

Tried to make things more stateless and RefCell usage for robust
- Use object properties to control the action enabled/disabled
- Borrow model RefCell for only one line or use .replace()
- Don't pass models around and borrow as short as possible instead

Fixes #20
This commit is contained in:
Sophie Herold 2022-12-06 18:24:32 +01:00 • committed by Christopher Davis
parent ba77ee1a32
commit 36000ff65c
4 changed files with 102 additions and 48 deletions

View file

@ -171,6 +171,9 @@ impl LpApplication {
self.set_accels_for_action("win.toggle-properties", &["F9"]);
self.set_accels_for_action("win.toggle-fullscreen", &["F11"]);
self.set_accels_for_action("win.previous", &["Left"]);
self.set_accels_for_action("win.next", &["Right"]);
self.set_accels_for_action("win.zoom-to(1.0)", &["1"]);
self.set_accels_for_action("win.zoom-to(2.0)", &["2"]);
self.set_accels_for_action("win.zoom-best-fit", &["<Ctrl>0", "0"]);