logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: 1d1a739cb869a73391759d8d7653b337c8ee8d01
parent: 80751fafa0b2600e17c8d880f267d8afd36c9108
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 12 May 2020 07:10:49 +0200

Add Ctrl-p keybinding

Diffstat:

Mbadwolf.c11+++--------
Mkeybindings.c4++++
2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/badwolf.c b/badwolf.c @@ -510,7 +510,6 @@ printCb_clicked(GtkButton *print, gpointer user_data) webkit_print_operation_run_dialog(print_operation, GTK_WINDOW(browser->window)); } - static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data) { @@ -597,10 +596,10 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat browser->location = gtk_entry_new(); gtk_widget_set_name(browser->location, "browser__location"); - GtkWidget *print = gtk_button_new_from_icon_name("document-print-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + GtkWidget *print = + gtk_button_new_from_icon_name("document-print-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_name(browser->back, "browser__print"); - browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->statusbar, "browser__statusbar"); browser->search = gtk_search_entry_new(); @@ -676,11 +675,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat TRUE, TRUE, BADWOLF_TOOLBAR_PADDING); - gtk_box_pack_start(GTK_BOX(browser->toolbar), - print, - FALSE, - FALSE, - BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), print, FALSE, FALSE, BADWOLF_TOOLBAR_PADDING); gtk_container_set_focus_child(GTK_CONTAINER(browser->box), browser->toolbar); gtk_container_set_focus_child(GTK_CONTAINER(browser->toolbar), browser->location); diff --git a/keybindings.c b/keybindings.c @@ -100,6 +100,10 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client * case GDK_KEY_0: webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(browser->webView), 1); return TRUE; + case GDK_KEY_p: + webkit_print_operation_run_dialog(webkit_print_operation_new(browser->webView), + GTK_WINDOW(browser->window)); + return TRUE; } } else