bestfit placement now honors the left->right and top->bottom options for window placement.
fix for the placement config menu.
This commit is contained in:
parent
ec028e395f
commit
32951060f6
2 changed files with 12 additions and 7 deletions
|
@ -356,16 +356,16 @@ void Configmenu::Placementmenu::itemSelected(int button, int index) {
|
|||
case BScreen::TopBottom:
|
||||
configmenu->screen.setColPlacementDirection(BScreen::TopBottom);
|
||||
|
||||
setItemSelected(5, True);
|
||||
setItemSelected(6, False);
|
||||
setItemSelected(6, True);
|
||||
setItemSelected(7, False);
|
||||
|
||||
break;
|
||||
|
||||
case BScreen::BottomTop:
|
||||
configmenu->screen.setColPlacementDirection(BScreen::BottomTop);
|
||||
|
||||
setItemSelected(5, False);
|
||||
setItemSelected(6, True);
|
||||
setItemSelected(6, False);
|
||||
setItemSelected(7, True);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -396,9 +396,14 @@ Point *Workspace::bestFitPlacement(const Size &win_size, const Rect &space)
|
|||
best = siter;
|
||||
}
|
||||
|
||||
if (best != NULL)
|
||||
return new Point(best->origin());
|
||||
else
|
||||
if (best != NULL) {
|
||||
Point *pt = new Point(best->origin());
|
||||
if (screen.colPlacementDirection() != BScreen::TopBottom)
|
||||
pt->setY(pt->y() + (best->h() - win_size.h()));
|
||||
if (screen.rowPlacementDirection() != BScreen::LeftRight)
|
||||
pt->setX(pt->x() + (best->w() - win_size.w()));
|
||||
return pt;
|
||||
} else
|
||||
return NULL; //fall back to cascade
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue