- if (pt->x() < space.x())
- pt->setX(space.x());
- if (pt->y() < space.y())
- pt->setY(space.y());
- if (pt->x() + win_size.w() > space.x() + space.w())
- pt->setX(space.x() + space.w() - win_size.w());
- if (pt->y() + win_size.h() > space.y() + space.h())
- pt->setY(space.y() + space.h() - win_size.h());
- return pt;
-}
+ if (screen->getPlacementPolicy() == BScreen::RowSmartPlacement) {
+ if(screen->getRowPlacementDirection() == BScreen::LeftRight) {
+ if(screen->getColPlacementDirection() == BScreen::TopBottom)
+ std::sort(spaces.begin(), spaces.end(), rowLRTB);
+ else
+ std::sort(spaces.begin(), spaces.end(), rowLRBT);
+ } else {
+ if(screen->getColPlacementDirection() == BScreen::TopBottom)
+ std::sort(spaces.begin(), spaces.end(), rowRLTB);
+ else
+ std::sort(spaces.begin(), spaces.end(), rowRLBT);
+ }
+ } else {
+ if(screen->getColPlacementDirection() == BScreen::TopBottom) {
+ if(screen->getRowPlacementDirection() == BScreen::LeftRight)
+ std::sort(spaces.begin(), spaces.end(), colLRTB);
+ else
+ std::sort(spaces.begin(), spaces.end(), colRLTB);
+ } else {
+ if(screen->getRowPlacementDirection() == BScreen::LeftRight)
+ std::sort(spaces.begin(), spaces.end(), colLRBT);
+ else
+ std::sort(spaces.begin(), spaces.end(), colRLBT);
+ }
+ }