Add F8/F9/F10 as shortcuts to the scale functionality

This commit is contained in:
Chris Young 2015-11-15 14:07:25 +00:00
parent bf6d56c7fe
commit 0feb291c2e
3 changed files with 36 additions and 23 deletions

View File

@ -336,7 +336,7 @@ The Installer script will set the MIMETYPE tooltype on basic relevant default fi
This is a list of the keyboard shortcuts used in NetSurf
- RAmiga + R or F5 (reload the current page)
- PageUp/Down (scroll up/down to one page)
- PageUp/Down/Space (scroll up/down to one page)
- Home/End (go to top/bottom of the page)
- Left/Right/Up/Down (scroll the page)
- RAmiga + U (activate the URL bar)
@ -345,26 +345,27 @@ This is a list of the keyboard shortcuts used in NetSurf
Keyboard shortcuts used in NetSurf menu
- RAmiga + N (open a new window)
- RAmiga + T (open a new tab)
- RAmiga + O (open a local file)
- RAmiga + S (save source page)
- RAmiga + K (close current tab)
- RAmiga + P (print a page)
- RAmiga + ? (about NetSurf)
- RAmiga + Q (quit NetSurf)
- RAmiga + X (cut)
- RAmiga + C (copy)
- RAmiga + V (paste)
- RAmiga + A (select all)
- RAmiga + Z (clear selection)
- RAmiga + F (find a string/text)
- RAmiga + - (decrease font)
- RAmiga + = (normal font)
- RAmiga + + (increase font)
- RAmiga + B (add link to bookmark)
- RAmiga + H (show bookmarks)
- RAmiga + E (execute script)
- RAmiga + N (open a new window)
- RAmiga + T (open a new tab)
- RAmiga + O (open a local file)
- RAmiga + S (save source page)
- RAmiga + K (close current tab)
- RAmiga + P (print a page)
- RAmiga + ? (about NetSurf)
- RAmiga + Q (quit NetSurf)
- RAmiga + X (cut)
- RAmiga + C (copy)
- RAmiga + V (paste)
- RAmiga + A (select all)
- RAmiga + Z (undo)
- RAmiga + Y (redo)
- RAmiga + F (find a string/text)
- RAmiga + - or F9 (decrease scale)
- RAmiga + = or F8 (normal scale)
- RAmiga + + or F10 (increase scale)
- RAmiga + B (add link to bookmark)
- RAmiga + H (show bookmarks)
- RAmiga + E (execute script)
@endnode

View File

@ -2337,6 +2337,18 @@ static void ami_handle_msg(void)
if(browser_window_reload_available(gwin->gw->bw))
browser_window_reload(gwin->gw->bw,false);
break;
case RAWKEY_F8: // scale 100%
ami_gui_set_scale(gwin->gw, 1.0);
break;
case RAWKEY_F9: // decrease scale
ami_gui_set_scale(gwin->gw, gwin->gw->scale - 0.1);
break;
case RAWKEY_F10: // increase scale
ami_gui_set_scale(gwin->gw, gwin->gw->scale + 0.1);
break;
case RAWKEY_HELP: // help
ami_help_open(AMI_HELP_GUI, scrn);
@ -3334,6 +3346,7 @@ int ami_gui_count_windows(int window, int *tabs)
*/
void ami_gui_set_scale(struct gui_window *gw, float scale)
{
if(scale <= 0.0) return;
gw->scale = scale;
browser_window_set_scale(gw->bw, scale, true);
}

View File

@ -379,8 +379,7 @@ HOOKF(void, ami_menu_item_browser_scale_decrease, APTR, window, struct IntuiMess
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
if(gwin->gw->scale > 0.1)
ami_gui_set_scale(gwin->gw, gwin->gw->scale - 0.1);
ami_gui_set_scale(gwin->gw, gwin->gw->scale - 0.1);
}
HOOKF(void, ami_menu_item_browser_scale_normal, APTR, window, struct IntuiMessage *)