tint2 & tint2conf: Use spacing in task_padding

This commit is contained in:
o9000
2015-04-26 15:16:24 +02:00
parent afd4a806a6
commit 95fa0bbf83
5 changed files with 28 additions and 16 deletions

View File

@@ -193,18 +193,14 @@ int get_title(Task *tsk)
name = server_get_property (tsk->win, server.atom._NET_WM_NAME, server.atom.UTF8_STRING, 0);
if (!name || !strlen(name)) {
name = server_get_property (tsk->win, server.atom.WM_NAME, XA_STRING, 0);
if (!name || !strlen(name)) {
name = calloc(10, 1);
strcpy(name, "Untitled");
}
}
}
// add space before title
title = calloc(strlen(name)+2, 1);
if (panel->g_task.icon) strcpy(title, " ");
else title[0] = 0;
strcat(title, name);
if (name && strlen(name)) {
title = strdup(name);
} else {
title = strdup("Untitled");
}
if (name) XFree (name);
if (tsk->title) {

View File

@@ -239,7 +239,7 @@ void init_taskbar_panel(void *p)
panel->g_task.text_height = panel->g_task.area.height - (2 * panel->g_task.area.paddingy);
if (panel->g_task.icon) {
panel->g_task.icon_size1 = panel->g_task.area.height - (2 * panel->g_task.area.paddingy);
panel->g_task.text_posx += panel->g_task.icon_size1;
panel->g_task.text_posx += panel->g_task.icon_size1 + panel->g_task.area.paddingx;
panel->g_task.icon_posy = (panel->g_task.area.height - panel->g_task.icon_size1) / 2;
}
//printf("monitor %d, task_maximum_width %d\n", panel->monitor, panel->g_task.maximum_width);
@@ -342,12 +342,12 @@ int resize_taskbar(void *obj)
break;
}
}
taskbar->text_width = text_width - panel->g_task.text_posx - panel->g_task.area.bg->border.width - panel->g_task.area.paddingx;
taskbar->text_width = text_width - panel->g_task.text_posx - panel->g_task.area.bg->border.width - panel->g_task.area.paddingxlr;
}
else {
resize_by_layout(obj, panel->g_task.maximum_height);
taskbar->text_width = taskbar->area.width - (2 * panel->g_taskbar.area.paddingy) - panel->g_task.text_posx - panel->g_task.area.bg->border.width - panel->g_task.area.paddingx;
taskbar->text_width = taskbar->area.width - (2 * panel->g_taskbar.area.paddingy) - panel->g_task.text_posx - panel->g_task.area.bg->border.width - panel->g_task.area.paddingxlr;
}
return 0;
}