From 9582e35ab89e14397bf1aeaea1d98a10d4064c60 Mon Sep 17 00:00:00 2001 From: rathnor Date: Thu, 11 Sep 2003 13:35:37 +0000 Subject: correct temporary insanity :-/ --- src/FbWinFrame.cc | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 045ca03..3dd0f1b 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.46 2003/09/11 13:17:14 rathnor Exp $ +// $Id: FbWinFrame.cc,v 1.47 2003/09/11 13:35:37 rathnor Exp $ #include "FbWinFrame.hh" @@ -38,6 +38,8 @@ #include #include +#include + using namespace std; FbWinFrame::FbWinFrame(FbWinFrameTheme &theme, FbTk::ImageControl &imgctrl, @@ -1140,18 +1142,29 @@ void FbWinFrame::gravityTranslate(int &x, int &y, int win_gravity, bool move_fra // Start with X offset switch (win_gravity) { - case NorthWest: - case North: - case NorthEast: + case NorthWestGravity: + case NorthGravity: + case NorthEastGravity: // no offset, since the top point is still the same break; - case SouthWest: - case South: - case SouthEast: - case Static: - case Center: - // window shifted down by height of titlebar - x_offset -= m_titlebar.height() + m_titlebar.borderWidth(); + case SouthWestGravity: + case SouthGravity: + case SouthEastGravity: + // window shifted down by height of titlebar, and the handle + // since that's necessary to get the bottom of the frame + // all the way up + x_offset = -(m_titlebar.height() + m_titlebar.borderWidth() + + m_handle.height() + m_handle.borderWidth()); + break; + case WestGravity: + case EastGravity: + case CenterGravity: + // these centered ones are a little more interesting + x_offset = -(m_titlebar.height() + m_titlebar.borderWidth() + + m_handle.height() + m_handle.borderWidth()) / 2; + break; + case StaticGravity: + x_offset = -(m_titlebar.height() + m_titlebar.borderWidth()); break; } @@ -1166,6 +1179,6 @@ void FbWinFrame::gravityTranslate(int &x, int &y, int win_gravity, bool move_fra y += y_offset; if (move_frame && (x_offset != 0 || y_offset != 0)) { - move(x() + x_offset, y() + y_offset); + move(m_window.x() + x_offset, m_window.y() + y_offset); } } -- cgit v0.11.2