Skip to content

Commit

Permalink
BugFixes in keybidings and dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aarnt committed Nov 12, 2021
1 parent e846cab commit bedb9fe
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 51 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ Ctrl+H | Return focus to page
Ctrl+I | Toggle show images on/off
Ctrl+J | Toggle enable javascript on/off
Ctrl+L | Goto location widget
Ctrl+N | Open link in new tab
Ctrl+P | Show print dialog
Ctrl+Q | Quit LRRH
Ctrl+R | Reload page
Ctrl+Shift+C | Copy statusbar text (hyperlink) to clipboard
Ctrl+Shift+G | Find previous
Ctrl+Shift+N | Open link in new tab
Ctrl+T | Open new empty tab
Ctrl+W | Close current tab
Ctrl+Z | Translate selected text to pt-br using Google Translator
Expand Down
6 changes: 5 additions & 1 deletion badwolf.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ gchar *web_extensions_directory;
const gchar *homepage = "https://hacktivis.me/projects/badwolf";
const gchar *version = VERSION;
gboolean g_dark_mode = FALSE;
static gchar *source = "a { color: lightgreen !important; } body, form, h1, h2, h3, h4, h5, div, iframe, input, label, li, option, p, pre, root, select, span, table, td, th, tr, ul { background: none !important; background-color: #212529 !important; color: #899095 !important; }";
static gchar *source = "a { color: lightgreen !important; }"
"article, aside, body, dd, dl, dt, form, "
"h1, h2, h3, h4, h5, header, div, iframe, input, label, "
"li, option, p, pre, root, select, span, table, td, th, tr, ul "
"{ background: none !important; background-color: #212529 !important; color: #aeb3b7 !important; }"; //#a3aaaf #899095

static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data);

Expand Down
36 changes: 18 additions & 18 deletions keybindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
{
if(browser != NULL)
{
switch(((GdkEventKey *)event)->keyval)
gboolean jsEnabled = gtk_toggle_button_get_active((GtkToggleButton *)browser->javascript);
gboolean imgEnabled = gtk_toggle_button_get_active((GtkToggleButton *)browser->auto_load_images);

switch(((GdkEventKey *)event)->keyval)
{
case GDK_KEY_C:
statusLabel = strdup(gtk_label_get_text(GTK_LABEL(browser->statuslabel)));
Expand All @@ -204,6 +207,20 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
case GDK_KEY_ISO_Left_Tab:
goto_prev_tab(notebook);
return TRUE;
case GDK_KEY_N:
nbrowser = new_browser(window,
gtk_label_get_text(GTK_LABEL(browser->statuslabel)),
NULL);
if (nbrowser != NULL)
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(nbrowser->javascript), jsEnabled);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(nbrowser->auto_load_images), imgEnabled);

badwolf_new_tab(GTK_NOTEBOOK(window->notebook), nbrowser, FALSE);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->notebook),
gtk_notebook_get_current_page(notebook)+1);
}
return TRUE;
case GDK_KEY_plus:
zoom = webkit_web_view_get_zoom_level(WEBKIT_WEB_VIEW(browser->webView));
zoom += zoom * 0.1;
Expand All @@ -219,9 +236,6 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
{
if(browser != NULL)
{
gboolean jsEnabled = gtk_toggle_button_get_active((GtkToggleButton *)browser->javascript);
gboolean imgEnabled = gtk_toggle_button_get_active((GtkToggleButton *)browser->auto_load_images);

switch(((GdkEventKey *)event)->keyval)
{
case GDK_KEY_F4:
Expand Down Expand Up @@ -260,20 +274,6 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
case GDK_KEY_l:
gtk_widget_grab_focus(browser->location);
return TRUE;
case GDK_KEY_n:
nbrowser = new_browser(window,
gtk_label_get_text(GTK_LABEL(browser->statuslabel)),
NULL);
if (nbrowser != NULL)
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(nbrowser->javascript), jsEnabled);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(nbrowser->auto_load_images), imgEnabled);

badwolf_new_tab(GTK_NOTEBOOK(window->notebook), nbrowser, FALSE);
gtk_notebook_set_current_page(GTK_NOTEBOOK(window->notebook),
gtk_notebook_get_current_page(notebook)+1);
}
return TRUE;
case GDK_KEY_p:
webkit_print_operation_run_dialog(webkit_print_operation_new(browser->webView),
GTK_WINDOW(browser->window));
Expand Down
62 changes: 31 additions & 31 deletions po/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Badwolf 1.0.3+g5e1689f.main\n"
"Project-Id-Version: Badwolf 1.0.3+ge846cab.main\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2021-11-11 19:36-0300\n"
"POT-Creation-Date: 2021-11-11 23:00-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -44,23 +44,23 @@ msgid ""
"Runtime WebKit version: %d.%d.%d"
msgstr ""

#: badwolf.c:1090
#: badwolf.c:1094
#, c-format
msgid "Buildtime WebKit version: %d.%d.%d\n"
msgstr ""

#: badwolf.c:454
#: badwolf.c:458
msgid "Continue"
msgstr ""

#: badwolf.c:404
#: badwolf.c:408
msgid ""
"Couldn't verify the TLS certificate to ensure a better security of the "
"connection. You might want to verify your machine and network.\n"
"\n"
msgstr ""

#: badwolf.c:108
#: badwolf.c:112
msgid "Crashed"
msgstr ""

Expand All @@ -72,111 +72,111 @@ msgstr ""
msgid "Downloads"
msgstr ""

#: badwolf.c:427
#: badwolf.c:431
msgid "Error: Some unknown error occurred validating the certificate.\n"
msgstr ""

#: badwolf.c:408
#: badwolf.c:412
msgid "Error: The X509 Certificate Authority is unknown.\n"
msgstr ""

#: badwolf.c:421
#: badwolf.c:425
msgid "Error: The certificate has been revoked.\n"
msgstr ""

#: badwolf.c:418
#: badwolf.c:422
msgid "Error: The certificate has expired. Check your system's clock.\n"
msgstr ""

#: badwolf.c:424
#: badwolf.c:428
msgid "Error: The certificate is considered to be insecure.\n"
msgstr ""

#: badwolf.c:415
#: badwolf.c:419
msgid "Error: The certificate isn't valid yet. Check your system's clock.\n"
msgstr ""

#: badwolf.c:411
#: badwolf.c:415
msgid "Error: The given identity doesn't match the expected one.\n"
msgstr ""

#: downloads.c:216 downloads.c:219
msgid "LRRH Downloads"
msgstr ""

#: badwolf.c:996
#: badwolf.c:1000
msgid "New tab"
msgstr ""

#: badwolf.c:1145
#: badwolf.c:1149
msgid "Open new tab"
msgstr ""

#: badwolf.c:112
#: badwolf.c:116
msgid "Out of Memory"
msgstr ""

#: badwolf.c:1088
#: badwolf.c:1092
#, c-format
msgid "Running Badwolf version: %s\n"
msgstr ""

#: badwolf.c:1095
#: badwolf.c:1099
#, c-format
msgid "Runtime WebKit version: %d.%d.%d\n"
msgstr ""

#: badwolf.c:451
#: badwolf.c:455
#, c-format
msgid "TLS Error for %s."
msgstr ""

#: badwolf.c:454
#: badwolf.c:458
msgid "Temporarily Add Exception"
msgstr ""

#: badwolf.c:737
#: badwolf.c:741
msgid "Toggle javascript"
msgstr ""

#: badwolf.c:742
#: badwolf.c:746
msgid "Toggle loading images automatically"
msgstr ""

#: badwolf.c:116
#: badwolf.c:120
msgid "Unknown Crash"
msgstr ""

#: badwolf.c:740
#: badwolf.c:744
msgid "_IMG"
msgstr ""

#: badwolf.c:735
#: badwolf.c:739
msgid "_JS"
msgstr ""

#: badwolf.c:853
#: badwolf.c:857
msgid "search in current page"
msgstr ""

#: badwolf.c:107
#: badwolf.c:111
msgid "the web process crashed.\n"
msgstr ""

#: badwolf.c:111
#: badwolf.c:115
msgid "the web process exceeded the memory limit.\n"
msgstr ""

#: badwolf.c:115
#: badwolf.c:119
msgid "the web process terminated for an unknown reason.\n"
msgstr ""

#: badwolf.c:1107
#: badwolf.c:1111
#, c-format
msgid "webkit-web-extension directory set to: %s\n"
msgstr ""

#. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext.
#: badwolf.c:1191
#: badwolf.c:1195
msgid "ø"
msgstr ""

0 comments on commit bedb9fe

Please sign in to comment.