diff options
author | Alexander Voigt <devnull@localhost> | 2012-09-28 02:43:41 +0000 |
---|---|---|
committer | Alexander Voigt <devnull@localhost> | 2012-09-28 02:43:41 +0000 |
commit | 771585fb7c00b32f9517510cd88bc70bb7613d77 (patch) | |
tree | 86622b88d5d3ac47e40ec33984984a67c3e7cfe7 | |
parent | 4fa58df07b541950f2c5abb3fa2215a075bae37f (diff) |
keybinding for view-source
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/keys.cc | 1 | ||||
-rw-r--r-- | src/keys.hh | 1 | ||||
-rw-r--r-- | src/keysrc | 3 | ||||
-rw-r--r-- | src/ui.cc | 7 |
5 files changed, 14 insertions, 0 deletions
@@ -15,6 +15,8 @@ dillo-3.0.3 [not released yet] - When location bar is given focus, temporarily show panels if hidden (BUG#1093). Patches: corvid ++- Added the "view-source" keybinding (default: Ctrl-U). + Patch: Alexander Voigt ----------------------------------------------------------------------------- diff --git a/src/keys.cc b/src/keys.cc index 08d50306..27b275a3 100644 --- a/src/keys.cc +++ b/src/keys.cc @@ -122,6 +122,7 @@ static const KeyBinding_t default_keys[] = { { "forward" , KEYS_FORWARD , 0 , '.' }, { "goto" , KEYS_GOTO , FL_CTRL , 'l' }, { "home" , KEYS_HOME , FL_CTRL , 'h' }, + { "view-source" , KEYS_VIEW_SOURCE , FL_CTRL , 'u' }, { "screen-up" , KEYS_SCREEN_UP , 0 , FL_Page_Up }, { "screen-up" , KEYS_SCREEN_UP , 0 , 'b' }, { "screen-down" , KEYS_SCREEN_DOWN , 0 , FL_Page_Down }, diff --git a/src/keys.hh b/src/keys.hh index d3a5d586..8d2ec53c 100644 --- a/src/keys.hh +++ b/src/keys.hh @@ -37,6 +37,7 @@ typedef enum { KEYS_FORWARD, KEYS_GOTO, KEYS_HOME, + KEYS_VIEW_SOURCE, KEYS_SCREEN_UP, KEYS_SCREEN_DOWN, KEYS_SCREEN_LEFT, @@ -72,6 +72,9 @@ # "file-menu" pops up the file menu. #<alt>f = file-menu +# "view-source" displays the page source. +#<ctrl>u = view-source + # "goto" goes to the location bar at the top of the window. #<ctrl>l = goto @@ -28,6 +28,8 @@ // Include image data #include "pixmaps.h" #include "uicmd.hh" +#include "history.h" +#include "nav.h" struct iconset { Fl_Image *ImgMeterOK, *ImgMeterBug, @@ -764,6 +766,11 @@ int UI::handle(int event) } else if (cmd == KEYS_FILE_MENU) { a_UIcmd_file_popup(a_UIcmd_get_bw_by_widget(this), FileButton); ret = 1; + } else if (cmd == KEYS_VIEW_SOURCE) { + BrowserWindow *bw = a_UIcmd_get_bw_by_widget(this); + const DilloUrl *url = a_History_get_url(NAV_TOP_UIDX(bw)); + a_UIcmd_view_page_source(bw, url); + ret = 1; } } else if (event == FL_RELEASE) { if (Fl::event_button() == FL_MIDDLE_MOUSE && |