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:
@@ -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;
|
||||
|
||||
@@ -34,8 +34,6 @@ typedef struct {
|
||||
|
||||
|
||||
|
||||
// --------------------------------------------------
|
||||
// task parameter
|
||||
typedef struct {
|
||||
// always start with area
|
||||
Area area;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/**************************************************************************
|
||||
* Copyright (C) 2008 thierry lorthiois (lorthiois@bbsoft.fr)
|
||||
*
|
||||
* taskbar
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef TASKBAR_H
|
||||
#define TASKBAR_H
|
||||
@@ -5,15 +11,13 @@
|
||||
#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;
|
||||
|
||||
Reference in New Issue
Block a user