From 5a54cbb740e44b20616cbd2b25e00378a8f8fe20 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan.olivier@wanadoo.fr>
Date: Thu, 17 Oct 2002 20:17:17 +0000
Subject: [PATCH] Add new option "title_horizontal_offset" for themerc

(Old svn revision: 10641)
---
 defaults/defaults.in              |  1 +
 src/frame.c                       |  9 ++++---
 src/settings.c                    |  3 +++
 src/settings.h                    |  1 +
 themes/curve/themerc              |  1 +
 themes/curve/title-2-active.xpm   | 40 +++++++++++++++----------------
 themes/curve/title-2-inactive.xpm | 40 +++++++++++++++----------------
 7 files changed, 52 insertions(+), 43 deletions(-)

diff --git a/defaults/defaults.in b/defaults/defaults.in
index f8c73573b..eaf12a26e 100644
--- a/defaults/defaults.in
+++ b/defaults/defaults.in
@@ -6,6 +6,7 @@ button_layout=OTS|HMC
 button_spacing=1
 button_offset=0
 title_vertical_offset=0
+title_horizontal_offset=0
 double_click_action=maximize
 box_move=false
 box_resize=false
diff --git a/src/frame.c b/src/frame.c
index cd9f2e846..654808731 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -212,8 +212,11 @@ static void frameCreateTitlePixmap(Client * c, int state, int left, int right, M
         }
         switch (title_alignment)
         {
+            case ALIGN_LEFT:
+                tp = title_horizontal_offset;
+                break;
             case ALIGN_RIGHT:
-                tp = w3 - logical_rect.width;
+                tp = w3 - logical_rect.width - title_horizontal_offset;
                 break;
             case ALIGN_CENTER:
                 tp = (w3 / 2) - (logical_rect.width / 2);
@@ -239,10 +242,10 @@ static void frameCreateTitlePixmap(Client * c, int state, int left, int right, M
         switch (title_alignment)
         {
             case ALIGN_LEFT:
-                w1 = left;
+                w1 = left + title_horizontal_offset;
                 break;
             case ALIGN_RIGHT:
-                w1 = right - w2 - w3 - w4;
+                w1 = right - w2 - w3 - w4 - title_horizontal_offset;
                 break;
             case ALIGN_CENTER:
                 w1 = left + ((right - left) / 2) - (w3 / 2) - w2;
diff --git a/src/settings.c b/src/settings.c
index 89f179993..52bdf8c42 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -42,6 +42,7 @@ int full_width_title;
 int button_spacing;
 int button_offset;
 int title_vertical_offset;
+int title_horizontal_offset;
 int double_click_action;
 int box_move;
 int box_resize;
@@ -89,6 +90,7 @@ void loadSettings()
         {"button_layout", NULL, TRUE},
         {"button_spacing", NULL, TRUE},
         {"title_vertical_offset", NULL, TRUE},
+        {"title_horizontal_offset", NULL, TRUE},
         {"button_offset", NULL, TRUE},
         {"double_click_action", NULL, TRUE},
         {"box_move", NULL, TRUE},
@@ -327,6 +329,7 @@ void loadSettings()
     button_spacing = atoi(getValue("button_spacing", rc));
     button_offset = atoi(getValue("button_offset", rc));
     title_vertical_offset = atoi(getValue("title_vertical_offset", rc));
+    title_horizontal_offset = atoi(getValue("title_horizontal_offset", rc));
 
     box_gc = createGC(cmap, "#FFFFFF", GXxor, NULL, True);
     box_resize = !g_ascii_strcasecmp("true", getValue("box_resize", rc));
diff --git a/src/settings.h b/src/settings.h
index 60bd625a9..227297c1b 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -60,6 +60,7 @@ extern int full_width_title;
 extern int button_spacing;
 extern int button_offset;
 extern int title_vertical_offset;
+extern int title_horizontal_offset;
 extern int double_click_action;
 extern int box_move;
 extern int box_resize;
diff --git a/themes/curve/themerc b/themes/curve/themerc
index 29bfdb5ef..59bac0cf9 100644
--- a/themes/curve/themerc
+++ b/themes/curve/themerc
@@ -2,3 +2,4 @@ full_width_title=true
 button_offset=0
 button_spacing=0
 title_vertical_offset=0
+title_horizontal_offset=8
diff --git a/themes/curve/title-2-active.xpm b/themes/curve/title-2-active.xpm
index 43404aee0..2bbafff33 100644
--- a/themes/curve/title-2-active.xpm
+++ b/themes/curve/title-2-active.xpm
@@ -1,28 +1,28 @@
 /* XPM */
 static char * title_2_active_xpm[] = {
-"8 19 6 1",
+"2 19 6 1",
 " 	c None",
 ".	c #000000",
 "+	c #B2BAE9 s active_hilight_1",
 "@	c #525FAB s active_color_1",
 "#	c #848FD6 s active_mid_1",
 "$	c #4B58A2 s active_shadow_1",
-"........",
-".+++++++",
-".+++++++",
-".+@+@+@+",
-".@+@+@+@",
-".@@+@@@+",
-".@+@@@+@",
-".+@@@+@@",
-".@@@+@@@",
-".@@+@@@+",
-".@+@#@+@",
-".+@#@+@#",
-".@$@+@$@",
-".$@+@$@+",
-".#+#$#+#",
-".+#$#+#$",
-".$$$+$$$",
-".$$$$$$$",
-"........"};
+"..",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".+",
+".."};
diff --git a/themes/curve/title-2-inactive.xpm b/themes/curve/title-2-inactive.xpm
index 5e436a9c6..a2b5d7e97 100644
--- a/themes/curve/title-2-inactive.xpm
+++ b/themes/curve/title-2-inactive.xpm
@@ -1,27 +1,27 @@
 /* XPM */
 static char * title_2_inactive_xpm[] = {
-"8 19 5 1",
+"2 19 5 1",
 " 	c None",
 ".	c #000000",
 "+	c #919191 s inactive_shadow_1",
 "@	c #FFFFFF s inactive_hilight_1",
 "#	c #E6E6E6 s inactive_color_1",
-"........",
-"#@@@@@@@",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"+#######",
-"++++++++"};
+"..",
+"#@",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"+#",
+"++"};
-- 
GitLab