]> Dogcows Code - chaz/tint2/commitdiff
add another padding parameter in config file, update documentation and sample config...
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Tue, 20 Jan 2009 21:16:54 +0000 (21:16 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Tue, 20 Jan 2009 21:16:54 +0000 (21:16 +0000)
24 files changed:
ChangeLog
doc/tint2-0.7.odt
doc/tint2-0.7.pdf
src/Makefile
src/clock/clock.c
src/clock/clock.h
src/config.c
src/panel.c
src/panel.h
src/systray/systraybar.c [new file with mode: 0644]
src/systray/systraybar.h [new file with mode: 0644]
src/taskbar/task.c
src/taskbar/task.h
src/taskbar/taskbar.c
src/taskbar/taskbar.h
src/tint.c
src/tint2
src/util/area.h
tintrc01
tintrc02
tintrc03
tintrc04 [deleted file]
tintrc05 [deleted file]
tintrc06

index 7e5d99126ac667ec88c23ef97ec45a55d22efb06..0ffd74fa9a5e8d9919bf70595547b6ddf66fc44e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
 
+2009-01-20
+- change config file format : add another padding parameter
+- update documentation and sample config file
+
 2009-01-19
 - patch from Robert Escriva, fixed tint2 on multi-monitor
 - fixed bug between MULTI_MONITOR mode and 'task on all desktop'
@@ -38,7 +42,7 @@
   user's background start with number 1, 2, ...
 
 2008-09-22
-- better control on icon opacity 
+- better control on icon opacity
   icon opacity use the same value as text opacity
 
 2008-09-21
 
 2008-09-19
 - improve clock drawing on 2 lines
-- new design : object oriented 
+- new design : object oriented
     clock inherit Area (with draw_background)
 - rename parameter 'panel_mode' in 'taskbar_mode'
 
 2008-09-17
 - change name from tint to tint2 because debian has already a package named tint
-- new design : object oriented 
+- new design : object oriented
     tasks inherit Area
     taskbars inherit Area
 
 2008-09-16
-- new design : object oriented 
+- new design : object oriented
     remove task_margin parameter, replaced by taskbar_padding
     fixed segfault with new layout
 
 2008-09-04
-- new design : object oriented 
+- new design : object oriented
   all objects inherit from Area : panel, taskbar, task, clock
 
 2008-09-02 licence changed to GPL V2
@@ -106,7 +110,7 @@ released tint-0.6
 - update documentation
 
 2008-07-04
-- changed in config file, panel_show_all_desktop 
+- changed in config file, panel_show_all_desktop
   replaced by panel_mode = single_desktop / multi_desktop / multi_monitor
 - with panel_mode = multi_monitor, tint show one taskbar by monitor
 
@@ -120,24 +124,24 @@ released tint-0.6
 2008-06-30 patch from goo...@dougbarton.us
 - tint wait for window manager on startup
 
-2008-06-29 
+2008-06-29
 - specify monitor with parameter 'panel_monitor'
 - panel_position is relative to your monitor
   panel_monitor = 1
   panel_position = bottom center
 
-2008-06-24 
+2008-06-24
 - fixed bug : show tint on all desktop with fluxbox
 
-2008-06-23 
+2008-06-23
 - task_width = 0 to get full taskbar width
 - added documentation in /doc
 
-2008-06-16 
+2008-06-16
 - renamed parameter panel_margin to panel_padding
 - added parameter panel_margin = vertical_margin horizontal_margin
 
-2008-06-15 
+2008-06-15
 - fixed bug : icon position changed when clock adjust width
 - removed boolean parameter panel_background and task_background
   replaced with opacity (alpha) = 0
@@ -145,51 +149,51 @@ released tint-0.6
   identical to task_border_width
 - fixed bug : draw task below panel border
 
-2008-06-11 
+2008-06-11
 - removed the need of desktop margin.
   tint specify margin to window magager (_NET_WM_STRUT)
 
-2008-06-10 
+2008-06-10
 - fixed bug : time/date vertical and horizontal center
 
 2008-06-10  patch from benjaminfranzke
 - fixed bug : draw icon on 64bit system.
 
-2008-06-08 
+2008-06-08
 - fixed bug : in draw border and fill background
 
-2008-06-04 
+2008-06-04
 - allow config file on the command line : tint -c ./tintrc2
 - allow 2 value in config file : key = value1 value2
 - panel_margin can get 2 values : vertical_margin horizontal_margin
   panel_margin = 8 4
 
-2008-05-30 
+2008-05-30
 - put panel below other window
 - set locale LANG
 
-2008-05-28 
+2008-05-28
 - clock_width adjust automatically
 - configure : time2_format see 'man strftime'
 
-2008-05-27 
+2008-05-27
 - configure : time1_format see 'man strftime'
 - cleanup code : refresh_pos()
 
-2008-05-26 
+2008-05-26
 - catch time event in main loop
 - draw clock fixed format %H:%M
 
-2008-05-24 
+2008-05-24
 - removed boolean parameter task_icon
   task_icon_size = 0 replace task_icon = 0
 - all colors parameters can get 2 values : color and opacity (alpha)
   font_color = #ffffff 70
 
-2008-05-23 
+2008-05-23
 - cpu optimisation : limit call to visual_refresh()
 
-2008-05-22 
+2008-05-22
 - configure clock : clock_font, clock_font_color
 
 
@@ -197,7 +201,7 @@ released tint-0.6
 2008-05-20  thil7 <lorthiois@bbsoft.fr>
 released tint-0.5
 
-2008-05-19 
+2008-05-19
 - improve usability in mode 'show_all_desktop'
   -> don't switch desktop when close a task of another desktop
   -> allow to drag and drop task between desktop
@@ -218,7 +222,7 @@ released tint-0.5
 2008-05-14  thil7 <lorthiois@bbsoft.fr>
 released tint-0.4
 
-2008-05-12 
+2008-05-12
 - boolean option 'show_all_desktop'
   0 : tint panel show one taskbar (from current desktop)
   1 : tint panel show all taskbars (from all desktops)
@@ -235,7 +239,7 @@ released tint-0.4
 2008-05-10  thil7 <lorthiois@bbsoft.fr>
 released tint-0.3
 
-2008-05-10 
+2008-05-10
 - manage events : 'send to desktop' and 'send to all desktop'
 - bug solved : 'close' action now send _NET_CLOSE_WINDOW
   so openoffice ask 'save document...' if needed
@@ -250,27 +254,27 @@ released tint-0.3
 2008-05-09  thil7 <lorthiois@bbsoft.fr>
 released tint-0.2
 
-2008-05-08 
+2008-05-08
 - panel : add rounded and border (color and alpha)
-- remove option 'panel_tasks_centered' 
+- remove option 'panel_tasks_centered'
 - user can configure mouse event on task
   (none, toggle, iconify, shade, close, toggle_iconify)
 
-2008-05-07 
-- cpu optimisation : resize_tasks only when add/remove task, 
+2008-05-07
+- cpu optimisation : resize_tasks only when add/remove task,
   compute pos_y at startup
 
-2008-05-04 
+2008-05-04
 - task width adjust when too many task
 
-2008-05-01 
+2008-05-01
 - task : add rounded and border (color and alpha)
 - panel position (left, right, center) thank to ak47izatool
 - cleanup code : vertical position (icon and text),
   better refresh after delete task, memory leak *font
 - panel : changed panel_margin and task_margin
 
-2008-04-22 
+2008-04-22
 - fork ttm projet from p://code.google.com/p/ttm/ (by Pål Staurland staura@gmail.com)
   while the projet is no longer in developpement, have not changed the name of 'tint'.
 
index 41dafe90270b8260e9d903f12485b7e5f2e99759..37a72fe818411e929892ce323a1fed000e29fe81 100644 (file)
Binary files a/doc/tint2-0.7.odt and b/doc/tint2-0.7.odt differ
index 988301d17c6a5c8c51941d9aa7f6f30331f42b41..81b3463db55f7083d1e60d0d5db57999e7e4199f 100644 (file)
Binary files a/doc/tint2-0.7.pdf and b/doc/tint2-0.7.pdf differ
index b0cd6c40b1c8ad7af7da7821d71663ece62a4f92..3b5d9feb87892a9beba92e32a1481a6b53b7fcb3 100644 (file)
@@ -2,7 +2,7 @@ CFLAGS= -O2
 CC = gcc
 FLAGS=-W -Wall -g `pkg-config --cflags --libs cairo pangocairo x11 xinerama imlib2 glib-2.0`
 PROGNAME=tint2
-FILES=tint.c server.c panel.c config.c taskbar/task.c taskbar/taskbar.c clock/clock.c systray/docker.c systray/icons.c systray/kde.c systray/net.c systray/xproperty.c util/window.c util/area.c
+FILES=tint.c server.c panel.c config.c taskbar/task.c taskbar/taskbar.c clock/clock.c systray/systraybar.c systray/docker.c systray/icons.c systray/kde.c systray/net.c systray/xproperty.c util/window.c util/area.c
 
 ifndef DESTDIR
        ifndef PREFIX
index 5fb6cb152ab4382d17efabb5f0c5d5ff504a5348..42cfd90f07ef5cfb8f003671bb80919311971f3d 100644 (file)
@@ -94,13 +94,13 @@ redraw:
    }
    if (time_width > date_width) new_width = time_width;
    else new_width = date_width;
-   new_width += (2*clock->area.paddingx) + (2*clock->area.pix.border.width);
+   new_width += (2*clock->area.paddingxlr) + (2*clock->area.pix.border.width);
 
    if (new_width > clock->area.width || (new_width != clock->area.width && date_width > time_width)) {
       //printf("clock_width %d, new_width %d\n", clock->area.width, new_width);
       // resize clock
       clock->area.width = new_width;
-      panel.clock.area.posx = panel.area.width - panel.clock.area.width - panel.area.paddingx - panel.area.pix.border.width;
+      panel.clock.area.posx = panel.area.width - panel.clock.area.width - panel.area.paddingxlr - panel.area.pix.border.width;
 
       g_object_unref (layout);
       resize_taskbar();
index b886d4a39882f550e4c47639a5370c9a7f06a938..246bb2e72ec7197b2d24f1eca1d7171a52c46f8d 100644 (file)
@@ -1,5 +1,7 @@
 /**************************************************************************
-* clock : 
+* Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr)
+*
+* clock :
 * - draw clock, adjust width
 *
 **************************************************************************/
index acb49e89ea65e78c40466c81d4a781af5993fb0a..56deba2194ea4b26b89c1fe662da21f73eed3170 100644 (file)
@@ -103,23 +103,43 @@ void copy_file(const char *pathSrc, const char *pathDest)
 }
 
 
-void extract_values (const char *value, char **value1, char **value2)
+void extract_values (const char *value, char **value1, char **value2, char **value3)
 {
-   char *b;
+   char *b, *c;
 
    if (*value1) free (*value1);
    if (*value2) free (*value2);
+   if (*value3) free (*value3);
 
-   if ((b = strchr (value, ' '))) {
+   if (b = strchr (value, ' ')) {
       b[0] = '\0';
       b++;
-      *value2 = strdup (b);
-      g_strstrip(*value2);
-   }
-   else *value2 = 0;
-
-   *value1 = strdup (value);
-   g_strstrip(*value1);
+       }
+       else {
+               b = 0;
+       *value2 = 0;
+       *value3 = 0;
+       }
+       *value1 = strdup (value);
+       g_strstrip(*value1);
+
+       if (b) {
+               if (c = strchr (b, ' ')) {
+                       c[0] = '\0';
+                       c++;
+               }
+               else {
+                       c = 0;
+                       *value3 = 0;
+               }
+               *value2 = strdup (b);
+               g_strstrip(*value2);
+       }
+
+       if (c) {
+               *value3 = strdup (c);
+               g_strstrip(*value3);
+       }
 }
 
 
@@ -194,7 +214,7 @@ void get_action (char *event, int *action)
 
 void add_entry (char *key, char *value)
 {
-   char *value1=0, *value2=0;
+   char *value1=0, *value2=0, *value3=0;
 
    /* Background and border */
    if (strcmp (key, "rounded") == 0) {
@@ -209,14 +229,14 @@ void add_entry (char *key, char *value)
    }
    else if (strcmp (key, "background_color") == 0) {
       Area *a = g_slist_last(list_back)->data;
-      extract_values(value, &value1, &value2);
+      extract_values(value, &value1, &value2, &value3);
       get_color (value1, a->pix.back.color);
       if (value2) a->pix.back.alpha = (atoi (value2) / 100.0);
       else a->pix.back.alpha = 0.5;
    }
    else if (strcmp (key, "border_color") == 0) {
       Area *a = g_slist_last(list_back)->data;
-      extract_values(value, &value1, &value2);
+      extract_values(value, &value1, &value2, &value3);
       get_color (value1, a->pix.border.color);
       if (value2) a->pix.border.alpha = (atoi (value2) / 100.0);
       else a->pix.border.alpha = 0.5;
@@ -228,22 +248,23 @@ void add_entry (char *key, char *value)
       if (panel.monitor > 0) panel.monitor -= 1;
    }
    else if (strcmp (key, "panel_size") == 0) {
-      extract_values(value, &value1, &value2);
+      extract_values(value, &value1, &value2, &value3);
       panel.area.width = atoi (value1);
       if (value2) panel.area.height = atoi (value2);
    }
    else if (strcmp (key, "panel_margin") == 0) {
-      extract_values(value, &value1, &value2);
+      extract_values(value, &value1, &value2, &value3);
       panel.marginx = atoi (value1);
       if (value2) panel.marginy = atoi (value2);
    }
    else if (strcmp (key, "panel_padding") == 0) {
-      extract_values(value, &value1, &value2);
-      panel.area.paddingx = atoi (value1);
+      extract_values(value, &value1, &value2, &value3);
+      panel.area.paddingxlr = panel.area.paddingx = atoi (value1);
       if (value2) panel.area.paddingy = atoi (value2);
+      if (value3) panel.area.paddingx = atoi (value3);
    }
    else if (strcmp (key, "panel_position") == 0) {
-      extract_values(value, &value1, &value2);
+      extract_values(value, &value1, &value2, &value3);
       if (strcmp (value1, "top") == 0) panel.position = TOP;
       else panel.position = BOTTOM;
 
@@ -285,15 +306,16 @@ void add_entry (char *key, char *value)
       panel.clock.time2_font_desc = pango_font_description_from_string (value);
    }
    else if (strcmp (key, "clock_font_color") == 0) {
-      extract_values(value, &value1, &value2);
+      extract_values(value, &value1, &value2, &value3);
       get_color (value1, panel.clock.font.color);
       if (value2) panel.clock.font.alpha = (atoi (value2) / 100.0);
       else panel.clock.font.alpha = 0.1;
    }
    else if (strcmp (key, "clock_padding") == 0) {
-      extract_values(value, &value1, &value2);
-      panel.clock.area.paddingx = atoi (value1);
+      extract_values(value, &value1, &value2, &value3);
+      panel.clock.area.paddingxlr = panel.clock.area.paddingx = atoi (value1);
       if (value2) panel.clock.area.paddingy = atoi (value2);
+      if (value3) panel.clock.area.paddingx = atoi (value3);
    }
    else if (strcmp (key, "clock_background_id") == 0) {
       int id = atoi (value);
@@ -309,9 +331,10 @@ void add_entry (char *key, char *value)
       else panel.mode = SINGLE_DESKTOP;
    }
    else if (strcmp (key, "taskbar_padding") == 0) {
-      extract_values(value, &value1, &value2);
-      g_taskbar.paddingx = atoi (value1);
+      extract_values(value, &value1, &value2, &value3);
+      g_taskbar.paddingxlr = g_taskbar.paddingx = atoi (value1);
       if (value2) g_taskbar.paddingy = atoi (value2);
+      if (value3) g_taskbar.paddingx = atoi (value3);
    }
    else if (strcmp (key, "taskbar_background_id") == 0) {
       int id = atoi (value);
@@ -330,24 +353,23 @@ void add_entry (char *key, char *value)
    else if (strcmp (key, "task_width") == 0)
       g_task.maximum_width = atoi (value);
    else if (strcmp (key, "task_padding") == 0) {
-      extract_values(value, &value1, &value2);
-      g_task.area.paddingx = atoi (value1);
-      if (value2) {
-         g_task.area.paddingy = atoi (value2);
-      }
+      extract_values(value, &value1, &value2, &value3);
+      g_task.area.paddingxlr = g_task.area.paddingx = atoi (value1);
+      if (value2) g_task.area.paddingy = atoi (value2);
+      if (value3) g_task.area.paddingx = atoi (value3);
    }
    else if (strcmp (key, "task_font") == 0) {
       if (g_task.font_desc) pango_font_description_free(g_task.font_desc);
       g_task.font_desc = pango_font_description_from_string (value);
    }
    else if (strcmp (key, "task_font_color") == 0) {
-      extract_values(value, &value1, &value2);
+      extract_values(value, &value1, &value2, &value3);
       get_color (value1, g_task.font.color);
       if (value2) g_task.font.alpha = (atoi (value2) / 100.0);
       else g_task.font.alpha = 0.1;
    }
    else if (strcmp (key, "task_active_font_color") == 0) {
-      extract_values(value, &value1, &value2);
+      extract_values(value, &value1, &value2, &value3);
       get_color (value1, g_task.font_active.color);
       if (value2) g_task.font_active.alpha = (atoi (value2) / 100.0);
       else g_task.font_active.alpha = 0.1;
@@ -427,6 +449,7 @@ void add_entry (char *key, char *value)
 
    if (value1) free (value1);
    if (value2) free (value2);
+   if (value3) free (value3);
 }
 
 
@@ -556,7 +579,7 @@ void config_finish ()
    g_task.text_posy = (g_task.area.height - height) / 2.0;
 
    // add task_icon_size
-   g_task.text_posx = g_task.area.paddingx + g_task.area.pix.border.width;
+   g_task.text_posx = g_task.area.paddingxlr + g_task.area.pix.border.width;
    if (g_task.icon) {
       g_task.icon_size1 = g_task.area.height - (2 * g_task.area.paddingy);
       g_task.text_posx += g_task.icon_size1;
index 71802e6db76699890d1d570f75df2ce3e992527c..b5be1a234563a593d8650cbacc4889e1fc3a4fda 100644 (file)
@@ -45,7 +45,7 @@ void visual_refresh ()
       refresh (l->data);
 
    // main_win doesn't include panel.area.paddingx, so we have WM capabilities on left and right.
-   XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, panel.area.paddingx, 0, panel.area.width-(2*panel.area.paddingx), panel.area.height, 0, 0);
+   XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, panel.area.paddingxlr, 0, panel.area.width-(2*panel.area.paddingxlr), panel.area.height, 0, 0);
    XFlush (server.dsp);
    panel.refresh = 0;
 }
@@ -129,7 +129,7 @@ void window_draw_panel ()
    // XCreateWindow(display, parent, x, y, w, h, border, depth, class, visual, mask, attrib)
    // main_win doesn't include panel.area.paddingx, so we have WM capabilities on left and right.
    if (window.main_win) XDestroyWindow(server.dsp, window.main_win);
-   win = XCreateWindow (server.dsp, server.root_win, server.posx+panel.area.paddingx, server.posy, panel.area.width-(2*panel.area.paddingx), panel.area.height, 0, server.depth, InputOutput, CopyFromParent, CWEventMask, &att);
+   win = XCreateWindow (server.dsp, server.root_win, server.posx+panel.area.paddingxlr, server.posy, panel.area.width-(2*panel.area.paddingxlr), panel.area.height, 0, server.depth, InputOutput, CopyFromParent, CWEventMask, &att);
 
    set_panel_properties (win);
    window.main_win = win;
index 4a3e245622be0341366351f68017119d81d49a56..79fb625e38a5312ee5b44c6ae7995af6877c2e9a 100644 (file)
@@ -1,8 +1,10 @@
 /**************************************************************************
-* panel : 
+* Copyright (C) 2008 Pål Staurland (staura@gmail.com)
+* Modified (C) 2008/2009 thierry lorthiois (lorthiois@bbsoft.fr)
+*
+* panel :
 * - draw panel and all objects according to panel_layout
-* 
-* Check COPYING file for Copyright
+*
 *
 **************************************************************************/
 
@@ -16,6 +18,7 @@
 #include "clock.h"
 #include "task.h"
 #include "taskbar.h"
+#include "systraybar.h"
 
 
 //panel mode
@@ -54,13 +57,14 @@ typedef struct {
    int nb_monitor;
    Task *task_active;
    Task *task_drag;
-   
+
    // --------------------------------------------------
    // clock
    Clock clock;
 
    // --------------------------------------------------
    // systray
+   Systraybar systraybar;
 
    // --------------------------------------------------
    // mouse events
diff --git a/src/systray/systraybar.c b/src/systray/systraybar.c
new file mode 100644 (file)
index 0000000..9fd7083
--- /dev/null
@@ -0,0 +1,80 @@
+/**************************************************************************
+* Tint2 : systraybar
+*
+* Copyright (C) 2009 thierry lorthiois (lorthiois@bbsoft.fr)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License version 2
+* as published by the Free Software Foundation.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+**************************************************************************/
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <glib.h>
+#include <Imlib2.h>
+
+#include "systraybar.h"
+#include "server.h"
+#include "window.h"
+#include "panel.h"
+
+
+
+int resize_systray (Systraybar *sysbar)
+{
+   return 0;
+}
+
+/*
+// initialise taskbar posx and width
+void resize_taskbar()
+{
+   int taskbar_width, modulo_width, taskbar_on_screen;
+
+   if (panel.mode == MULTI_DESKTOP) taskbar_on_screen = panel.nb_desktop;
+   else taskbar_on_screen = panel.nb_monitor;
+
+   taskbar_width = panel.area.width - (2 * panel.area.paddingx) - (2 * panel.area.pix.border.width);
+   if (panel.clock.time1_format)
+      taskbar_width -= (panel.clock.area.width + panel.area.paddingx);
+   taskbar_width = (taskbar_width - ((taskbar_on_screen-1) * panel.area.paddingx)) / taskbar_on_screen;
+
+   if (taskbar_on_screen > 1)
+      modulo_width = (taskbar_width - ((taskbar_on_screen-1) * panel.area.paddingx)) % taskbar_on_screen;
+   else
+      modulo_width = 0;
+
+   int i, nb, modulo=0, posx=0;
+   nb = panel.nb_desktop * panel.nb_monitor;
+   for (i=0 ; i < nb ; i++) {
+      if ((i % taskbar_on_screen) == 0) {
+         posx = panel.area.pix.border.width + panel.area.paddingx;
+         modulo = modulo_width;
+      }
+      else posx += taskbar_width + panel.area.paddingx;
+
+      panel.taskbar[i].area.posx = posx;
+      panel.taskbar[i].area.width = taskbar_width;
+      if (modulo) {
+         panel.taskbar[i].area.width++;
+         modulo--;
+      }
+
+      resize_tasks(&panel.taskbar[i]);
+   }
+}
+*/
+
+
diff --git a/src/systray/systraybar.h b/src/systray/systraybar.h
new file mode 100644 (file)
index 0000000..7fd8c9e
--- /dev/null
@@ -0,0 +1,32 @@
+/**************************************************************************
+* Copyright (C) 2009 thierry lorthiois (lorthiois@bbsoft.fr)
+*
+* systraybar
+*
+**************************************************************************/
+
+#ifndef SYSTRAYBAR_H
+#define SYSTRAYBAR_H
+
+#include "area.h"
+
+
+typedef struct {
+   // always start with area
+   Area area;
+
+} Systraybar;
+
+
+// --------------------------------------------------
+// global taskbar parameter
+Area g_systraybar;
+
+
+// return 1 if task_width changed
+int resize_systray (Systraybar *sysbar);
+
+
+
+#endif
+
index aaebcbf24f40ca32d9ad5f3693ff69b77a32841c..0aeb45ef18b2d6fe3547eab900b193f34edfa05c 100644 (file)
@@ -63,7 +63,7 @@ deb:
    get_icon(new_tsk);
    get_title(new_tsk);
    memcpy(&new_tsk->area, &g_task.area, sizeof(Area));
-   
+
    //printf("task %s : desktop %d, monitor %d\n", new_tsk->title, desktop, monitor);
    XSelectInput (server.dsp, new_tsk->win, PropertyChangeMask|StructureNotifyMask);
 
@@ -85,14 +85,14 @@ deb:
 void remove_task (Task *tsk)
 {
    if (!tsk) return;
-   
+
    Task *tsk2 = tsk;
    Taskbar *tskbar;
    Window win = tsk->win;
    int desktop = 0, all_desktop = tsk->all_desktop;
    int monitor = ((Taskbar*)tsk->area.parent)->monitor;
-   
-deb:   
+
+deb:
    if (all_desktop) {
       tskbar = &panel.taskbar[index(desktop, monitor)];
       GSList *l0;
@@ -103,28 +103,28 @@ deb:
             break;
       }
    }
-   else 
+   else
       tskbar = (Taskbar*)tsk->area.parent;
-   
+
    tskbar->area.list = g_slist_remove(tskbar->area.list, tsk2);
    resize_tasks (tskbar);
    set_redraw (&tskbar->area);
    //printf("remove_task %d  %s\n", index(tskbar->desktop, tskbar->monitor), tsk->title);
 
-   if (tsk2 == panel.task_active) 
+   if (tsk2 == panel.task_active)
        panel.task_active = 0;
-   if (tsk2 == panel.task_drag) 
+   if (tsk2 == panel.task_drag)
        panel.task_drag = 0;
 
-   if (tsk2->title) 
+   if (tsk2->title)
       free (tsk2->title);
-   if (tsk2->icon_data) 
+   if (tsk2->icon_data)
       free (tsk2->icon_data);
 
    XFreePixmap (server.dsp, tsk2->area.pix.pmap);
    XFreePixmap (server.dsp, tsk2->area.pix_active.pmap);
    free(tsk2);
-   
+
    if (all_desktop) {
       desktop++;
       if (desktop < server.nb_desktop)
@@ -214,7 +214,7 @@ void draw_task_icon (Task *tsk, int text_width, int active)
       else
          pos_x = (tsk->area.width - g_task.icon_size1) / 2;
    }
-   else pos_x = g_task.area.paddingx + g_task.area.pix.border.width;
+   else pos_x = g_task.area.paddingxlr + g_task.area.pix.border.width;
 
    /* Render */
    Imlib_Image icon;
index 2948906372b584a646402b2b397a001badebedcc..e99c577e14e18773ec0098a49093525c35f4a3ab 100644 (file)
@@ -34,8 +34,6 @@ typedef struct {
 
 
 
-// --------------------------------------------------
-// task parameter
 typedef struct {
    // always start with area
    Area area;
index fe2383c19086bfeeb7579758073296524113e0e5..7a2bb3f6c6d0a2d1e9b959709913818317eb8afc 100644 (file)
@@ -43,7 +43,7 @@ Task *task_get_task (Window win)
    for (i=0 ; i < nb ; i++) {
       for (l0 = panel.taskbar[i].area.list; l0 ; l0 = l0->next) {
          tsk = l0->data;
-         if (win == tsk->win) 
+         if (win == tsk->win)
             return tsk;
       }
    }
@@ -109,7 +109,8 @@ int resize_tasks (Taskbar *taskbar)
    task_count = g_slist_length(taskbar->area.list);
    if (!task_count) pixel_width = g_task.maximum_width;
    else {
-      taskbar_width = taskbar->area.width - (2 * g_taskbar.pix.border.width) - ((task_count+1) * g_taskbar.paddingx);
+      taskbar_width = taskbar->area.width - (2 * g_taskbar.pix.border.width) - (2 * g_taskbar.paddingxlr);
+      if (task_count>1) taskbar_width -= ((task_count-1) * g_taskbar.paddingx);
 
       pixel_width = taskbar_width / task_count;
       if (pixel_width > g_task.maximum_width) pixel_width = g_task.maximum_width;
@@ -127,7 +128,7 @@ int resize_tasks (Taskbar *taskbar)
    }
 
    // change pos_x and width for all tasks
-   x = taskbar->area.posx + taskbar->area.pix.border.width + taskbar->area.paddingx;
+   x = taskbar->area.posx + taskbar->area.pix.border.width + taskbar->area.paddingxlr;
    for (l = taskbar->area.list; l ; l = l->next) {
       tsk = l->data;
       tsk->area.posx = x;
@@ -151,7 +152,7 @@ void resize_taskbar()
    if (panel.mode == MULTI_DESKTOP) taskbar_on_screen = panel.nb_desktop;
    else taskbar_on_screen = panel.nb_monitor;
 
-   taskbar_width = panel.area.width - (2 * panel.area.paddingx) - (2 * panel.area.pix.border.width);
+   taskbar_width = panel.area.width - (2 * panel.area.paddingxlr) - (2 * panel.area.pix.border.width);
    if (panel.clock.time1_format)
       taskbar_width -= (panel.clock.area.width + panel.area.paddingx);
    taskbar_width = (taskbar_width - ((taskbar_on_screen-1) * panel.area.paddingx)) / taskbar_on_screen;
@@ -165,7 +166,7 @@ void resize_taskbar()
    nb = panel.nb_desktop * panel.nb_monitor;
    for (i=0 ; i < nb ; i++) {
       if ((i % taskbar_on_screen) == 0) {
-         posx = panel.area.pix.border.width + panel.area.paddingx;
+         posx = panel.area.pix.border.width + panel.area.paddingxlr;
          modulo = modulo_width;
       }
       else posx += taskbar_width + panel.area.paddingx;
index b35c60ff114b3172688685663f8463a20788008c..597f44164b4e77e9d40ef828ff4f7e2e48a36ecb 100644 (file)
@@ -1,3 +1,9 @@
+/**************************************************************************
+* Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr)
+*
+* taskbar
+*
+**************************************************************************/
 
 #ifndef TASKBAR_H
 #define TASKBAR_H
 #include "task.h"
 
 
-// --------------------------------------------------
-// taskbar parameter
 typedef struct {
    // always start with area
    Area area;
 
    int desktop;
    int monitor;
-   
+
    // task parameters
    int task_width;
    int task_modulo;
index e64f8d90cfed4df81b5723f4569c31f71d418d1a..9ff04fc2cf5363dab6764ba059498eb4b27ddb6d 100644 (file)
@@ -471,7 +471,7 @@ load_config:
 
                case Expose:
                   XCopyArea (server.dsp, panel.area.pix.pmap, server.root_win, server.gc_root, 0, 0, panel.area.width, panel.area.height, server.posx, server.posy);
-                  XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, panel.area.paddingx, 0, panel.area.width-(2*panel.area.paddingx), panel.area.height, 0, 0);
+                  XCopyArea (server.dsp, server.pmap, window.main_win, server.gc, panel.area.paddingxlr, 0, panel.area.width-(2*panel.area.paddingxlr), panel.area.height, 0, 0);
                   break;
 
                case PropertyNotify:
index e441bf4db03df8bc8c13e935c233b1c77f0fea82..93633b27f16b0640e58c2ba1a517f7a99d4c644f 100755 (executable)
Binary files a/src/tint2 and b/src/tint2 differ
index 0294353e2571c640cbf3ef4e6bf05327a1874a15..29adf966df7b6ac6147d01fcda7cff0e76f43054 100644 (file)
@@ -75,7 +75,9 @@ typedef struct {
    // need redraw Pixmap
    int redraw;
    int use_active, is_active;
-   int paddingx, paddingy;
+   // paddingxlr = horizontal padding left/right
+   // paddingx = horizontal padding between childs
+   int paddingxlr, paddingx, paddingy;
    // parent Area
    void *parent;
 
index f616c4da63e31ae6b83257c33027d5154612c410..7555b528afae305d941cfe0af31a1f610f2d7919 100644 (file)
--- a/tintrc01
+++ b/tintrc01
@@ -46,7 +46,7 @@ task_text = 1
 task_width = 130
 task_centered = 1
 task_padding = 4 2
-task_font = sans 7
+task_font = sans 8
 task_font_color = #ffffff 65
 task_active_font_color = #ffffff 85
 task_background_id = 2
index bd826acaa4e3841848578031f813f3690d8aab86..04dc7ea3936168185dbb6004e3a39808e287f445 100644 (file)
--- a/tintrc02
+++ b/tintrc02
@@ -8,44 +8,49 @@
 rounded = 1
 border_width = 0 
 background_color = #282828 40
-border_color = #000000 40
+border_color = #000000 0
 
 rounded = 1
 border_width = 1
-background_color = #282828 0
+background_color = #cccccc 0
+border_color = #cccccc 30
+
+rounded = 1
+border_width = 0
+background_color = #cccccc 20
 border_color = #cccccc 40
 
 #---------------------------------------------
 # PANEL
 #---------------------------------------------
 panel_monitor = 1
-panel_position = bottom left
+panel_position = top left
 panel_size = 0 27
 panel_margin = 0 0
-panel_padding = 4 0
+panel_padding = 7 3 7
 font_shadow = 0
 panel_background_id = 1
 
 #---------------------------------------------
 # TASKBAR
 #---------------------------------------------
-taskbar_mode = multi_monitor
-taskbar_padding = 4 0
-taskbar_background_id = 0
+taskbar_mode = multi_desktop
+taskbar_padding = 0 0 0
+taskbar_background_id = 2
 
 #---------------------------------------------
 # TASKS
 #---------------------------------------------
 task_icon = 1
 task_text = 0
-task_width = 30
+task_width = 35
 task_centered = 1
-task_padding = 2 5
+task_padding = 2 1
 task_font = sans 8
 task_font_color = #ffffff 60
 task_active_font_color = #ffffff 100
 task_background_id = 0
-task_active_background_id = 2
+task_active_background_id = 3
 
 #---------------------------------------------
 # SYSTRAY
index 0106f89400a5bd00bc4116ad9bc2223314f28766..4a27348ed14ef3dcf393eb3edb84d1aaa33fd63d 100644 (file)
--- a/tintrc03
+++ b/tintrc03
@@ -24,18 +24,18 @@ border_color = #d1d1d1 14
 # PANEL
 #---------------------------------------------
 panel_monitor = 1
-panel_position = bottom center
+panel_position = top center
 panel_size = 1000 25
 panel_margin = 0 7
-panel_padding = 6 0
+panel_padding = 7 3 0
 font_shadow = 0
 panel_background_id = 1
 
 #---------------------------------------------
 # TASKBAR
 #---------------------------------------------
-taskbar_mode = multi_desktop
-taskbar_padding = 2 3
+taskbar_mode = single_desktop
+taskbar_padding = 0 0 0
 taskbar_background_id = 0
 
 #---------------------------------------------
@@ -45,7 +45,7 @@ task_icon = 1
 task_text = 1
 task_width = 150
 task_centered = 1
-task_padding = 3 2
+task_padding = 2 1
 task_font = myriad pro 8
 task_font_color = #000000 70
 task_active_font_color = #000000 100
@@ -66,7 +66,7 @@ time1_font = sans bold 12
 #time2_format = %A %d %B
 #time2_font = sans bold 10
 clock_font_color = #000000 70
-clock_padding = 6 0
+clock_padding = 4 0
 clock_background_id = 0
 
 #---------------------------------------------
diff --git a/tintrc04 b/tintrc04
deleted file mode 100644 (file)
index 5c7378b..0000000
--- a/tintrc04
+++ /dev/null
@@ -1,74 +0,0 @@
-#---------------------------------------------
-# TINT CONFIG FILE
-#---------------------------------------------
-
-#---------------------------------------------
-# BACKGROUND AND BORDER
-#---------------------------------------------
-rounded = 3
-border_width = 1
-background_color = #3c3020 90
-border_color = #3c3020 90
-
-rounded = 3
-border_width = 1
-background_color = #3c3020 90
-border_color = #ffffff 30
-
-#---------------------------------------------
-# PANEL
-#---------------------------------------------
-panel_monitor = 1
-panel_position = bottom center
-panel_size = 900 30
-panel_margin = 0 0
-panel_padding = 10 2
-font_shadow = 0
-panel_background_id = 0
-
-#---------------------------------------------
-# TASKBAR
-#---------------------------------------------
-taskbar_mode = single_desktop
-taskbar_padding = 9 0
-taskbar_background_id = 0
-
-#---------------------------------------------
-# TASKS
-#---------------------------------------------
-task_icon = 0
-task_text = 1
-task_width = 190
-task_centered = 1
-task_padding = 2 0
-task_font = sans 8.4
-task_font_color = #ececec 50
-task_active_font_color = #ffffff 90
-task_background_id = 1
-task_active_background_id = 2
-
-#---------------------------------------------
-# SYSTRAY
-#---------------------------------------------
-#systray_padding = 9 3
-#systray_background_id = 0
-
-#---------------------------------------------
-# CLOCK
-#---------------------------------------------
-time1_format = %H:%M
-time1_font = sans bold 8
-time2_format = %A %d %B
-time2_font = sans 7
-clock_font_color = #ececec 50
-clock_padding = 4 0
-clock_background_id = 1
-
-#---------------------------------------------
-# MOUSE ACTION ON TASK
-#---------------------------------------------
-mouse_middle = none
-mouse_right = close
-mouse_scroll_up = toggle
-mouse_scroll_down = iconify
-
diff --git a/tintrc05 b/tintrc05
deleted file mode 100644 (file)
index 5c7378b..0000000
--- a/tintrc05
+++ /dev/null
@@ -1,74 +0,0 @@
-#---------------------------------------------
-# TINT CONFIG FILE
-#---------------------------------------------
-
-#---------------------------------------------
-# BACKGROUND AND BORDER
-#---------------------------------------------
-rounded = 3
-border_width = 1
-background_color = #3c3020 90
-border_color = #3c3020 90
-
-rounded = 3
-border_width = 1
-background_color = #3c3020 90
-border_color = #ffffff 30
-
-#---------------------------------------------
-# PANEL
-#---------------------------------------------
-panel_monitor = 1
-panel_position = bottom center
-panel_size = 900 30
-panel_margin = 0 0
-panel_padding = 10 2
-font_shadow = 0
-panel_background_id = 0
-
-#---------------------------------------------
-# TASKBAR
-#---------------------------------------------
-taskbar_mode = single_desktop
-taskbar_padding = 9 0
-taskbar_background_id = 0
-
-#---------------------------------------------
-# TASKS
-#---------------------------------------------
-task_icon = 0
-task_text = 1
-task_width = 190
-task_centered = 1
-task_padding = 2 0
-task_font = sans 8.4
-task_font_color = #ececec 50
-task_active_font_color = #ffffff 90
-task_background_id = 1
-task_active_background_id = 2
-
-#---------------------------------------------
-# SYSTRAY
-#---------------------------------------------
-#systray_padding = 9 3
-#systray_background_id = 0
-
-#---------------------------------------------
-# CLOCK
-#---------------------------------------------
-time1_format = %H:%M
-time1_font = sans bold 8
-time2_format = %A %d %B
-time2_font = sans 7
-clock_font_color = #ececec 50
-clock_padding = 4 0
-clock_background_id = 1
-
-#---------------------------------------------
-# MOUSE ACTION ON TASK
-#---------------------------------------------
-mouse_middle = none
-mouse_right = close
-mouse_scroll_up = toggle
-mouse_scroll_down = iconify
-
index 9cc94bbadb1a2fb1ce19aa912fbadfd6e432bb4f..72307966fa136660d5ac3c177a26096d409a3ee2 100644 (file)
--- a/tintrc06
+++ b/tintrc06
@@ -25,10 +25,10 @@ border_color = #ffffff 0
 # PANEL
 #---------------------------------------------
 panel_monitor = 1
-panel_position = bottom left
+panel_position = top left
 panel_size = 0 30
 panel_margin = 0 0
-panel_padding = 11 2
+panel_padding = 9 2 7
 font_shadow = 0
 panel_background_id = 0
 
@@ -36,7 +36,7 @@ panel_background_id = 0
 # TASKBAR
 #---------------------------------------------
 taskbar_mode = multi_desktop
-taskbar_padding = 3 3
+taskbar_padding = 3 3 0
 taskbar_background_id = 1
 
 #---------------------------------------------
@@ -67,7 +67,7 @@ time1_format = %A %d %H:%M
 time1_font = sans bold 8
 #time2_format = %A %d %B
 time2_font = sans 7
-clock_font_color = #ffffff 59
+clock_font_color = #ffffff 65
 clock_padding = 6 0
 clock_background_id = 1
 
This page took 0.053976 seconds and 4 git commands to generate.