diff options
author | Jacek Antonelli | 2008-08-15 23:45:29 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:29 -0500 |
commit | 7bdb4845afdd157f95281293803567090e3f992a (patch) | |
tree | fbcada1c227d7407f9f37ccba360bfe6326d9c5e /linden/indra/llui/llpanel.cpp | |
parent | Second Life viewer sources 1.19.0.0 (diff) | |
download | meta-impy-7bdb4845afdd157f95281293803567090e3f992a.zip meta-impy-7bdb4845afdd157f95281293803567090e3f992a.tar.gz meta-impy-7bdb4845afdd157f95281293803567090e3f992a.tar.bz2 meta-impy-7bdb4845afdd157f95281293803567090e3f992a.tar.xz |
Second Life viewer sources 1.19.0.2
Diffstat (limited to 'linden/indra/llui/llpanel.cpp')
-rw-r--r-- | linden/indra/llui/llpanel.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp index af8aa21..7430e50 100644 --- a/linden/indra/llui/llpanel.cpp +++ b/linden/indra/llui/llpanel.cpp | |||
@@ -356,6 +356,13 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) | |||
356 | if( getVisible() && getEnabled() && | 356 | if( getVisible() && getEnabled() && |
357 | gFocusMgr.childHasKeyboardFocus(this) && !called_from_parent ) | 357 | gFocusMgr.childHasKeyboardFocus(this) && !called_from_parent ) |
358 | { | 358 | { |
359 | // handle user hitting ESC to defocus | ||
360 | if (key == KEY_ESCAPE) | ||
361 | { | ||
362 | gFocusMgr.setKeyboardFocus(NULL); | ||
363 | return TRUE; | ||
364 | } | ||
365 | |||
359 | LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); | 366 | LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); |
360 | // If we have a default button, click it when | 367 | // If we have a default button, click it when |
361 | // return is pressed, unless current focus is a return-capturing button | 368 | // return is pressed, unless current focus is a return-capturing button |
@@ -1322,6 +1329,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor | |||
1322 | } | 1329 | } |
1323 | } | 1330 | } |
1324 | } | 1331 | } |
1332 | layout_stackp->updateLayout(); | ||
1325 | 1333 | ||
1326 | return layout_stackp; | 1334 | return layout_stackp; |
1327 | } | 1335 | } |
@@ -1442,10 +1450,14 @@ void LLLayoutStack::updateLayout(BOOL force_resize) | |||
1442 | { | 1450 | { |
1443 | // panels that are not fully visible do not count towards shrink headroom | 1451 | // panels that are not fully visible do not count towards shrink headroom |
1444 | if ((*panel_it)->mVisibleAmt < 1.f) | 1452 | if ((*panel_it)->mVisibleAmt < 1.f) |
1453 | { | ||
1445 | continue; | 1454 | continue; |
1455 | } | ||
1446 | // if currently resizing a panel or the panel is flagged as not automatically resizing | 1456 | // if currently resizing a panel or the panel is flagged as not automatically resizing |
1447 | // only track total available headroom, but don't use it for automatic resize logic | 1457 | // only track total available headroom, but don't use it for automatic resize logic |
1448 | if ((*panel_it)->mResizeBar->hasMouseCapture() || (!(*panel_it)->mAutoResize && !force_resize)) | 1458 | if ((*panel_it)->mResizeBar->hasMouseCapture() |
1459 | || (!(*panel_it)->mAutoResize | ||
1460 | && !force_resize)) | ||
1449 | { | 1461 | { |
1450 | if (mOrientation == HORIZONTAL) | 1462 | if (mOrientation == HORIZONTAL) |
1451 | { | 1463 | { |
@@ -1498,7 +1510,9 @@ void LLLayoutStack::updateLayout(BOOL force_resize) | |||
1498 | S32 delta_size = 0; | 1510 | S32 delta_size = 0; |
1499 | 1511 | ||
1500 | // if panel can automatically resize (not animating, and resize flag set)... | 1512 | // if panel can automatically resize (not animating, and resize flag set)... |
1501 | if ((*panel_it)->mVisibleAmt == 1.f && (force_resize || (*panel_it)->mAutoResize) && !(*panel_it)->mResizeBar->hasMouseCapture()) | 1513 | if ((*panel_it)->mVisibleAmt == 1.f |
1514 | && (force_resize || (*panel_it)->mAutoResize) | ||
1515 | && !(*panel_it)->mResizeBar->hasMouseCapture()) | ||
1502 | { | 1516 | { |
1503 | if (mOrientation == HORIZONTAL) | 1517 | if (mOrientation == HORIZONTAL) |
1504 | { | 1518 | { |
@@ -1506,7 +1520,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) | |||
1506 | if (pixels_to_distribute < 0) | 1520 | if (pixels_to_distribute < 0) |
1507 | { | 1521 | { |
1508 | // shrink proportionally to amount over minimum | 1522 | // shrink proportionally to amount over minimum |
1509 | delta_size = llround((F32)pixels_to_distribute * (F32)(cur_width - (*panel_it)->mMinWidth) / (F32)shrink_headroom_available); | 1523 | delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * (F32)(cur_width - (*panel_it)->mMinWidth) / (F32)shrink_headroom_available) : 0; |
1510 | } | 1524 | } |
1511 | else | 1525 | else |
1512 | { | 1526 | { |
@@ -1525,7 +1539,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) | |||
1525 | if (pixels_to_distribute < 0) | 1539 | if (pixels_to_distribute < 0) |
1526 | { | 1540 | { |
1527 | // shrink proportionally to amount over minimum | 1541 | // shrink proportionally to amount over minimum |
1528 | delta_size = llround((F32)pixels_to_distribute * (F32)(cur_height - (*panel_it)->mMinHeight) / (F32)shrink_headroom_available); | 1542 | delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * (F32)(cur_height - (*panel_it)->mMinHeight) / (F32)shrink_headroom_available) : 0; |
1529 | } | 1543 | } |
1530 | else | 1544 | else |
1531 | { | 1545 | { |
@@ -1617,9 +1631,10 @@ void LLLayoutStack::updateLayout(BOOL force_resize) | |||
1617 | } | 1631 | } |
1618 | 1632 | ||
1619 | // not enough room to fit existing contents | 1633 | // not enough room to fit existing contents |
1620 | if (!force_resize | 1634 | if (force_resize == FALSE |
1621 | && ((cur_y != -mPanelSpacing) | 1635 | // layout did not complete by reaching target position |
1622 | || (cur_x != mRect.getWidth() + mPanelSpacing))) | 1636 | && ((mOrientation == VERTICAL && cur_y != -mPanelSpacing) |
1637 | || (mOrientation == HORIZONTAL && cur_x != mRect.getWidth() + mPanelSpacing))) | ||
1623 | { | 1638 | { |
1624 | // do another layout pass with all stacked elements contributing | 1639 | // do another layout pass with all stacked elements contributing |
1625 | // even those that don't usually resize | 1640 | // even those that don't usually resize |