From 06f9083bdeb085b7b9de762fa029f6519e142dbe Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Sun, 9 Jun 2024 21:52:14 +0200 Subject: Add support for zoom factor Allows zooming in and out of pages by changing the size of all elements, including font size, images and tables. The initial zoom is specified in the "zoom_factor" option of dillorc. Use the new shortcuts Ctrl+ and Ctrl- to adjust the zoom of the current page and Ctrl 0 to reset it to 100%. When a new tab or window is opened, the current zoom factor is inherited. Each tab retains its own zoom factor. Fixes: https://github.com/dillo-browser/dillo/issues/21 --- src/ui.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ui.cc') diff --git a/src/ui.cc b/src/ui.cc index 9eda6f23..2f05c811 100644 --- a/src/ui.cc +++ b/src/ui.cc @@ -738,6 +738,15 @@ int UI::handle(int event) } else if (cmd == KEYS_FORWARD) { a_UIcmd_forw(a_UIcmd_get_bw_by_widget(this)); ret = 1; + } else if (cmd == KEYS_ZOOM_IN) { + a_UIcmd_zoom_in(a_UIcmd_get_bw_by_widget(this)); + ret = 1; + } else if (cmd == KEYS_ZOOM_OUT) { + a_UIcmd_zoom_out(a_UIcmd_get_bw_by_widget(this)); + ret = 1; + } else if (cmd == KEYS_ZOOM_RESET) { + a_UIcmd_zoom_reset(a_UIcmd_get_bw_by_widget(this)); + ret = 1; } else if (cmd == KEYS_BOOKMARKS) { a_UIcmd_book(a_UIcmd_get_bw_by_widget(this)); ret = 1; -- cgit v1.2.3