Example #1
0
void initialize_positions(void *obj, int offset)
{
	Area *a = (Area *)obj;
	for (GList *l = a->children; l; l = l->next) {
		Area *child = ((Area *)l->data);
		if (panel_horizontal) {
			child->posy = offset + a->bg->border.width + a->paddingy;
			child->height = a->height - (2 * (a->bg->border.width + a->paddingy));
			if (child->_on_change_layout)
				child->_on_change_layout(child);
			initialize_positions(child, child->posy);
		} else {
			child->posx = offset + a->bg->border.width + a->paddingy;
			child->width = a->width - (2 * (a->bg->border.width + a->paddingy));
			if (child->_on_change_layout)
				child->_on_change_layout(child);
			initialize_positions(child, child->posx);
		}
	}
}
Example #2
0
void init_rendering(void *obj, int pos)
{
	Area *a = (Area*)obj;
	
	// initialize fixed position/size
	GSList *l;
	for (l = a->list; l ; l = l->next) {
		Area *child = ((Area*)l->data);
		if (panel_horizontal) {
			child->posy = pos + a->bg->border.width + a->paddingy;
			child->height = a->height - (2 * (a->bg->border.width + a->paddingy));
			if (child->_on_change_layout)
				child->_on_change_layout(child);
			init_rendering(child, child->posy);
		}
		else {
			child->posx = pos + a->bg->border.width + a->paddingy;
			child->width = a->width - (2 * (a->bg->border.width + a->paddingy));
			if (child->_on_change_layout)
				child->_on_change_layout(child);
			init_rendering(child, child->posx);
		}
	}
}