]> git.armaanb.net Git - chorizo.git/commitdiff
Make tab position customizable
authorPeter Hofmann <scm@uninformativ.de>
Sat, 25 Apr 2020 07:18:37 +0000 (09:18 +0200)
committerPeter Hofmann <scm@uninformativ.de>
Sat, 25 Apr 2020 07:18:56 +0000 (09:18 +0200)
browser.c
man1/lariza.1

index f8a7bf7f0ad856bb9895653b9f32efcf336975f5..48ff8485e59782917889be1403d74c745ea2f388 100644 (file)
--- 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);
index b295066031deda68a1d1a3a98d3dedd6f4561168..dc69965e24895d1be755ebc19a1324331d95beb8 100644 (file)
@@ -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.