From 7740f6a710dd558f2f087542f8bde74681d4dba1 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 19 Jul 2018 23:05:14 -0300 Subject: [PATCH] Add mouse wheel customization for sprite editor Fix #680, #970, https://community.aseprite.org/t/668 and possibility to change alpha with mouse wheel: https://github.com/aseprite/aseprite/issues/680#issuecomment-344721509 --- data/strings/en.ini | 9 + data/widgets/keyboard_shortcuts.xml | 25 +- data/widgets/options.xml | 6 +- src/app/CMakeLists.txt | 1 + src/app/commands/cmd_cel_opacity.cpp | 112 ++++++ src/app/commands/cmd_keyboard_shortcuts.cpp | 196 +++++++++- src/app/commands/cmd_options.cpp | 12 +- src/app/commands/commands_list.h | 1 + .../ui/editor/state_with_wheel_behavior.cpp | 340 ++++++++++++++---- src/app/ui/key.h | 42 ++- src/app/ui/key_context.h | 1 + src/app/ui/keyboard_shortcuts.cpp | 249 +++++++++++-- src/app/ui/keyboard_shortcuts.h | 7 +- src/app/ui/select_accelerator.cpp | 2 + src/app/ui/select_accelerator.h | 2 + src/app/ui/toolbar.cpp | 8 + src/app/ui/toolbar.h | 5 +- 17 files changed, 880 insertions(+), 138 deletions(-) create mode 100644 src/app/commands/cmd_cel_opacity.cpp diff --git a/data/strings/en.ini b/data/strings/en.ini index f65ff7b9d..9db2e4746 100644 --- a/data/strings/en.ini +++ b/data/strings/en.ini @@ -190,6 +190,7 @@ BackgroundFromLayer = Background From Layer BrightnessContrast = Adjust Brightness/Contrast Cancel = Cancel Current Operation CanvasSize = Canvas Size +CelOpacity = Set Cel Opacity to {0} ({1}%) CelProperties = Cel Properties ChangeBrush = Change Brush: {0} ChangeBrush_CustomBrush = Custom Brush #{0} @@ -612,6 +613,14 @@ title = Keyboard Shortcuts import = &Import export = &Export reset = &Reset +section_menus = Menus +section_commands = Commands +section_tools = Tools +section_action_modifiers = Action Modifiers +section_mouse_wheel = Mouse Wheel +default_wheel_behavior = Default +custom_wheel_behavior = Custom +slide_as_wheel = Interpret two fingers slide on Trackpad as mouse wheel ok = &OK cancel = &Cancel diff --git a/data/widgets/keyboard_shortcuts.xml b/data/widgets/keyboard_shortcuts.xml index 525978621..75a0fa3f4 100644 --- a/data/widgets/keyboard_shortcuts.xml +++ b/data/widgets/keyboard_shortcuts.xml @@ -7,14 +7,20 @@ - + + + + + + +