]>
Dogcows Code - chaz/tint2/blob - src/systray/systraybar.c
9fd70832a526eb5567404fbb9df107fadd5249ab
1 /**************************************************************************
4 * Copyright (C) 2009 thierry lorthiois (lorthiois@bbsoft.fr)
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.
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 **************************************************************************/
20 #include <X11/Xutil.h>
21 #include <X11/Xatom.h>
28 #include "systraybar.h"
35 int resize_systray (Systraybar
*sysbar
)
41 // initialise taskbar posx and width
44 int taskbar_width, modulo_width, taskbar_on_screen;
46 if (panel.mode == MULTI_DESKTOP) taskbar_on_screen = panel.nb_desktop;
47 else taskbar_on_screen = panel.nb_monitor;
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;
54 if (taskbar_on_screen > 1)
55 modulo_width = (taskbar_width - ((taskbar_on_screen-1) * panel.area.paddingx)) % taskbar_on_screen;
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;
66 else posx += taskbar_width + panel.area.paddingx;
68 panel.taskbar[i].area.posx = posx;
69 panel.taskbar[i].area.width = taskbar_width;
71 panel.taskbar[i].area.width++;
75 resize_tasks(&panel.taskbar[i]);
This page took 0.039863 seconds and 4 git commands to generate.