commit: 27742f6afbf8d31e1e603d0f1c189bfd77d45a1e
parent d52aae2414564040b7d3ff61b6e4cfa09617ace0
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 27 Sep 2022 01:48:51 +0200
.clang-format: AllowShortCaseLabelsOnASingleLine: false
Diffstat:
2 files changed, 43 insertions(+), 15 deletions(-)
diff --git a/.clang-format b/.clang-format
@@ -4,7 +4,7 @@ AlignAfterOpenBracket: true
AlignConsecutiveAssignments: true
AlignOperands: true
AlignTrailingComments: true
-AllowShortCaseLabelsOnASingleLine: true
+AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
AlwaysBreakAfterReturnType: AllDefinitions
diff --git a/keybindings.c b/keybindings.c
@@ -84,7 +84,9 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
{
switch(((GdkEventKey *)event)->keyval)
{
- case GDK_KEY_F4: webkit_web_view_try_close(browser->webView); return TRUE;
+ case GDK_KEY_F4:
+ webkit_web_view_try_close(browser->webView);
+ return TRUE;
case GDK_KEY_r:
if(((GdkEventKey *)event)->state & GDK_SHIFT_MASK)
webkit_web_view_reload_bypass_cache(browser->webView);
@@ -92,10 +94,18 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
webkit_web_view_reload(browser->webView);
return TRUE;
- case GDK_KEY_f: gtk_widget_grab_focus(browser->search); return TRUE;
- case GDK_KEY_l: gtk_widget_grab_focus(browser->location); return TRUE;
- case GDK_KEY_bracketleft: webkit_web_view_go_back(browser->webView); return TRUE;
- case GDK_KEY_bracketright: webkit_web_view_go_forward(browser->webView); return TRUE;
+ case GDK_KEY_f:
+ gtk_widget_grab_focus(browser->search);
+ return TRUE;
+ case GDK_KEY_l:
+ gtk_widget_grab_focus(browser->location);
+ return TRUE;
+ case GDK_KEY_bracketleft:
+ webkit_web_view_go_back(browser->webView);
+ return TRUE;
+ case GDK_KEY_bracketright:
+ webkit_web_view_go_forward(browser->webView);
+ return TRUE;
case GDK_KEY_0:
webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(browser->webView), 1);
return TRUE;
@@ -109,9 +119,15 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
{
switch(((GdkEventKey *)event)->keyval)
{
- case GDK_KEY_Page_Down: gtk_notebook_next_page(notebook); return TRUE;
- case GDK_KEY_Page_Up: gtk_notebook_prev_page(notebook); return TRUE;
- case GDK_KEY_t: badwolf_new_tab(notebook, new_browser(window, NULL, NULL), TRUE); return TRUE;
+ case GDK_KEY_Page_Down:
+ gtk_notebook_next_page(notebook);
+ return TRUE;
+ case GDK_KEY_Page_Up:
+ gtk_notebook_prev_page(notebook);
+ return TRUE;
+ case GDK_KEY_t:
+ badwolf_new_tab(notebook, new_browser(window, NULL, NULL), TRUE);
+ return TRUE;
}
}
}
@@ -126,8 +142,12 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
switch(((GdkEventKey *)event)->keyval)
{
- case GDK_KEY_Left: gtk_notebook_prev_page(notebook); return TRUE;
- case GDK_KEY_Right: gtk_notebook_next_page(notebook); return TRUE;
+ case GDK_KEY_Left:
+ gtk_notebook_prev_page(notebook);
+ return TRUE;
+ case GDK_KEY_Right:
+ gtk_notebook_next_page(notebook);
+ return TRUE;
}
if((((GdkEventKey *)event)->keyval >= GDK_KEY_0) &&
(((GdkEventKey *)event)->keyval <= GDK_KEY_9))
@@ -138,9 +158,15 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
{
switch(((GdkEventKey *)event)->keyval)
{
- case GDK_KEY_F5: webkit_web_view_reload(browser->webView); return TRUE;
- case GDK_KEY_Escape: webkit_web_view_stop_loading(browser->webView); return TRUE;
- case GDK_KEY_F7: toggle_caret_browsing(browser->webView); return TRUE;
+ case GDK_KEY_F5:
+ webkit_web_view_reload(browser->webView);
+ return TRUE;
+ case GDK_KEY_Escape:
+ webkit_web_view_stop_loading(browser->webView);
+ return TRUE;
+ case GDK_KEY_F7:
+ toggle_caret_browsing(browser->webView);
+ return TRUE;
case GDK_KEY_F12:
webkit_web_inspector_show(webkit_web_view_get_inspector(browser->webView));
return TRUE;
@@ -150,7 +176,9 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
{
switch(((GdkEventKey *)event)->keyval)
{
- case GDK_KEY_F1: badwolf_about_dialog(GTK_WINDOW(window->main_window), window); return TRUE;
+ case GDK_KEY_F1:
+ badwolf_about_dialog(GTK_WINDOW(window->main_window), window);
+ return TRUE;
}
}