From 3daaf8d18e5692cfe9603a132fc766cd0d830a84 Mon Sep 17 00:00:00 2001 From: Arrehn Date: Sun, 9 Jan 2011 03:27:16 -0500 Subject: [PATCH] Make iconified windows respect the space taken by the topbars and not overlap --- indra/llui/llfloater.cpp | 7 ++++++- indra/newview/llnavigationbar.cpp | 15 +++++++++++++++ indra/newview/llnavigationbar.h | 7 ++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 34d8e9c500..b7781670ea 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -57,6 +57,7 @@ #include "llhelp.h" #include "llmultifloater.h" #include "llsdutil.h" +#include "../newview/llnavigationbar.h" // use this to control "jumping" behavior when Ctrl-Tabbing const S32 TABBED_FLOATER_OFFSET = 0; @@ -2361,7 +2362,11 @@ void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) col < snap_rect_local.getWidth() - minimized_width; col += minimized_width) { - for(S32 row = snap_rect_local.mTop - floater_header_size; + + int offset; + LLNavigationBar* navbar = LLNavigationBar::getInstance(); + offset = navbar->getVisHeight(); // AO, don't obscure the navbar + for(S32 row = snap_rect_local.mTop - (floater_header_size + offset); row > floater_header_size; row -= floater_header_size ) //loop rows { diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 61759410e4..266da58174 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -736,6 +736,21 @@ int LLNavigationBar::getDefFavBarHeight() return mDefaultFpRect.getHeight(); } +// AO, used to calculate the size of the top bars, so we don't overlap them. +int LLNavigationBar::getVisHeight() +{ + int h = 0; + //LLFavoritesBarCtrl* fb = getChild("favorite"); + bool fbVisible = gSavedSettings.getBOOL("ShowNavbarFavoritesPanel"); + bool nbVisible = gSavedSettings.getBOOL("ShowNavbarNavigationPanel"); + // TODO: Make this introspect controls to get the dynamic size. + if (fbVisible) + h += 15; + if (nbVisible) + h += 35; + return h; +} + void LLNavigationBar::showNavigationPanel(BOOL visible) { bool fpVisible = gSavedSettings.getBOOL("ShowNavbarFavoritesPanel"); diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h index 3c9f8a762d..d7efcad0fd 100644 --- a/indra/newview/llnavigationbar.h +++ b/indra/newview/llnavigationbar.h @@ -27,8 +27,8 @@ #ifndef LL_LLNAVIGATIONBAR_H #define LL_LLNAVIGATIONBAR_H -#include "llpanel.h" -#include "llbutton.h" +#include "../llui/llpanel.h" +#include "../llui/llbutton.h" class LLLocationInputCtrl; class LLMenuGL; @@ -91,7 +91,7 @@ public: virtual ~LLNavigationBar(); /*virtual*/ void draw(); - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL postBuild(); /*virtual*/ void setVisible(BOOL visible); @@ -103,6 +103,7 @@ public: int getDefNavBarHeight(); int getDefFavBarHeight(); + int getVisHeight(); // AO - total vertical pixels in use, for insuring new windows don't overlap. private: // the distance between navigation panel and favorites panel in pixels