vertical panel done
git-svn-id: http://tint2.googlecode.com/svn/trunk@124 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
@@ -59,22 +59,20 @@ void init_systray()
|
||||
systray.area.panel = panel;
|
||||
systray.area._draw_foreground = draw_systray;
|
||||
systray.area._resize = resize_systray;
|
||||
systray.area.resize = 1;
|
||||
systray.area.redraw = 1;
|
||||
refresh_systray = 0;
|
||||
|
||||
// configure systray
|
||||
// draw only one systray (even with multi panel)
|
||||
systray.area.posy = panel->area.pix.border.width + panel->area.paddingy;
|
||||
systray.area.height = panel->area.height - (2 * systray.area.posy);
|
||||
systray.area.width = 0;
|
||||
systray.area.redraw = 1;
|
||||
|
||||
systray.area.posx = panel->area.width - panel->area.paddingxlr - panel->area.pix.border.width - systray.area.width;
|
||||
if (panel->clock.area.on_screen)
|
||||
systray.area.posx -= (panel->clock.area.width + panel->area.paddingx);
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (panel->battery.area.on_screen)
|
||||
systray.area.posx -= (panel->battery.area.width + panel->area.paddingx);
|
||||
#endif
|
||||
if (panel_horizontal) {
|
||||
systray.area.posy = panel->area.pix.border.width + panel->area.paddingy;
|
||||
systray.area.height = panel->area.height - (2 * systray.area.posy);
|
||||
}
|
||||
else {
|
||||
systray.area.posx = panel->area.pix.border.width + panel->area.paddingy;
|
||||
systray.area.width = panel->area.width - (2 * panel->area.pix.border.width) - (2 * panel->area.paddingy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +89,6 @@ void cleanup_systray()
|
||||
}
|
||||
|
||||
free_area(&systray.area);
|
||||
|
||||
cleanup_net();
|
||||
}
|
||||
|
||||
@@ -112,22 +109,46 @@ void resize_systray(void *obj)
|
||||
int count, posx, posy;
|
||||
int icon_size;
|
||||
|
||||
icon_size = sysbar->area.height - (2 * sysbar->area.pix.border.width) - (2 * sysbar->area.paddingy);
|
||||
if (panel_horizontal)
|
||||
icon_size = sysbar->area.height;
|
||||
else
|
||||
icon_size = sysbar->area.width;
|
||||
icon_size = icon_size - (2 * sysbar->area.pix.border.width) - (2 * sysbar->area.paddingy);
|
||||
count = g_slist_length(systray.list_icons);
|
||||
|
||||
if (!count) systray.area.width = 0;
|
||||
else systray.area.width = (2 * systray.area.pix.border.width) + (2 * systray.area.paddingxlr) + (icon_size * count) + ((count-1) * systray.area.paddingx);
|
||||
if (panel_horizontal) {
|
||||
if (!count) systray.area.width = 0;
|
||||
else systray.area.width = (2 * systray.area.pix.border.width) + (2 * systray.area.paddingxlr) + (icon_size * count) + ((count-1) * systray.area.paddingx);
|
||||
|
||||
systray.area.posx = panel->area.width - panel->area.pix.border.width - panel->area.paddingxlr - systray.area.width;
|
||||
if (panel->clock.area.on_screen)
|
||||
systray.area.posx -= (panel->clock.area.width + panel->area.paddingx);
|
||||
systray.area.posx = panel->area.width - panel->area.pix.border.width - panel->area.paddingxlr - systray.area.width;
|
||||
if (panel->clock.area.on_screen)
|
||||
systray.area.posx -= (panel->clock.area.width + panel->area.paddingx);
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (panel->battery.area.on_screen)
|
||||
systray.area.posx -= (panel->battery.area.width + panel->area.paddingx);
|
||||
if (panel->battery.area.on_screen)
|
||||
systray.area.posx -= (panel->battery.area.width + panel->area.paddingx);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if (!count) systray.area.height = 0;
|
||||
else systray.area.height = (2 * systray.area.pix.border.width) + (2 * systray.area.paddingxlr) + (icon_size * count) + ((count-1) * systray.area.paddingx);
|
||||
|
||||
posy = panel->area.pix.border.width + panel->area.paddingy + systray.area.pix.border.width + systray.area.paddingy;
|
||||
posx = systray.area.posx + systray.area.pix.border.width + systray.area.paddingxlr;
|
||||
systray.area.posy = panel->area.pix.border.width + panel->area.paddingxlr;
|
||||
if (panel->clock.area.on_screen)
|
||||
systray.area.posy += (panel->clock.area.height + panel->area.paddingx);
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (panel->battery.area.on_screen)
|
||||
systray.area.posy += (panel->battery.area.height + panel->area.paddingx);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (panel_horizontal) {
|
||||
posy = panel->area.pix.border.width + panel->area.paddingy + systray.area.pix.border.width + systray.area.paddingy;
|
||||
posx = systray.area.posx + systray.area.pix.border.width + systray.area.paddingxlr;
|
||||
}
|
||||
else {
|
||||
posx = panel->area.pix.border.width + panel->area.paddingy + systray.area.pix.border.width + systray.area.paddingy;
|
||||
posy = systray.area.posy + systray.area.pix.border.width + systray.area.paddingxlr;
|
||||
}
|
||||
for (l = systray.list_icons; l ; l = l->next) {
|
||||
traywin = (TrayWindow*)l->data;
|
||||
|
||||
@@ -135,7 +156,10 @@ void resize_systray(void *obj)
|
||||
traywin->x = posx;
|
||||
traywin->width = icon_size;
|
||||
traywin->height = icon_size;
|
||||
posx += (icon_size + systray.area.paddingx);
|
||||
if (panel_horizontal)
|
||||
posx += (icon_size + systray.area.paddingx);
|
||||
else
|
||||
posy += (icon_size + systray.area.paddingx);
|
||||
|
||||
// position and size the icon window
|
||||
XMoveResizeWindow(server.dsp, traywin->id, traywin->x, traywin->y, icon_size, icon_size);
|
||||
|
||||
@@ -289,7 +289,7 @@ void draw_task (void *obj, cairo_t *c, int active)
|
||||
Task *tsk = obj;
|
||||
PangoLayout *layout;
|
||||
config_color *config_text;
|
||||
int width, height;
|
||||
int width=0, height;
|
||||
Panel *panel = (Panel*)tsk->area.panel;
|
||||
|
||||
if (panel->g_task.text) {
|
||||
|
||||
@@ -84,11 +84,10 @@ void init_taskbar()
|
||||
int height_ink, height;
|
||||
get_text_size(panel->g_task.font_desc, &height_ink, &height, panel->area.height, "TAjpg", 5);
|
||||
|
||||
if (!panel->g_task.maximum_width)
|
||||
if (!panel->g_task.maximum_width && panel_horizontal)
|
||||
panel->g_task.maximum_width = server.monitor[panel->monitor].width;
|
||||
|
||||
// add task_icon_size
|
||||
panel->g_task.text_posx = panel->g_task.area.paddingxlr + panel->g_task.area.pix.border.width;
|
||||
panel->g_task.text_posx = panel->g_task.area.pix.border.width + panel->g_task.area.paddingxlr;
|
||||
panel->g_task.text_posy = (panel->g_task.area.height - height) / 2.0;
|
||||
if (panel->g_task.icon) {
|
||||
panel->g_task.icon_size1 = panel->g_task.area.height - (2 * panel->g_task.area.paddingy);
|
||||
@@ -292,7 +291,7 @@ void resize_taskbar(void *obj)
|
||||
else {
|
||||
taskbar->task_width = pixel_height;
|
||||
taskbar->task_modulo = modulo_height;
|
||||
taskbar->text_width = taskbar->area.width - (2 * taskbar->area.paddingy) - (2 * taskbar->area.pix.border.width);
|
||||
taskbar->text_width = taskbar->area.width - (2 * panel->g_taskbar.paddingy) - panel->g_task.text_posx - panel->g_task.area.pix.border.width - panel->g_task.area.paddingx;
|
||||
}
|
||||
|
||||
// change pos_y and height for all tasks
|
||||
|
||||
Reference in New Issue
Block a user