]> Dogcows Code - chaz/tint2/blob - src/systray/systraybar.c
add another padding parameter in config file, update documentation and sample config...
[chaz/tint2] / src / systray / systraybar.c
1 /**************************************************************************
2 * Tint2 : systraybar
3 *
4 * Copyright (C) 2009 thierry lorthiois (lorthiois@bbsoft.fr)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 **************************************************************************/
18
19 #include <X11/Xlib.h>
20 #include <X11/Xutil.h>
21 #include <X11/Xatom.h>
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <glib.h>
26 #include <Imlib2.h>
27
28 #include "systraybar.h"
29 #include "server.h"
30 #include "window.h"
31 #include "panel.h"
32
33
34
35 int resize_systray (Systraybar *sysbar)
36 {
37 return 0;
38 }
39
40 /*
41 // initialise taskbar posx and width
42 void resize_taskbar()
43 {
44 int taskbar_width, modulo_width, taskbar_on_screen;
45
46 if (panel.mode == MULTI_DESKTOP) taskbar_on_screen = panel.nb_desktop;
47 else taskbar_on_screen = panel.nb_monitor;
48
49 taskbar_width = panel.area.width - (2 * panel.area.paddingx) - (2 * panel.area.pix.border.width);
50 if (panel.clock.time1_format)
51 taskbar_width -= (panel.clock.area.width + panel.area.paddingx);
52 taskbar_width = (taskbar_width - ((taskbar_on_screen-1) * panel.area.paddingx)) / taskbar_on_screen;
53
54 if (taskbar_on_screen > 1)
55 modulo_width = (taskbar_width - ((taskbar_on_screen-1) * panel.area.paddingx)) % taskbar_on_screen;
56 else
57 modulo_width = 0;
58
59 int i, nb, modulo=0, posx=0;
60 nb = panel.nb_desktop * panel.nb_monitor;
61 for (i=0 ; i < nb ; i++) {
62 if ((i % taskbar_on_screen) == 0) {
63 posx = panel.area.pix.border.width + panel.area.paddingx;
64 modulo = modulo_width;
65 }
66 else posx += taskbar_width + panel.area.paddingx;
67
68 panel.taskbar[i].area.posx = posx;
69 panel.taskbar[i].area.width = taskbar_width;
70 if (modulo) {
71 panel.taskbar[i].area.width++;
72 modulo--;
73 }
74
75 resize_tasks(&panel.taskbar[i]);
76 }
77 }
78 */
79
80
This page took 0.037426 seconds and 5 git commands to generate.