diff options
| author | Arslaan Pathan <[email protected]> | 2026-04-11 21:32:20 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-04-11 21:32:20 +1200 |
| commit | 94a741c456b73ac44615406ad55069ee9d02d77f (patch) | |
| tree | dfc94a5403dcd84781c0332239d6ac0290f73f05 /config.def.h | |
| parent | 082ffb7c0e1985e2f0e5165b130dd0a809bd83df (diff) | |
| download | cinnamon-browser-94a741c456b73ac44615406ad55069ee9d02d77f.tar.xz cinnamon-browser-94a741c456b73ac44615406ad55069ee9d02d77f.zip | |
Favicons, yay!
finally, i might daily drive cinnamon now!
Diffstat (limited to 'config.def.h')
| -rw-r--r-- | config.def.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/config.def.h b/config.def.h index 12eeaaa..afc1693 100644 --- a/config.def.h +++ b/config.def.h @@ -28,8 +28,11 @@ extern void inject_hint_mode(Cinnamon* cinnamon, void (*callback)(Cinnamon*, cha /* if the last tab is closed, don't quit, just make a fresh one */ #define NO_QUIT_ON_CLOSE_LAST_TAB /* hide the tab bar, unless a keybind or command shows it */ -#define HIDE_TAB_BAR +/* #define HIDE_TAB_BAR */ #define USERAGENT "Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/605.1.15 (KHTML, like Gecko) cinnamon/1.0 (git.arslaancodes.com/cinnamon-browser.git) Safari/605.1.15" +/* show favicon AND title */ +#define TABS_SHOW_FAVICON +#define TABS_SHOW_TITLE /* Keybind definitions */ /* we use the _kbd prefix here just because, idk, good practice to keep keybinds isolated? in practice use whatever the hell you want as long as it doesnt interfere with builtin functions */ @@ -126,6 +129,20 @@ static void _kbd_follow(Cinnamon* cinnamon, void* arg) { inject_hint_mode(cinnamon, &_conf_hint_callback); } +static void _kbd_next_tab(Cinnamon* cinnamon, void* arg) { + int current = gtk_notebook_get_current_page(GTK_NOTEBOOK(cinnamon->notebook)); + int n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(cinnamon->notebook)); + int next = (current + 1) % n_pages; + gtk_notebook_set_current_page(GTK_NOTEBOOK(cinnamon->notebook), next); +} + +static void _kbd_prev_tab(Cinnamon* cinnamon, void* arg) { + int current = gtk_notebook_get_current_page(GTK_NOTEBOOK(cinnamon->notebook)); + int n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(cinnamon->notebook)); + int prev = (current - 1 + n_pages) % n_pages; + gtk_notebook_set_current_page(GTK_NOTEBOOK(cinnamon->notebook), prev); +} + static const Keybind keybinds[] = { { "t", &_kbd_tabopen, NULL }, { "d", &_kbd_tabclose, NULL }, @@ -139,6 +156,8 @@ static const Keybind keybinds[] = { { "l", &_kbd_scroll, "right" }, { "r", &_kbd_reload, NULL }, { "f", &_kbd_follow, NULL }, + { "<S-j>", &_kbd_next_tab, NULL }, + { "<S-k>", &_kbd_prev_tab, NULL }, { "<S-h>", &_kbd_back, NULL }, { "<S-l>", &_kbd_forward, NULL }, { "<S-r>", &_kbd_hardreload, NULL }, @@ -202,12 +221,18 @@ static void _cmd_forward(Cinnamon* cinnamon, const char* args) { webkit_web_view_go_forward(WEBKIT_WEB_VIEW(webview)); } +static void _cmd_quit(Cinnamon* cinnamon, const char* args) { + gtk_main_quit(); +} + static const Command commands[] = { { "open", &_cmd_open }, { "reload", &_cmd_reload }, { "hard_reload", &_cmd_hardreload }, { "back", &_cmd_back }, { "forward", &_cmd_forward }, + { "q", &_cmd_quit }, + { "quit", &_cmd_quit }, }; |
