summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Guslisty <pguslisty@productengine.com>2010-08-12 13:19:23 +0300
committerPaul Guslisty <pguslisty@productengine.com>2010-08-12 13:19:23 +0300
commit7312471e7f6ed54170f8c38809b34a001bd7c82b (patch)
tree14f8b0d82a204843ebaf51b25ebea65383c4996b
parentec28b9af16c7f5eb365b945743d85fe75cc8383f (diff)
EXT-7951 FIXED (Mini-Location panel appearance design issues)
- Added callback on show\hide Mini Location Panel event. This callback sets proper initial minimized position depending on state (shown or hidded) Mini Location Panel. Also callback shifts vertically already minimized floaters so that they don't overlap Mini Location Panel Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/851/ --HG-- branch : product-engine
-rw-r--r--indra/llui/llfloater.cpp14
-rw-r--r--indra/llui/llfloater.h3
-rw-r--r--indra/newview/llpaneltopinfobar.cpp23
-rw-r--r--indra/newview/llpaneltopinfobar.h5
4 files changed, 45 insertions, 0 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 22d6f6ca52..838f93d3f9 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -2285,6 +2285,7 @@ void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom)
S32 floater_header_size = default_params.header_height;
static LLUICachedControl<S32> minimized_width ("UIMinimizedWidth", 0);
LLRect snap_rect_local = getLocalSnapRect();
+ snap_rect_local.mTop += mMinimizePositionVOffset;
for(S32 col = snap_rect_local.mLeft;
col < snap_rect_local.getWidth() - minimized_width;
col += minimized_width)
@@ -2382,6 +2383,19 @@ BOOL LLFloaterView::allChildrenClosed()
return true;
}
+void LLFloaterView::shiftFloaters(S32 x_offset, S32 y_offset)
+{
+ for (child_list_const_iter_t it = getChildList()->begin(); it != getChildList()->end(); ++it)
+ {
+ LLFloater* floaterp = dynamic_cast<LLFloater*>(*it);
+
+ if (floaterp && floaterp->isMinimized())
+ {
+ floaterp->translate(x_offset, y_offset);
+ }
+ }
+}
+
void LLFloaterView::refresh()
{
// Constrain children to be entirely on the screen
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 42f422f91c..e7d365238b 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -455,6 +455,7 @@ public:
// Given a child of gFloaterView, make sure this view can fit entirely onscreen.
void adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside);
+ void setMinimizePositionVerticalOffset(S32 offset) { mMinimizePositionVOffset = offset; }
void getMinimizePosition( S32 *left, S32 *bottom);
void restoreAll(); // un-minimize all floaters
typedef std::set<LLView*> skip_list_t;
@@ -471,6 +472,7 @@ public:
// attempt to close all floaters
void closeAllChildren(bool app_quitting);
BOOL allChildrenClosed();
+ void shiftFloaters(S32 x_offset, S32 y_offset);
LLFloater* getFrontmost() const;
LLFloater* getBackmost() const;
@@ -490,6 +492,7 @@ private:
BOOL mFocusCycleMode;
S32 mSnapOffsetBottom;
S32 mSnapOffsetRight;
+ S32 mMinimizePositionVOffset;
};
//
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index 68dc1cdf71..e73d1fb7c2 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -161,6 +161,8 @@ BOOL LLPanelTopInfoBar::postBuild()
mParcelMgrConnection = LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(
boost::bind(&LLPanelTopInfoBar::onAgentParcelChange, this));
+ setVisibleCallback(boost::bind(&LLPanelTopInfoBar::onVisibilityChange, this, _2));
+
return TRUE;
}
@@ -174,6 +176,27 @@ void LLPanelTopInfoBar::onNavBarShowParcelPropertiesCtrlChanged()
setParcelInfoText(new_text);
}
+// when panel is shown, all minimized floaters should be shifted downwards to prevent overlapping of
+// PanelTopInfoBar. See EXT-7951.
+void LLPanelTopInfoBar::onVisibilityChange(const LLSD& show)
+{
+ // this height is used as a vertical offset for ALREADY MINIMIZED floaters
+ // when PanelTopInfoBar visibility changes
+ S32 height = getRect().getHeight();
+
+ // this vertical offset is used for a start minimize position of floaters that
+ // are NOT MIMIMIZED YET
+ S32 minimize_pos_offset = 0;
+
+ if (show.asBoolean())
+ {
+ height = minimize_pos_offset = -height;
+ }
+
+ gFloaterView->shiftFloaters(0, height);
+ gFloaterView->setMinimizePositionVerticalOffset(minimize_pos_offset);
+}
+
void LLPanelTopInfoBar::draw()
{
updateParcelInfoText();
diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h
index 6e6fbc08ab..0603ee744f 100644
--- a/indra/newview/llpaneltopinfobar.h
+++ b/indra/newview/llpaneltopinfobar.h
@@ -58,6 +58,11 @@ public:
*/
void handleLoginComplete();
+ /**
+ * Called when the top info bar gets shown or hidden
+ */
+ void onVisibilityChange(const LLSD& show);
+
private:
class LLParcelChangeObserver;