diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/llui/llfloater.cpp | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/llfloater.cpp | 73 |
1 files changed, 26 insertions, 47 deletions
diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index 02a410e..12758b3 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | 5 | * Copyright (c) 2002-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -57,6 +58,8 @@ extern BOOL gNoRender; | |||
57 | 58 | ||
58 | const S32 MINIMIZED_WIDTH = 160; | 59 | const S32 MINIMIZED_WIDTH = 160; |
59 | const S32 CLOSE_BOX_FROM_TOP = 1; | 60 | const S32 CLOSE_BOX_FROM_TOP = 1; |
61 | // use this to control "jumping" behavior when Ctrl-Tabbing | ||
62 | const S32 TABBED_FLOATER_OFFSET = 0; | ||
60 | 63 | ||
61 | LLString LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = | 64 | LLString LLFloater::sButtonActiveImageNames[BUTTON_COUNT] = |
62 | { | 65 | { |
@@ -298,7 +301,6 @@ void LLFloater::init(const LLString& title, | |||
298 | mRect.getHeight() - LLPANEL_BORDER_WIDTH - close_box_size); | 301 | mRect.getHeight() - LLPANEL_BORDER_WIDTH - close_box_size); |
299 | mDragHandle = new LLDragHandleLeft("drag", drag_handle_rect, title ); | 302 | mDragHandle = new LLDragHandleLeft("drag", drag_handle_rect, title ); |
300 | } | 303 | } |
301 | mDragHandle->setSaveToXML(false); | ||
302 | addChild(mDragHandle); | 304 | addChild(mDragHandle); |
303 | 305 | ||
304 | // Resize Handle | 306 | // Resize Handle |
@@ -314,28 +316,24 @@ void LLFloater::init(const LLString& title, | |||
314 | "resizebar_left", | 316 | "resizebar_left", |
315 | LLRect( 0, mRect.getHeight(), RESIZE_BAR_THICKNESS, 0), | 317 | LLRect( 0, mRect.getHeight(), RESIZE_BAR_THICKNESS, 0), |
316 | min_width, min_height, LLResizeBar::LEFT ); | 318 | min_width, min_height, LLResizeBar::LEFT ); |
317 | mResizeBar[0]->setSaveToXML(false); | ||
318 | addChild( mResizeBar[0] ); | 319 | addChild( mResizeBar[0] ); |
319 | 320 | ||
320 | mResizeBar[1] = new LLResizeBar( | 321 | mResizeBar[1] = new LLResizeBar( |
321 | "resizebar_top", | 322 | "resizebar_top", |
322 | LLRect( 0, mRect.getHeight(), mRect.getWidth(), mRect.getHeight() - RESIZE_BAR_THICKNESS), | 323 | LLRect( 0, mRect.getHeight(), mRect.getWidth(), mRect.getHeight() - RESIZE_BAR_THICKNESS), |
323 | min_width, min_height, LLResizeBar::TOP ); | 324 | min_width, min_height, LLResizeBar::TOP ); |
324 | mResizeBar[1]->setSaveToXML(false); | ||
325 | addChild( mResizeBar[1] ); | 325 | addChild( mResizeBar[1] ); |
326 | 326 | ||
327 | mResizeBar[2] = new LLResizeBar( | 327 | mResizeBar[2] = new LLResizeBar( |
328 | "resizebar_right", | 328 | "resizebar_right", |
329 | LLRect( mRect.getWidth() - RESIZE_BAR_THICKNESS, mRect.getHeight(), mRect.getWidth(), 0), | 329 | LLRect( mRect.getWidth() - RESIZE_BAR_THICKNESS, mRect.getHeight(), mRect.getWidth(), 0), |
330 | min_width, min_height, LLResizeBar::RIGHT ); | 330 | min_width, min_height, LLResizeBar::RIGHT ); |
331 | mResizeBar[2]->setSaveToXML(false); | ||
332 | addChild( mResizeBar[2] ); | 331 | addChild( mResizeBar[2] ); |
333 | 332 | ||
334 | mResizeBar[3] = new LLResizeBar( | 333 | mResizeBar[3] = new LLResizeBar( |
335 | "resizebar_bottom", | 334 | "resizebar_bottom", |
336 | LLRect( 0, RESIZE_BAR_THICKNESS, mRect.getWidth(), 0), | 335 | LLRect( 0, RESIZE_BAR_THICKNESS, mRect.getWidth(), 0), |
337 | min_width, min_height, LLResizeBar::BOTTOM ); | 336 | min_width, min_height, LLResizeBar::BOTTOM ); |
338 | mResizeBar[3]->setSaveToXML(false); | ||
339 | addChild( mResizeBar[3] ); | 337 | addChild( mResizeBar[3] ); |
340 | 338 | ||
341 | 339 | ||
@@ -346,7 +344,6 @@ void LLFloater::init(const LLString& title, | |||
346 | min_width, | 344 | min_width, |
347 | min_height, | 345 | min_height, |
348 | LLResizeHandle::RIGHT_BOTTOM); | 346 | LLResizeHandle::RIGHT_BOTTOM); |
349 | mResizeHandle[0]->setSaveToXML(false); | ||
350 | addChild(mResizeHandle[0]); | 347 | addChild(mResizeHandle[0]); |
351 | 348 | ||
352 | mResizeHandle[1] = new LLResizeHandle( "resize", | 349 | mResizeHandle[1] = new LLResizeHandle( "resize", |
@@ -354,7 +351,6 @@ void LLFloater::init(const LLString& title, | |||
354 | min_width, | 351 | min_width, |
355 | min_height, | 352 | min_height, |
356 | LLResizeHandle::RIGHT_TOP ); | 353 | LLResizeHandle::RIGHT_TOP ); |
357 | mResizeHandle[1]->setSaveToXML(false); | ||
358 | addChild(mResizeHandle[1]); | 354 | addChild(mResizeHandle[1]); |
359 | 355 | ||
360 | mResizeHandle[2] = new LLResizeHandle( "resize", | 356 | mResizeHandle[2] = new LLResizeHandle( "resize", |
@@ -362,7 +358,6 @@ void LLFloater::init(const LLString& title, | |||
362 | min_width, | 358 | min_width, |
363 | min_height, | 359 | min_height, |
364 | LLResizeHandle::LEFT_BOTTOM ); | 360 | LLResizeHandle::LEFT_BOTTOM ); |
365 | mResizeHandle[2]->setSaveToXML(false); | ||
366 | addChild(mResizeHandle[2]); | 361 | addChild(mResizeHandle[2]); |
367 | 362 | ||
368 | mResizeHandle[3] = new LLResizeHandle( "resize", | 363 | mResizeHandle[3] = new LLResizeHandle( "resize", |
@@ -370,7 +365,6 @@ void LLFloater::init(const LLString& title, | |||
370 | min_width, | 365 | min_width, |
371 | min_height, | 366 | min_height, |
372 | LLResizeHandle::LEFT_TOP ); | 367 | LLResizeHandle::LEFT_TOP ); |
373 | mResizeHandle[3]->setSaveToXML(false); | ||
374 | addChild(mResizeHandle[3]); | 368 | addChild(mResizeHandle[3]); |
375 | } | 369 | } |
376 | else | 370 | else |
@@ -482,14 +476,14 @@ void LLFloater::setVisible( BOOL visible ) | |||
482 | 476 | ||
483 | if( !visible ) | 477 | if( !visible ) |
484 | { | 478 | { |
485 | if( gFocusMgr.childIsTopView( this ) ) | 479 | if( gFocusMgr.childIsTopCtrl( this ) ) |
486 | { | 480 | { |
487 | gFocusMgr.setTopView(NULL, NULL); | 481 | gFocusMgr.setTopCtrl(NULL); |
488 | } | 482 | } |
489 | 483 | ||
490 | if( gFocusMgr.childHasMouseCapture( this ) ) | 484 | if( gFocusMgr.childHasMouseCapture( this ) ) |
491 | { | 485 | { |
492 | gFocusMgr.setMouseCapture(NULL, NULL); | 486 | gFocusMgr.setMouseCapture(NULL); |
493 | } | 487 | } |
494 | } | 488 | } |
495 | 489 | ||
@@ -603,9 +597,9 @@ void LLFloater::close(bool app_quitting) | |||
603 | 597 | ||
604 | void LLFloater::releaseFocus() | 598 | void LLFloater::releaseFocus() |
605 | { | 599 | { |
606 | if( gFocusMgr.childIsTopView( this ) ) | 600 | if( gFocusMgr.childIsTopCtrl( this ) ) |
607 | { | 601 | { |
608 | gFocusMgr.setTopView(NULL, NULL); | 602 | gFocusMgr.setTopCtrl(NULL); |
609 | } | 603 | } |
610 | 604 | ||
611 | if( gFocusMgr.childHasKeyboardFocus( this ) ) | 605 | if( gFocusMgr.childHasKeyboardFocus( this ) ) |
@@ -615,7 +609,7 @@ void LLFloater::releaseFocus() | |||
615 | 609 | ||
616 | if( gFocusMgr.childHasMouseCapture( this ) ) | 610 | if( gFocusMgr.childHasMouseCapture( this ) ) |
617 | { | 611 | { |
618 | gFocusMgr.setMouseCapture(NULL, NULL); | 612 | gFocusMgr.setMouseCapture(NULL); |
619 | } | 613 | } |
620 | } | 614 | } |
621 | 615 | ||
@@ -1483,28 +1477,24 @@ void LLFloater::setCanResize(BOOL can_resize) | |||
1483 | "resizebar_left", | 1477 | "resizebar_left", |
1484 | LLRect( 0, mRect.getHeight(), RESIZE_BAR_THICKNESS, 0), | 1478 | LLRect( 0, mRect.getHeight(), RESIZE_BAR_THICKNESS, 0), |
1485 | mMinWidth, mMinHeight, LLResizeBar::LEFT ); | 1479 | mMinWidth, mMinHeight, LLResizeBar::LEFT ); |
1486 | mResizeBar[0]->setSaveToXML(false); | ||
1487 | addChild( mResizeBar[0] ); | 1480 | addChild( mResizeBar[0] ); |
1488 | 1481 | ||
1489 | mResizeBar[1] = new LLResizeBar( | 1482 | mResizeBar[1] = new LLResizeBar( |
1490 | "resizebar_top", | 1483 | "resizebar_top", |
1491 | LLRect( 0, mRect.getHeight(), mRect.getWidth(), mRect.getHeight() - RESIZE_BAR_THICKNESS), | 1484 | LLRect( 0, mRect.getHeight(), mRect.getWidth(), mRect.getHeight() - RESIZE_BAR_THICKNESS), |
1492 | mMinWidth, mMinHeight, LLResizeBar::TOP ); | 1485 | mMinWidth, mMinHeight, LLResizeBar::TOP ); |
1493 | mResizeBar[1]->setSaveToXML(false); | ||
1494 | addChild( mResizeBar[1] ); | 1486 | addChild( mResizeBar[1] ); |
1495 | 1487 | ||
1496 | mResizeBar[2] = new LLResizeBar( | 1488 | mResizeBar[2] = new LLResizeBar( |
1497 | "resizebar_right", | 1489 | "resizebar_right", |
1498 | LLRect( mRect.getWidth() - RESIZE_BAR_THICKNESS, mRect.getHeight(), mRect.getWidth(), 0), | 1490 | LLRect( mRect.getWidth() - RESIZE_BAR_THICKNESS, mRect.getHeight(), mRect.getWidth(), 0), |
1499 | mMinWidth, mMinHeight, LLResizeBar::RIGHT ); | 1491 | mMinWidth, mMinHeight, LLResizeBar::RIGHT ); |
1500 | mResizeBar[2]->setSaveToXML(false); | ||
1501 | addChild( mResizeBar[2] ); | 1492 | addChild( mResizeBar[2] ); |
1502 | 1493 | ||
1503 | mResizeBar[3] = new LLResizeBar( | 1494 | mResizeBar[3] = new LLResizeBar( |
1504 | "resizebar_bottom", | 1495 | "resizebar_bottom", |
1505 | LLRect( 0, RESIZE_BAR_THICKNESS, mRect.getWidth(), 0), | 1496 | LLRect( 0, RESIZE_BAR_THICKNESS, mRect.getWidth(), 0), |
1506 | mMinWidth, mMinHeight, LLResizeBar::BOTTOM ); | 1497 | mMinWidth, mMinHeight, LLResizeBar::BOTTOM ); |
1507 | mResizeBar[3]->setSaveToXML(false); | ||
1508 | addChild( mResizeBar[3] ); | 1498 | addChild( mResizeBar[3] ); |
1509 | 1499 | ||
1510 | 1500 | ||
@@ -1515,7 +1505,6 @@ void LLFloater::setCanResize(BOOL can_resize) | |||
1515 | mMinWidth, | 1505 | mMinWidth, |
1516 | mMinHeight, | 1506 | mMinHeight, |
1517 | LLResizeHandle::RIGHT_BOTTOM); | 1507 | LLResizeHandle::RIGHT_BOTTOM); |
1518 | mResizeHandle[0]->setSaveToXML(false); | ||
1519 | addChild(mResizeHandle[0]); | 1508 | addChild(mResizeHandle[0]); |
1520 | 1509 | ||
1521 | mResizeHandle[1] = new LLResizeHandle( "resize", | 1510 | mResizeHandle[1] = new LLResizeHandle( "resize", |
@@ -1523,7 +1512,6 @@ void LLFloater::setCanResize(BOOL can_resize) | |||
1523 | mMinWidth, | 1512 | mMinWidth, |
1524 | mMinHeight, | 1513 | mMinHeight, |
1525 | LLResizeHandle::RIGHT_TOP ); | 1514 | LLResizeHandle::RIGHT_TOP ); |
1526 | mResizeHandle[1]->setSaveToXML(false); | ||
1527 | addChild(mResizeHandle[1]); | 1515 | addChild(mResizeHandle[1]); |
1528 | 1516 | ||
1529 | mResizeHandle[2] = new LLResizeHandle( "resize", | 1517 | mResizeHandle[2] = new LLResizeHandle( "resize", |
@@ -1531,7 +1519,6 @@ void LLFloater::setCanResize(BOOL can_resize) | |||
1531 | mMinWidth, | 1519 | mMinWidth, |
1532 | mMinHeight, | 1520 | mMinHeight, |
1533 | LLResizeHandle::LEFT_BOTTOM ); | 1521 | LLResizeHandle::LEFT_BOTTOM ); |
1534 | mResizeHandle[2]->setSaveToXML(false); | ||
1535 | addChild(mResizeHandle[2]); | 1522 | addChild(mResizeHandle[2]); |
1536 | 1523 | ||
1537 | mResizeHandle[3] = new LLResizeHandle( "resize", | 1524 | mResizeHandle[3] = new LLResizeHandle( "resize", |
@@ -1539,7 +1526,6 @@ void LLFloater::setCanResize(BOOL can_resize) | |||
1539 | mMinWidth, | 1526 | mMinWidth, |
1540 | mMinHeight, | 1527 | mMinHeight, |
1541 | LLResizeHandle::LEFT_TOP ); | 1528 | LLResizeHandle::LEFT_TOP ); |
1542 | mResizeHandle[3]->setSaveToXML(false); | ||
1543 | addChild(mResizeHandle[3]); | 1529 | addChild(mResizeHandle[3]); |
1544 | } | 1530 | } |
1545 | mResizable = can_resize; | 1531 | mResizable = can_resize; |
@@ -2041,8 +2027,7 @@ void LLFloaterView::focusFrontFloater() | |||
2041 | void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) | 2027 | void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) |
2042 | { | 2028 | { |
2043 | S32 col = 0; | 2029 | S32 col = 0; |
2044 | LLRect snap_rect_local = getSnapRect(); | 2030 | LLRect snap_rect_local = getLocalSnapRect(); |
2045 | snap_rect_local.translate(-mRect.mLeft, -mRect.mBottom); | ||
2046 | for(S32 row = snap_rect_local.mBottom; | 2031 | for(S32 row = snap_rect_local.mBottom; |
2047 | row < snap_rect_local.getHeight() - LLFLOATER_HEADER_SIZE; | 2032 | row < snap_rect_local.getHeight() - LLFLOATER_HEADER_SIZE; |
2048 | row += LLFLOATER_HEADER_SIZE ) //loop rows | 2033 | row += LLFLOATER_HEADER_SIZE ) //loop rows |
@@ -2165,8 +2150,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out | |||
2165 | S32 screen_width = getSnapRect().getWidth(); | 2150 | S32 screen_width = getSnapRect().getWidth(); |
2166 | S32 screen_height = getSnapRect().getHeight(); | 2151 | S32 screen_height = getSnapRect().getHeight(); |
2167 | // convert to local coordinate frame | 2152 | // convert to local coordinate frame |
2168 | LLRect snap_rect_local = getSnapRect(); | 2153 | LLRect snap_rect_local = getLocalSnapRect(); |
2169 | snap_rect_local.translate(-mRect.mLeft, -mRect.mBottom); | ||
2170 | 2154 | ||
2171 | if( floater->isResizable() ) | 2155 | if( floater->isResizable() ) |
2172 | { | 2156 | { |
@@ -2207,32 +2191,27 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out | |||
2207 | 2191 | ||
2208 | void LLFloaterView::draw() | 2192 | void LLFloaterView::draw() |
2209 | { | 2193 | { |
2210 | if( getVisible() ) | 2194 | refresh(); |
2211 | { | ||
2212 | refresh(); | ||
2213 | |||
2214 | // hide focused floater if in cycle mode, so that it can be drawn on top | ||
2215 | LLFloater* focused_floater = getFocusedFloater(); | ||
2216 | BOOL floater_visible = FALSE; | ||
2217 | if (mFocusCycleMode && focused_floater) | ||
2218 | { | ||
2219 | floater_visible = focused_floater->getVisible(); | ||
2220 | focused_floater->setVisible(FALSE); | ||
2221 | } | ||
2222 | 2195 | ||
2223 | // And actually do the draw | 2196 | // hide focused floater if in cycle mode, so that it can be drawn on top |
2224 | LLView::draw(); | 2197 | LLFloater* focused_floater = getFocusedFloater(); |
2225 | 2198 | ||
2226 | // manually draw focused floater on top when in cycle mode | 2199 | if (mFocusCycleMode && focused_floater) |
2227 | if (mFocusCycleMode && focused_floater) | 2200 | { |
2201 | child_list_const_iter_t child_it = getChildList()->begin(); | ||
2202 | for (;child_it != getChildList()->end(); ++child_it) | ||
2228 | { | 2203 | { |
2229 | // draw focused item on top for better feedback | 2204 | if ((*child_it) != focused_floater) |
2230 | focused_floater->setVisible(floater_visible); | ||
2231 | if (floater_visible) | ||
2232 | { | 2205 | { |
2233 | drawChild(focused_floater); | 2206 | drawChild(*child_it); |
2234 | } | 2207 | } |
2235 | } | 2208 | } |
2209 | |||
2210 | drawChild(focused_floater, -TABBED_FLOATER_OFFSET, TABBED_FLOATER_OFFSET); | ||
2211 | } | ||
2212 | else | ||
2213 | { | ||
2214 | LLView::draw(); | ||
2236 | } | 2215 | } |
2237 | } | 2216 | } |
2238 | 2217 | ||