rosenrot-browser

A hackable browser based on Webkitgtk
Log | Files | Refs | README

commit 62b1bd678521d87ae95d7f8bfbe13535ec2072e7
parent 055e50c9ef3ea5ff49ab527923956229128343a9
Author: fenze <contact@fenze.dev>
Date:   Fri, 16 Dec 2022 09:07:43 +0000

Add newtab binding

Diffstat:
Mbuild.sh | 1+
Mconfig.def.h | 8+++++---
Mrose-mklink | 2+-
Mrose.c | 7++++++-
4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/build.sh b/build.sh @@ -8,4 +8,5 @@ LIBS=`pkg-config --libs ${DEPS[@]}` # Optional adblocking depends on https://github.com/jun7/wyebadblock WYEBAB='-L/usr/lib/wyebrowser/adblock.so' +cp -f config.def.h config.h $CC $INCS $LIBS $SRC $WYEBAB -o rose diff --git a/config.def.h b/config.def.h @@ -27,7 +27,7 @@ #define KEY(x) GDK_KEY_##x #define ZOOM 1 /* Starting zoom level */ #define ZOOM_VAL .1 /* Zooming value in zoomin/zoomout functions */ -#define BG_COLOR "#1E1E2E" /* or e.g., "#FEFEFE" if not using dark theme */ +#define BG_COLOR "#1E1E2E" /* or e.g., "#FEFEFE" if not using dark theme */ #define WIDTH 500 #define HEIGHT 400 @@ -47,7 +47,8 @@ typedef enum { show_searchbar, show_finder, finder_next, - finder_prev + finder_prev, + newtab } func; #define SFT 1 << 0 @@ -74,7 +75,8 @@ static struct { { CTRL, KEY(e), show_searchbar }, { CTRL, KEY(f), show_finder }, { CTRL, KEY(n), finder_next }, - { CTRL | SFT, KEY(N), finder_prev } + { CTRL | SFT, KEY(N), finder_prev }, + { CTRL, KEY(t), newtab } }; /* For controls more akin to normal browsers, use: { diff --git a/rose-mklink b/rose-mklink @@ -7,7 +7,7 @@ test "$1" = "--help" || test -z "$1" && { } test -z "$2" || { - [ -f "/usr/bin/$1" ] && { + test -f "/usr/bin/$1" && { echo "/usr/bin/$1 already exists, remove it first" exit 1 } diff --git a/rose.c b/rose.c @@ -7,7 +7,7 @@ * sublicense copies of this sotware for their own use. * This code does not come with any warranty. * - * Author: fenze <contact@fenze.dev> + * @author: fenze <contact@fenze.dev> */ #include "config.h" @@ -233,8 +233,13 @@ int handle_key(func id, GtkNotebook *notebook) webkit_find_controller_search_previous( webkit_web_view_get_find_controller(notebook_get_webview(notebook))); break; + + case newtab: + notebook_append(notebook, NULL); + gtk_notebook_set_show_tabs(notebook, true); } + return 1; }