mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 15:32:51 +00:00
QuickShow: Browse the files in the same folder
This commit is contained in:
parent
74a8e3fe1c
commit
2689fdf1d8
Notes:
sideshowbarker
2024-07-19 07:40:49 +09:00
Author: https://github.com/asliturk
Commit: 2689fdf1d8
Pull-request: https://github.com/SerenityOS/serenity/pull/1756
Reviewed-by: https://github.com/awesomekling
3 changed files with 89 additions and 0 deletions
|
@ -102,6 +102,27 @@ int main(int argc, char** argv)
|
|||
}
|
||||
};
|
||||
|
||||
// Actions
|
||||
auto go_first_action = GUI::Action::create("First", { Mod_None, Key_Home }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-first.png"),
|
||||
[&](auto&) {
|
||||
widget.navigate(QSWidget::Directions::First);
|
||||
});
|
||||
|
||||
auto go_back_action = GUI::Action::create("Back", { Mod_None, Key_Left }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"),
|
||||
[&](auto&) {
|
||||
widget.navigate(QSWidget::Directions::Back);
|
||||
});
|
||||
|
||||
auto go_forward_action = GUI::Action::create("Forward", { Mod_None, Key_Right }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"),
|
||||
[&](auto&) {
|
||||
widget.navigate(QSWidget::Directions::Forward);
|
||||
});
|
||||
|
||||
auto go_last_action = GUI::Action::create("Last", { Mod_None, Key_End }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-last.png"),
|
||||
[&](auto&) {
|
||||
widget.navigate(QSWidget::Directions::Last);
|
||||
});
|
||||
|
||||
auto menubar = make<GUI::MenuBar>();
|
||||
|
||||
auto& app_menu = menubar->add_menu("QuickShow");
|
||||
|
@ -116,6 +137,12 @@ int main(int argc, char** argv)
|
|||
app.quit();
|
||||
}));
|
||||
|
||||
auto& navigate_menu = menubar->add_menu("Navigate");
|
||||
navigate_menu.add_action(go_first_action);
|
||||
navigate_menu.add_action(go_back_action);
|
||||
navigate_menu.add_action(go_forward_action);
|
||||
navigate_menu.add_action(go_last_action);
|
||||
|
||||
auto& help_menu = menubar->add_menu("Help");
|
||||
help_menu.add_action(GUI::Action::create("About", [&](auto&) {
|
||||
GUI::AboutDialog::show("QuickShow", Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-image.png"), window);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue