mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:38:10 +00:00
QuickShow: Add Fullscreen, Zoom options to View menu
This commit is contained in:
parent
d79c81a179
commit
e0bf57d81f
3 changed files with 44 additions and 2 deletions
|
@ -143,6 +143,26 @@ int main(int argc, char** argv)
|
|||
widget.navigate(QSWidget::Directions::Last);
|
||||
});
|
||||
|
||||
auto full_sceen_action = GUI::CommonActions::make_fullscreen_action(
|
||||
[&](auto&) {
|
||||
window->set_fullscreen(!window->is_fullscreen());
|
||||
});
|
||||
|
||||
auto zoom_in_action = GUI::Action::create("Zoom In", { Mod_None, Key_Plus }, Gfx::Bitmap::load_from_file("/res/icons/16x16/zoom-in.png"),
|
||||
[&](auto&) {
|
||||
widget.set_scale(widget.scale() + 10);
|
||||
});
|
||||
|
||||
auto zoom_reset_action = GUI::Action::create("Zoom 100%", { Mod_None, Key_0 },
|
||||
[&](auto&) {
|
||||
widget.set_scale(100);
|
||||
});
|
||||
|
||||
auto zoom_out_action = GUI::Action::create("Zoom Out", { Mod_None, Key_Minus }, Gfx::Bitmap::load_from_file("/res/icons/16x16/zoom-out.png"),
|
||||
[&](auto&) {
|
||||
widget.set_scale(widget.scale() - 10);
|
||||
});
|
||||
|
||||
auto menubar = make<GUI::MenuBar>();
|
||||
|
||||
auto& app_menu = menubar->add_menu("QuickShow");
|
||||
|
@ -169,6 +189,13 @@ int main(int argc, char** argv)
|
|||
navigate_menu.add_action(go_forward_action);
|
||||
navigate_menu.add_action(go_last_action);
|
||||
|
||||
auto& view_menu = menubar->add_menu("View");
|
||||
view_menu.add_action(full_sceen_action);
|
||||
view_menu.add_separator();
|
||||
view_menu.add_action(zoom_in_action);
|
||||
view_menu.add_action(zoom_reset_action);
|
||||
view_menu.add_action(zoom_out_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