# Panel
panel_monitor = all
-panel_position = bottom center horizontal
+#panel_position = bottom center horizontal
+panel_position = top center horizontal
panel_size = 94% 30
panel_margin = 0 0
panel_padding = 7 0 7
task_urgent_background_id = 2
task_iconified_background_id = 3
task_tooltip = 0
+task_align = right
# Task Icons
task_icon_asb = 70 0 0
battery_padding = 1 0
battery_background_id = 0
-# End of config
\ No newline at end of file
+# End of config
# Panel
panel_monitor = all
-panel_position = bottom center horizontal
+#panel_position = bottom center horizontal
+panel_position = top center horizontal
panel_size = 98% 28
panel_margin = 0 5
panel_padding = 3 0 3
task_urgent_background_id = 2
task_iconified_background_id = 3
task_tooltip = 0
+task_align = right
# Task Icons
task_icon_asb = 80 0 0
battery_padding = 1 0
battery_background_id = 0
-# End of config
\ No newline at end of file
+# End of config
# Panel
panel_monitor = all
-panel_position = bottom center horizontal
+#panel_position = bottom center horizontal
+panel_position = top center horizontal
panel_size = 92% 28
panel_margin = 0 0
panel_padding = 7 0 7
battery_padding = 1 0
battery_background_id = 1
-# End of config
\ No newline at end of file
+# End of config
task_urgent_background_id = 6
task_iconified_background_id = 0
task_tooltip = 1
+#task_align = center
+task_align = right
# Task Icons
task_icon_asb = 100 -25 -8
battery_padding = 2 0
battery_background_id = 0
-# End of config
\ No newline at end of file
+# End of config
task_urgent_background_id = 3
task_iconified_background_id = 0
task_tooltip = 1
+#task_align = center
+task_align = right
# Task Icons
task_icon_asb = 90 -100 -20
battery_padding = 1 0
battery_background_id = 0
-# End of config
\ No newline at end of file
+# End of config
# Panel
panel_monitor = all
-panel_position = bottom left horizontal
+#panel_position = bottom left horizontal
+panel_position = top left horizontal
panel_size = 100% 38
panel_margin = 0 0
panel_padding = 7 3 7
task_urgent_background_id = 4
task_iconified_background_id = 0
task_tooltip = 0
+task_align = right
# Task Icons
task_icon_asb = 70 0 0
battery_padding = 1 0
battery_background_id = 0
-# End of config
\ No newline at end of file
+# End of config
# Panel
panel_monitor = all
-panel_position = bottom center horizontal
+#panel_position = bottom center horizontal
+panel_position = top center horizontal
panel_size = 100% 40
panel_margin = 0 0
panel_padding = 0 0 0
task_urgent_background_id = 4
task_iconified_background_id = 3
task_tooltip = 1
+task_align = right
# Task Icons
task_icon_asb = 90 0 0
battery_padding = 0 0
battery_background_id = 0
-# End of config
\ No newline at end of file
+# End of config
task_urgent_background_id = 2
task_iconified_background_id = 3
task_tooltip = 1
+task_align = center
+#task_align = right
# Task Icons
task_icon_asb = 100 0 0
battery_padding = 4 2
battery_background_id = 1
-# End of config
\ No newline at end of file
+# End of config
# Panel
panel_monitor = all
-panel_position = bottom center horizontal
+#panel_position = bottom center horizontal
+#panel_position = top center horizontal
+panel_position = top center vertical
panel_size = 95% 30
panel_margin = 0 0
panel_padding = 7 3 7
# Taskbar
taskbar_mode = multi_desktop
+#taskbar_mode = single_desktop
taskbar_padding = 0 0 0
taskbar_background_id = 2
taskbar_active_background_id = 2
task_urgent_background_id = 0
task_iconified_background_id = 0
task_tooltip = 1
+#task_align = left
+#task_align = center
+task_align = right
# Task Icons
task_icon_asb = 100 0 0
battery_padding = 1 0
battery_background_id = 0
-# End of config
\ No newline at end of file
+# End of config
if (value2) panel_config.g_task.area.paddingy = atoi (value2);
if (value3) panel_config.g_task.area.paddingx = atoi (value3);
}
+ else if (strcmp (key, "task_align") == 0) {
+ extract_values(value, &value1, &value2, &value3);
+ printf("task_align: %s\n", value1);
+ if (strcmp (value1, "left") == 0) panel_config.g_task.align = ALIGN_LEFT;
+ else if (strcmp (value1, "center") == 0) panel_config.g_task.align = ALIGN_CENTER;
+ else if (strcmp (value1, "right") == 0) panel_config.g_task.align = ALIGN_RIGHT;
+ else fprintf(stderr, "Unknown value for task_align: %s\n", value1);
+ }
else if (strcmp (key, "task_font") == 0) {
panel_config.g_task.font_desc = pango_font_description_from_string (value);
}
extern int panel_strut_policy;
extern char *panel_items_order;
+// tasks alignment
+enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT };
+
extern int max_tick_urgent;
extern GArray* backgrounds;
int text;
int icon;
int centered;
+ int align;
int icon_posy;
int icon_size1;
}
+// calculate total size of all children including
+// parent's padding
+int children_size(Area *a, int horizontal)
+{
+ int size = 0;
+ GSList *l;
+
+ for (l = a->list; l; l = l->next) {
+ Area *child = ((Area*)l->data);
+ if (!child->on_screen) continue;
+
+ if (horizontal)
+ size += child->width + a->paddingx;
+ else
+ size += child->height + a->paddingy;
+ }
+
+ return size;
+}
+
+
+// calculate chilren's align offset depending on the align type
+int align_offset(Area *a, int align, int horizontal)
+{
+ int size = 0;
+ int child_size = children_size(a, horizontal);
+
+ if (horizontal)
+ size = a->width;
+ else
+ size = a->height;
+
+ switch (align) {
+ case ALIGN_LEFT:
+ return 0;
+
+ case ALIGN_CENTER:
+ return (size - child_size) / 2;
+
+ case ALIGN_RIGHT:
+ return size - child_size;
+
+ default:
+ return 0;
+ }
+}
+
+
void size_by_layout (Area *a, int pos, int level)
{
// don't resize hiden objects
int k;
for (k=0 ; k < level ; k++) printf(" ");
printf("tree level %d, object %d, pos %d, %s\n", level, i, pos, (child->size_mode == SIZE_BY_LAYOUT) ? "SIZE_BY_LAYOUT" : "SIZE_BY_CONTENT");*/
- size_by_layout(child, pos, level+1);
+
+ int offset = align_offset(child, panel_config.g_task.align, panel_horizontal);
+ size_by_layout(child, pos + offset, level + 1);
if (panel_horizontal)
pos += child->width + a->paddingx;