From: Peter Hofmann Date: Sat, 25 Apr 2020 07:18:37 +0000 (+0200) Subject: Make tab position customizable X-Git-Tag: v1.0.0~94 X-Git-Url: https://git.armaanb.net/?p=chorizo.git;a=commitdiff_plain;h=fe194143ed6db650936baa3313bc1061a38049f5 Make tab position customizable --- diff --git a/browser.c b/browser.c index f8a7bf7..48ff848 100644 --- a/browser.c +++ b/browser.c @@ -96,6 +96,7 @@ static gchar *home_uri = "about:blank"; static gboolean initial_wc_setup_done = FALSE; static GHashTable *keywords = NULL; static gchar *search_text = NULL; +static GtkPositionType tab_pos = GTK_POS_TOP; static gchar *user_agent = NULL; @@ -676,6 +677,19 @@ grab_environment_configuration(void) if (e != NULL) home_uri = g_strdup(e); + e = g_getenv(__NAME_UPPERCASE__"_TAB_POS"); + if (e != NULL) + { + if (strcmp(e, "top") == 0) + tab_pos = GTK_POS_TOP; + if (strcmp(e, "right") == 0) + tab_pos = GTK_POS_RIGHT; + if (strcmp(e, "bottom") == 0) + tab_pos = GTK_POS_BOTTOM; + if (strcmp(e, "left") == 0) + tab_pos = GTK_POS_LEFT; + } + e = g_getenv(__NAME_UPPERCASE__"_USER_AGENT"); if (e != NULL) user_agent = g_strdup(e); @@ -1084,6 +1098,7 @@ mainwindow_setup(void) mw.notebook = gtk_notebook_new(); gtk_notebook_set_scrollable(GTK_NOTEBOOK(mw.notebook), TRUE); + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(mw.notebook), tab_pos); gtk_container_add(GTK_CONTAINER(mw.win), mw.notebook); g_signal_connect(G_OBJECT(mw.notebook), "switch-page", G_CALLBACK(mainwindow_title_before), NULL); diff --git a/man1/lariza.1 b/man1/lariza.1 index b295066..dc69965 100644 --- a/man1/lariza.1 +++ b/man1/lariza.1 @@ -1,4 +1,4 @@ -.TH lariza 1 "2020-04-24" "lariza" "User Commands" +.TH lariza 1 "2020-04-25" "lariza" "User Commands" .\" -------------------------------------------------------------------- .SH NAME lariza \- simple web browser @@ -66,6 +66,10 @@ This URI will be opened by pressing the appropriate hotkeys (\(lqhomepage\(rq or \(lqnew window\(rq) and if no URIs are specified on the command line. Defaults to \fBabout:blank\fP. .TP +\fBLARIZA_TAB_POS\fP +Can be one of \fBtop\fP (default), \fBright\fP, \fBbottom\fP, +\fBleft\fP. +.TP \fBLARIZA_USER_AGENT\fP \fBlariza\fP will identify itself with this string. Uses WebKit's default value if unset.