mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
PaintBrush: Add keyboard shortcuts for selecting different layers
This commit is contained in:
parent
3fe5dc35f2
commit
a95ed3fdcc
Notes:
sideshowbarker
2024-07-19 06:39:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a95ed3fdccf
1 changed files with 14 additions and 0 deletions
|
@ -137,6 +137,20 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}, window));
|
||||
|
||||
layer_menu.add_separator();
|
||||
layer_menu.add_action(GUI::Action::create("Select previous layer", { 0, Key_PageUp }, [&](auto&) {
|
||||
layer_table_view.move_selection(1);
|
||||
}, window));
|
||||
layer_menu.add_action(GUI::Action::create("Select next layer", { 0, Key_PageDown }, [&](auto&) {
|
||||
layer_table_view.move_selection(-1);
|
||||
}, window));
|
||||
layer_menu.add_action(GUI::Action::create("Select top layer", { 0, Key_Home }, [&](auto&) {
|
||||
layer_table_view.selection().set(layer_table_view.model()->index(image_editor.image()->layer_count() - 1));
|
||||
}, window));
|
||||
layer_menu.add_action(GUI::Action::create("Select bottom layer", { 0, Key_End }, [&](auto&) {
|
||||
layer_table_view.selection().set(layer_table_view.model()->index(0));
|
||||
}, window));
|
||||
|
||||
auto& help_menu = menubar->add_menu("Help");
|
||||
help_menu.add_action(GUI::Action::create("About", [&](auto&) {
|
||||
GUI::AboutDialog::show("PaintBrush", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-paintbrush.png"), window);
|
||||
|
|
Loading…
Reference in a new issue