aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llfloater.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:37 -0500
committerJacek Antonelli2008-08-15 23:45:37 -0500
commit31ba05810c641f14e8ab5da8ad2aaf527779f6c1 (patch)
treec4b8d635dfb657fa4cfee7c285f8cadbf24afa90 /linden/indra/llui/llfloater.cpp
parentSecond Life viewer sources 1.19.1.1 (diff)
downloadmeta-impy-31ba05810c641f14e8ab5da8ad2aaf527779f6c1.zip
meta-impy-31ba05810c641f14e8ab5da8ad2aaf527779f6c1.tar.gz
meta-impy-31ba05810c641f14e8ab5da8ad2aaf527779f6c1.tar.bz2
meta-impy-31ba05810c641f14e8ab5da8ad2aaf527779f6c1.tar.xz
Second Life viewer sources 1.19.1.2
Diffstat (limited to 'linden/indra/llui/llfloater.cpp')
-rw-r--r--linden/indra/llui/llfloater.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp
index 493e68f..1e825d3 100644
--- a/linden/indra/llui/llfloater.cpp
+++ b/linden/indra/llui/llfloater.cpp
@@ -154,7 +154,7 @@ LLFloater::LLFloater(const LLString& name)
154 mButtons[i] = NULL; 154 mButtons[i] = NULL;
155 } 155 }
156 LLString title; // null string 156 LLString title; // null string
157 init(title, FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, TRUE, TRUE); // defaults 157 initFloater(title, FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, TRUE, TRUE); // defaults
158} 158}
159 159
160 160
@@ -173,7 +173,7 @@ LLFloater::LLFloater(const LLString& name, const LLRect& rect, const LLString& t
173 mButtonsEnabled[i] = FALSE; 173 mButtonsEnabled[i] = FALSE;
174 mButtons[i] = NULL; 174 mButtons[i] = NULL;
175 } 175 }
176 init( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); 176 initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn);
177} 177}
178 178
179LLFloater::LLFloater(const LLString& name, const LLString& rect_control, const LLString& title, 179LLFloater::LLFloater(const LLString& name, const LLString& rect_control, const LLString& title,
@@ -191,12 +191,12 @@ LLFloater::LLFloater(const LLString& name, const LLString& rect_control, const L
191 mButtonsEnabled[i] = FALSE; 191 mButtonsEnabled[i] = FALSE;
192 mButtons[i] = NULL; 192 mButtons[i] = NULL;
193 } 193 }
194 init( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn); 194 initFloater( title, resizable, min_width, min_height, drag_on_left, minimizable, close_btn);
195} 195}
196 196
197 197
198// Note: Floaters constructed from XML call init() twice! 198// Note: Floaters constructed from XML call init() twice!
199void LLFloater::init(const LLString& title, 199void LLFloater::initFloater(const LLString& title,
200 BOOL resizable, S32 min_width, S32 min_height, 200 BOOL resizable, S32 min_width, S32 min_height,
201 BOOL drag_on_left, BOOL minimizable, BOOL close_btn) 201 BOOL drag_on_left, BOOL minimizable, BOOL close_btn)
202{ 202{
@@ -576,6 +576,11 @@ void LLFloater::close(bool app_quitting)
576 } 576 }
577} 577}
578 578
579/*virtual*/
580void LLFloater::reshape(S32 width, S32 height, BOOL called_from_parent)
581{
582 LLPanel::reshape(width, height, called_from_parent);
583}
579 584
580void LLFloater::releaseFocus() 585void LLFloater::releaseFocus()
581{ 586{
@@ -777,8 +782,6 @@ void LLFloater::setMinimized(BOOL minimize)
777 { 782 {
778 mExpandedRect = getRect(); 783 mExpandedRect = getRect();
779 784
780 reshape( MINIMIZED_WIDTH, LLFLOATER_HEADER_SIZE, TRUE);
781
782 // If the floater has been dragged while minimized in the 785 // If the floater has been dragged while minimized in the
783 // past, then locate it at its previous minimized location. 786 // past, then locate it at its previous minimized location.
784 // Otherwise, ask the view for a minimize position. 787 // Otherwise, ask the view for a minimize position.
@@ -841,6 +844,9 @@ void LLFloater::setMinimized(BOOL minimize)
841 releaseFocus(); 844 releaseFocus();
842 845
843 mMinimized = TRUE; 846 mMinimized = TRUE;
847
848 // Reshape *after* setting mMinimized
849 reshape( MINIMIZED_WIDTH, LLFLOATER_HEADER_SIZE, TRUE);
844 } 850 }
845 else 851 else
846 { 852 {
@@ -853,7 +859,6 @@ void LLFloater::setMinimized(BOOL minimize)
853 mPreviousMinimizedBottom = currentRect.mBottom; 859 mPreviousMinimizedBottom = currentRect.mBottom;
854 } 860 }
855 861
856 reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
857 setOrigin( mExpandedRect.mLeft, mExpandedRect.mBottom ); 862 setOrigin( mExpandedRect.mLeft, mExpandedRect.mBottom );
858 863
859 if (mButtonsEnabled[BUTTON_RESTORE]) 864 if (mButtonsEnabled[BUTTON_RESTORE])
@@ -894,6 +899,9 @@ void LLFloater::setMinimized(BOOL minimize)
894 } 899 }
895 900
896 mMinimized = FALSE; 901 mMinimized = FALSE;
902
903 // Reshape *after* setting mMinimized
904 reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
897 } 905 }
898 make_ui_sound("UISndWindowClose"); 906 make_ui_sound("UISndWindowClose");
899 updateButtons(); 907 updateButtons();
@@ -1633,11 +1641,11 @@ LLFloaterView::LLFloaterView( const LLString& name, const LLRect& rect )
1633// By default, adjust vertical. 1641// By default, adjust vertical.
1634void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) 1642void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
1635{ 1643{
1636 reshape(width, height, called_from_parent, ADJUST_VERTICAL_YES); 1644 reshapeFloater(width, height, called_from_parent, ADJUST_VERTICAL_YES);
1637} 1645}
1638 1646
1639// When reshaping this view, make the floaters follow their closest edge. 1647// When reshaping this view, make the floaters follow their closest edge.
1640void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical) 1648void LLFloaterView::reshapeFloater(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical)
1641{ 1649{
1642 S32 old_width = getRect().getWidth(); 1650 S32 old_width = getRect().getWidth();
1643 S32 old_height = getRect().getHeight(); 1651 S32 old_height = getRect().getHeight();
@@ -2894,7 +2902,7 @@ void LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor
2894 setRect(rect); 2902 setRect(rect);
2895 setName(name); 2903 setName(name);
2896 2904
2897 init(title, 2905 initFloater(title,
2898 resizable, 2906 resizable,
2899 min_width, 2907 min_width,
2900 min_height, 2908 min_height,