add another padding parameter in config file, update documentation and sample config file
git-svn-id: http://tint2.googlecode.com/svn/trunk@28 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
80
src/systray/systraybar.c
Normal file
80
src/systray/systraybar.c
Normal file
@@ -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]);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
32
src/systray/systraybar.h
Normal file
32
src/systray/systraybar.h
Normal file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user