summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--src/keys.cc1
-rw-r--r--src/keys.hh1
-rw-r--r--src/keysrc3
-rw-r--r--src/ui.cc7
5 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d7d7e8f..b7fa247a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
diff --git a/src/keysrc b/src/keysrc
index e0c488f9..11913e78 100644
--- a/src/keysrc
+++ b/src/keysrc
@@ -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
diff --git a/src/ui.cc b/src/ui.cc
index 4520e16f..647248aa 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -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 &&