summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2008-04-03 18:43:54 +0000
committerJames Cook <james@lindenlab.com>2008-04-03 18:43:54 +0000
commit55c25229b79b1755c989e5996c8e8d118f369721 (patch)
tree1fa882bc7e11dc8aec031d5e268131809874168a /indra/llui
parentb3fcfa16ba8b984163c38904e165052a34be6dab (diff)
svn merge -r 83778:83944 maint-ui-10-merge
QAR-442
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfloater.cpp37
-rw-r--r--indra/llui/llfloater.h1
2 files changed, 27 insertions, 11 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index f8882c5ebf..a6c35b67a8 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -130,8 +130,9 @@ LLFloaterView* gFloaterView = NULL;
LLFloater::LLFloater() :
//FIXME: we should initialize *all* member variables here
mResizable(FALSE),
- mDragOnLeft(FALSE)
-
+ mDragOnLeft(FALSE),
+ mMinWidth(0),
+ mMinHeight(0)
{
// automatically take focus when opened
mAutoFocus = TRUE;
@@ -2329,7 +2330,9 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list)
LLMultiFloater::LLMultiFloater() :
mTabContainer(NULL),
mTabPos(LLTabContainer::TOP),
- mAutoResize(TRUE)
+ mAutoResize(TRUE),
+ mOrigMinWidth(0),
+ mOrigMinHeight(0)
{
}
@@ -2337,7 +2340,9 @@ LLMultiFloater::LLMultiFloater() :
LLMultiFloater::LLMultiFloater(LLTabContainer::TabPosition tab_pos) :
mTabContainer(NULL),
mTabPos(tab_pos),
- mAutoResize(TRUE)
+ mAutoResize(TRUE),
+ mOrigMinWidth(0),
+ mOrigMinHeight(0)
{
}
@@ -2346,7 +2351,9 @@ LLMultiFloater::LLMultiFloater(const LLString &name) :
LLFloater(name),
mTabContainer(NULL),
mTabPos(LLTabContainer::TOP),
- mAutoResize(FALSE)
+ mAutoResize(FALSE),
+ mOrigMinWidth(0),
+ mOrigMinHeight(0)
{
}
@@ -2358,7 +2365,9 @@ LLMultiFloater::LLMultiFloater(
LLFloater(name, rect, name),
mTabContainer(NULL),
mTabPos(LLTabContainer::TOP),
- mAutoResize(auto_resize)
+ mAutoResize(auto_resize),
+ mOrigMinWidth(0),
+ mOrigMinHeight(0)
{
mTabContainer = new LLTabContainer("Preview Tabs",
LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0),
@@ -2382,7 +2391,9 @@ LLMultiFloater::LLMultiFloater(
LLFloater(name, rect_control, name),
mTabContainer(NULL),
mTabPos(tab_pos),
- mAutoResize(auto_resize)
+ mAutoResize(auto_resize),
+ mOrigMinWidth(0),
+ mOrigMinHeight(0)
{
mTabContainer = new LLTabContainer("Preview Tabs",
LLRect(LLPANEL_BORDER_WIDTH, getRect().getHeight() - LLFLOATER_HEADER_SIZE, getRect().getWidth() - LLPANEL_BORDER_WIDTH, 0),
@@ -2756,6 +2767,9 @@ void LLMultiFloater::setCanResize(BOOL can_resize)
BOOL LLMultiFloater::postBuild()
{
+ // remember any original xml minimum size
+ getResizeLimits(&mOrigMinWidth, &mOrigMinHeight);
+
if (mTabContainer)
{
return TRUE;
@@ -2773,10 +2787,11 @@ BOOL LLMultiFloater::postBuild()
void LLMultiFloater::updateResizeLimits()
{
- S32 new_min_width = 0;
- S32 new_min_height = 0;
- S32 tab_idx;
- for (tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx)
+ // initialize minimum size constraint to the original xml values.
+ S32 new_min_width = mOrigMinWidth;
+ S32 new_min_height = mOrigMinHeight;
+ // possibly increase minimum size constraint due to children's minimums.
+ for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx)
{
LLFloater* floaterp = (LLFloater*)mTabContainer->getPanelByIndex(tab_idx);
if (floaterp)
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 360d8093e5..e722d5ad07 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -411,6 +411,7 @@ protected:
LLTabContainer::TabPosition mTabPos;
BOOL mAutoResize;
+ S32 mOrigMinWidth, mOrigMinHeight; // logically const but initialized late
};
// visibility policy specialized for floaters