replace task_width with task_maximum_size. change wiki documentation. git-svn-id: http://tint2.googlecode.com/svn/trunk@128 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
10 files changed,
56 insertions(+),
22 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,3 +1,9 @@
+2009-06-25 +- improve user's message when compiled with --disable-battery +- replace 'task_width = width' by 'task_maximum_size = width height' + width will be used in horizontal panel + height will be used in vertical panel + 2009-06-24 - vertical panel done user's parameters :
M
src/config.c
→
src/config.c
@@ -331,54 +331,67 @@ else if (strcmp (key, "urgent_nb_of_blink") == 0)
max_tick_urgent = (atoi (value) * 2) + 1; /* Battery */ -#ifdef ENABLE_BATTERY else if (strcmp (key, "battery") == 0) { +#ifdef ENABLE_BATTERY if(atoi(value) == 1) panel_config->battery.area.on_screen = 1; +#else + if(atoi(value) == 1) + printf("tint2 is build without battery support\n"); +#endif } else if (strcmp (key, "battery_low_status") == 0) { +#ifdef ENABLE_BATTERY battery_low_status = atoi(value); if(battery_low_status < 0 || battery_low_status > 100) battery_low_status = 0; +#endif } else if (strcmp (key, "battery_low_cmd") == 0) { +#ifdef ENABLE_BATTERY if (battery_low_cmd) g_free(battery_low_cmd); if (strlen(value) > 0) battery_low_cmd = strdup (value); else battery_low_cmd = 0; +#endif } else if (strcmp (key, "bat1_font") == 0) { +#ifdef ENABLE_BATTERY if (save_file_config) old_bat1_font = strdup (value); if (bat1_font_desc) pango_font_description_free(bat1_font_desc); bat1_font_desc = pango_font_description_from_string (value); +#endif } else if (strcmp (key, "bat2_font") == 0) { +#ifdef ENABLE_BATTERY if (save_file_config) old_bat2_font = strdup (value); if (bat2_font_desc) pango_font_description_free(bat2_font_desc); bat2_font_desc = pango_font_description_from_string (value); +#endif } else if (strcmp (key, "battery_font_color") == 0) { +#ifdef ENABLE_BATTERY extract_values(value, &value1, &value2, &value3); get_color (value1, panel_config->battery.font.color); if (value2) panel_config->battery.font.alpha = (atoi (value2) / 100.0); else panel_config->battery.font.alpha = 0.5; +#endif } else if (strcmp (key, "battery_padding") == 0) { +#ifdef ENABLE_BATTERY extract_values(value, &value1, &value2, &value3); panel_config->battery.area.paddingxlr = panel_config->battery.area.paddingx = atoi (value1); if (value2) panel_config->battery.area.paddingy = atoi (value2); if (value3) panel_config->battery.area.paddingx = atoi (value3); +#endif } else if (strcmp (key, "battery_background_id") == 0) { +#ifdef ENABLE_BATTERY int id = atoi (value); Area *a = g_slist_nth_data(list_back, id); memcpy(&panel_config->battery.area.pix.back, &a->pix.back, sizeof(Color)); memcpy(&panel_config->battery.area.pix.border, &a->pix.border, sizeof(Border)); - } -#else - else if ((strcmp (key, "battery") == 0) || (strcmp (key, "battery_low_status") == 0) || (strcmp (key, "battery_low_cmd") == 0) || (strcmp (key, "bat1_font") == 0) || (strcmp (key, "bat2_font") == 0) || (strcmp (key, "battery_font_color") == 0) || (strcmp (key, "battery_padding") == 0) || (strcmp (key, "battery_background_id") == 0)) { - printf("tint2 is build without battery support\n"); +#endif } -#endif /* Clock */ else if (strcmp (key, "time1_format") == 0) {@@ -461,8 +474,18 @@ else if (strcmp (key, "task_icon") == 0)
panel_config->g_task.icon = atoi (value); else if (strcmp (key, "task_centered") == 0) panel_config->g_task.centered = atoi (value); - else if (strcmp (key, "task_width") == 0) + else if (strcmp (key, "task_width") == 0) { + // old parameter : just for backward compatibility panel_config->g_task.maximum_width = atoi (value); + panel_config->g_task.maximum_height = 30; + } + else if (strcmp (key, "task_maximum_size") == 0) { + extract_values(value, &value1, &value2, &value3); + panel_config->g_task.maximum_width = atoi (value1); + panel_config->g_task.maximum_height = 30; + if (value2) + panel_config->g_task.maximum_height = atoi (value2); + } else if (strcmp (key, "task_padding") == 0) { extract_values(value, &value1, &value2, &value3); panel_config->g_task.area.paddingxlr = panel_config->g_task.area.paddingx = atoi (value1);@@ -824,14 +847,15 @@ fputs("#---------------------------------------------\n", fp);
fputs("panel_monitor = all\n", fp); if (panel_position & BOTTOM) fputs("panel_position = bottom", fp); else fputs("panel_position = top", fp); - if (panel_position & LEFT) fputs(" left\n", fp); - else if (panel_position & RIGHT) fputs(" right\n", fp); - else fputs(" center\n", fp); + if (panel_position & LEFT) fputs(" left horizontal\n", fp); + else if (panel_position & RIGHT) fputs(" right horizontal\n", fp); + else fputs(" center horizontal\n", fp); fprintf(fp, "panel_size = %d %d\n", (int)panel_config->initial_width, (int)panel_config->initial_height); fprintf(fp, "panel_margin = %d %d\n", panel_config->marginx, panel_config->marginy); fprintf(fp, "panel_padding = %d %d %d\n", panel_config->area.paddingxlr, panel_config->area.paddingy, panel_config->area.paddingx); fprintf(fp, "font_shadow = %d\n", panel_config->g_task.font_shadow); fputs("panel_background_id = 1\n", fp); + fputs("wm_menu = 0\n", fp); fputs("\n#---------------------------------------------\n", fp); fputs("# TASKBAR\n", fp);@@ -847,7 +871,7 @@ fputs("#---------------------------------------------\n", fp);
if (old_task_icon_size) fputs("task_icon = 1\n", fp); else fputs("task_icon = 0\n", fp); fputs("task_text = 1\n", fp); - fprintf(fp, "task_width = %d\n", panel_config->g_task.maximum_width); + fprintf(fp, "task_maximum_size = %d %d\n", panel_config->g_task.maximum_width, panel_config->g_task.maximum_height); fprintf(fp, "task_centered = %d\n", panel_config->g_task.centered); fprintf(fp, "task_padding = %d %d\n", panel_config->g_task.area.paddingx, panel_config->g_task.area.paddingy); fprintf(fp, "task_font = %s\n", old_task_font);@@ -874,6 +898,8 @@ fprintf(fp, "time2_font = %s\n", old_time2_font);
fprintf(fp, "clock_font_color = #%02x%02x%02x %d\n", (int)(panel_config->clock.font.color[0]*255), (int)(panel_config->clock.font.color[1]*255), (int)(panel_config->clock.font.color[2]*255), (int)(panel_config->clock.font.alpha*100)); fputs("clock_padding = 2 2\n", fp); fputs("clock_background_id = 0\n", fp); + fputs("#clock_lclick_command = xclock\n", fp); + fputs("clock_rclick_command = orage\n", fp); #ifdef ENABLE_BATTERY fputs("\n#---------------------------------------------\n", fp);
M
src/taskbar/task.h
→
src/taskbar/task.h
@@ -24,6 +24,7 @@
int icon_posy; int icon_size1; int maximum_width; + int maximum_height; // starting position for text ~ task_padding + task_border + icon_size double text_posx, text_posy;
M
src/taskbar/taskbar.c
→
src/taskbar/taskbar.c
@@ -72,7 +72,7 @@ }
else { panel->g_task.area.posx = panel->g_taskbar.posx + panel->g_taskbar.pix.border.width + panel->g_taskbar.paddingy; panel->g_task.area.width = panel->area.width - (2 * panel->g_task.area.posx); - panel->g_task.area.height = panel->g_task.maximum_width; + panel->g_task.area.height = panel->g_task.maximum_height; } if (panel->g_task.area.pix.border.rounded > panel->g_task.area.height/2) {@@ -274,14 +274,14 @@ int y, taskbar_height;
// new task width for 'desktop' task_count = g_slist_length(taskbar->area.list); - if (!task_count) pixel_height = panel->g_task.maximum_width; + if (!task_count) pixel_height = panel->g_task.maximum_height; else { taskbar_height = taskbar->area.height - (2 * panel->g_taskbar.pix.border.width) - (2 * panel->g_taskbar.paddingxlr); if (task_count>1) taskbar_height -= ((task_count-1) * panel->g_taskbar.paddingx); pixel_height = taskbar_height / task_count; - if (pixel_height > panel->g_task.maximum_width) - pixel_height = panel->g_task.maximum_width; + if (pixel_height > panel->g_task.maximum_height) + pixel_height = panel->g_task.maximum_height; else modulo_height = taskbar_height % task_count; }
M
tintrc01
→
tintrc01
@@ -24,7 +24,8 @@ #---------------------------------------------
# PANEL #--------------------------------------------- panel_monitor = all -panel_position = bottom center +panel_position = bottom center horizontal +#panel_position = center left vertical panel_size = 94% 30 panel_margin = 0 0 panel_padding = 7 0@@ -45,7 +46,7 @@ # TASKS
#--------------------------------------------- task_icon = 1 task_text = 1 -task_width = 140 +task_maximum_size = 140 30 task_centered = 1 task_padding = 6 3 task_font = sans 7