mirror of
https://github.com/0intro/wmii
synced 2025-01-25 11:32:06 +03:00
implemented horizontal scaling for columns
This commit is contained in:
parent
8199524d26
commit
3e49d746e3
@ -23,6 +23,8 @@ alloc_area(View *v)
|
|||||||
a->id = id++;
|
a->id = id++;
|
||||||
a->rect = rect;
|
a->rect = rect;
|
||||||
a->rect.height = rect.height - brect.height;
|
a->rect.height = rect.height - brect.height;
|
||||||
|
if(v->area.size > 2)
|
||||||
|
a->rect.width = rect.width / (v->area.size - 2);
|
||||||
cext_vattach(area2vector(&v->area), a);
|
cext_vattach(area2vector(&v->area), a);
|
||||||
v->sel = v->area.size -1;
|
v->sel = v->area.size -1;
|
||||||
return a;
|
return a;
|
||||||
|
@ -291,19 +291,26 @@ restack_view(View *v)
|
|||||||
void
|
void
|
||||||
arrange_view(View *v, Bool dirty)
|
arrange_view(View *v, Bool dirty)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i, xoff = 0;
|
||||||
unsigned int width;
|
unsigned int dx = 0;
|
||||||
|
float scale = 1.0;
|
||||||
|
|
||||||
if(v->area.size == 1)
|
if(v->area.size == 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
width = rect.width / (v->area.size - 1);
|
if(dirty) {
|
||||||
|
for(i = 1; i < v->area.size; i++)
|
||||||
|
dx += v->area.data[i]->rect.width;
|
||||||
|
scale = (float)rect.width / (float)dx;
|
||||||
|
}
|
||||||
for(i = 1; i < v->area.size; i++) {
|
for(i = 1; i < v->area.size; i++) {
|
||||||
Area *a = v->area.data[i];
|
Area *a = v->area.data[i];
|
||||||
if(dirty) {
|
if(dirty) {
|
||||||
|
a->rect.x = xoff;
|
||||||
|
a->rect.y = 0;
|
||||||
a->rect.height = rect.height - brect.height;
|
a->rect.height = rect.height - brect.height;
|
||||||
a->rect.x = (i - 1) * width;
|
a->rect.width *= scale;
|
||||||
a->rect.width = width;
|
xoff += a->rect.width;
|
||||||
}
|
}
|
||||||
arrange_column(a, False);
|
arrange_column(a, False);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user