vertical panel done git-svn-id: http://tint2.googlecode.com/svn/trunk@124 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
6 files changed,
77 insertions(+),
44 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,3 +1,13 @@
+2009-06-24 +- vertical panel done + user's parameters : + 1) add 'vertical' to panel_position (panel_position = center left vertical) + 2) use 'task_width' to define the task height (task_width = 30) + 3) adjust paddingy on task and systray wiil define the size of icons + all others parameters are automatically converted by tint2 + (x padding become y padding, width become height ...) + so user's change between horizontal and vertical are minimised. + 2009-06-23 - play with vertical panel check sample file tintrc05 and tintrc06
M
src/systray/systraybar.c
→
src/systray/systraybar.c
@@ -59,22 +59,20 @@ systray.area.parent = panel;
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 @@ systray.list_icons = 0;
} free_area(&systray.area); - cleanup_net(); }@@ -112,22 +109,46 @@ GSList *l;
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 @@ traywin->y = posy;
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);
M
src/taskbar/task.c
→
src/taskbar/task.c
@@ -289,7 +289,7 @@ {
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) {
M
src/taskbar/taskbar.c
→
src/taskbar/taskbar.c
@@ -84,11 +84,10 @@ // compute vertical position : text and icon
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 @@ }
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
M
tintrc05
→
tintrc05
@@ -12,12 +12,12 @@ border_color = #d1d1d1 34
rounded = 3 border_width = 1 -background_color = #000000 40 -border_color = #d1d1d1 34 +background_color = #96b3a9 60 +border_color = #d1d1d1 70 rounded = 2 border_width = 0 -background_color = #d1d1d1 24 +background_color = #707070 40 border_color = #d1d1d1 40 #---------------------------------------------@@ -43,22 +43,22 @@
#--------------------------------------------- # TASKS #--------------------------------------------- -task_icon = 1 +task_icon = 0 task_text = 1 task_width = 26 task_centered = 1 -task_padding = 4 3 -task_font = sans bold 7.5 -task_font_color = #ffffff 60 -task_active_font_color = #ffffff 90 +task_padding = 1 5 +task_font = sans 7.5 +task_font_color = #ffffff 80 +task_active_font_color = #ffffff 100 task_background_id = 0 task_active_background_id = 3 #--------------------------------------------- # SYSTRAYBAR #--------------------------------------------- -#systray_padding = 6 3 5 -systray_background_id = 2 +systray_padding = 0 28 2 +systray_background_id = 0 #--------------------------------------------- # CLOCK@@ -68,7 +68,7 @@ time1_font = sans bold 8
#time2_format = %A %d %B time2_format = %A %d time2_font = sans 7 -clock_font_color = #ffffff 60 +clock_font_color = #ffffff 90 clock_padding = 4 2 clock_background_id = 2 clock_lclick_command = xclock@@ -82,9 +82,9 @@ battery_low_status = 10
battery_low_cmd = notify-send "battery low" bat1_font = sans bold 7 bat2_font = sans 7 -battery_font_color = #ffffff 60 +battery_font_color = #ffffff 90 battery_padding = 0 0 -battery_background_id = 0 +battery_background_id = 2 #--------------------------------------------- # MOUSE ACTION ON TASK
M
tintrc06
→
tintrc06
@@ -64,8 +64,8 @@
#--------------------------------------------- # SYSTRAYBAR #--------------------------------------------- -#systray_padding = 6 3 5 -systray_background_id = 2 +systray_padding = 4 10 2 +systray_background_id = 0 #--------------------------------------------- # CLOCK