mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
acme: scale window bodies on resize, not including tag space
This avoids reopening collapsed windows after a large vertical resize.
This commit is contained in:
parent
92aa0e13ad
commit
4650064aa7
1 changed files with 5 additions and 3 deletions
|
@ -232,7 +232,7 @@ colmousebut(Column *c)
|
||||||
void
|
void
|
||||||
colresize(Column *c, Rectangle r)
|
colresize(Column *c, Rectangle r)
|
||||||
{
|
{
|
||||||
int i;
|
int i, old, new;
|
||||||
Rectangle r1, r2;
|
Rectangle r1, r2;
|
||||||
Window *w;
|
Window *w;
|
||||||
|
|
||||||
|
@ -245,6 +245,8 @@ colresize(Column *c, Rectangle r)
|
||||||
r1.max.y += Border;
|
r1.max.y += Border;
|
||||||
draw(screen, r1, display->black, nil, ZP);
|
draw(screen, r1, display->black, nil, ZP);
|
||||||
r1.max.y = r.max.y;
|
r1.max.y = r.max.y;
|
||||||
|
new = Dy(r) - c->nw*(Border + font->height);
|
||||||
|
old = Dy(c->r) - c->nw*(Border + font->height);
|
||||||
for(i=0; i<c->nw; i++){
|
for(i=0; i<c->nw; i++){
|
||||||
w = c->w[i];
|
w = c->w[i];
|
||||||
w->maxlines = 0;
|
w->maxlines = 0;
|
||||||
|
@ -252,8 +254,8 @@ colresize(Column *c, Rectangle r)
|
||||||
r1.max.y = r.max.y;
|
r1.max.y = r.max.y;
|
||||||
else{
|
else{
|
||||||
r1.max.y = r1.min.y;
|
r1.max.y = r1.min.y;
|
||||||
if(Dy(c->r) != 0){
|
if(new > 0 && old > 0 && Dy(w->r) > Border+font->height){
|
||||||
r1.max.y += (Dy(w->r)+Border)*Dy(r)/Dy(c->r);
|
r1.max.y += (Dy(w->r)-Border-font->height)*new/old + Border + font->height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
r1.max.y = max(r1.max.y, r1.min.y + Border+font->height);
|
r1.max.y = max(r1.max.y, r1.min.y + Border+font->height);
|
||||||
|
|
Loading…
Reference in a new issue