Parcourir la source

LibGUI: Add side mouse buttons as an alternate shortcut for back/forward

The up/down side mouse buttons will now also trigger the back/forward
common actions, as used by the Browser, File Manager etc.

This matches standard behaviour of most apps on other operating systems.
Geordie Hall il y a 3 ans
Parent
commit
9a97ffe883
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      Userland/Libraries/LibGUI/CommonActions.cpp

+ 2 - 2
Userland/Libraries/LibGUI/CommonActions.cpp

@@ -120,14 +120,14 @@ NonnullRefPtr<Action> make_help_action(Function<void(Action&)> callback, Core::O
 
 
 NonnullRefPtr<Action> make_go_back_action(Function<void(Action&)> callback, Core::Object* parent)
 NonnullRefPtr<Action> make_go_back_action(Function<void(Action&)> callback, Core::Object* parent)
 {
 {
-    auto action = Action::create("Go &Back", { Mod_Alt, Key_Left }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent);
+    auto action = Action::create("Go &Back", { Mod_Alt, Key_Left }, { MouseButton::Backward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent);
     action->set_status_tip("Move one step backward in history");
     action->set_status_tip("Move one step backward in history");
     return action;
     return action;
 }
 }
 
 
 NonnullRefPtr<Action> make_go_forward_action(Function<void(Action&)> callback, Core::Object* parent)
 NonnullRefPtr<Action> make_go_forward_action(Function<void(Action&)> callback, Core::Object* parent)
 {
 {
-    auto action = Action::create("Go &Forward", { Mod_Alt, Key_Right }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent);
+    auto action = Action::create("Go &Forward", { Mod_Alt, Key_Right }, { MouseButton::Forward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent);
     action->set_status_tip("Move one step forward in history");
     action->set_status_tip("Move one step forward in history");
     return action;
     return action;
 }
 }