From 32951060f693424bd173888e16382a02949c450e Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 21 Apr 2002 02:02:27 +0000 Subject: [PATCH] bestfit placement now honors the left->right and top->bottom options for window placement. fix for the placement config menu. --- src/Configmenu.cc | 8 ++++---- src/Workspace.cc | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Configmenu.cc b/src/Configmenu.cc index a12ca5ad..413e0b25 100644 --- a/src/Configmenu.cc +++ b/src/Configmenu.cc @@ -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; } diff --git a/src/Workspace.cc b/src/Workspace.cc index 5f8817cb..70b043c0 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -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 } -- 2.45.2