diff options
author | Peter Hofmann <scm@uninformativ.de> | 2020-04-25 09:18:37 +0200 |
---|---|---|
committer | Peter Hofmann <scm@uninformativ.de> | 2020-04-25 09:18:56 +0200 |
commit | fe194143ed6db650936baa3313bc1061a38049f5 (patch) | |
tree | 6dbb50f9132cd5ef55028fce5a4455552a164dd8 | |
parent | d60f720e89d44eca1d3be5ff0ea03465e3a9d4dc (diff) | |
download | lariza-fe194143ed6db650936baa3313bc1061a38049f5.tar.gz |
Make tab position customizable
-rw-r--r-- | browser.c | 15 | ||||
-rw-r--r-- | man1/lariza.1 | 6 |
2 files changed, 20 insertions, 1 deletions
@@ -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. |