diff options
author | Steven Bennetts <steve@lindenlab.com> | 2007-03-16 20:39:40 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2007-03-16 20:39:40 +0000 |
commit | 5e9e67cb2d1d3dfc82dfe96103270b2341991ddd (patch) | |
tree | 2df2a064523b2bffef6ff7566399c76b1f2cc196 /indra/llui | |
parent | 1ada34fc0c5dc20bffba231ef513b569dbec32ea (diff) |
merge -r 59028:59178 maintenance -> release.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfloater.cpp | 19 | ||||
-rw-r--r-- | indra/llui/llmenugl.cpp | 10 | ||||
-rw-r--r-- | indra/llui/llscrollbar.cpp | 32 |
3 files changed, 33 insertions, 28 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 3b855a6360..0922de70af 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -489,6 +489,15 @@ void LLFloater::setVisible( BOOL visible ) void LLFloater::open() /* Flawfinder: ignore */ { + if (mSoundFlags != SILENT + // don't play open sound for hosted (tabbed) windows + && !getHost() + && !sHostp + && (!getVisible() || isMinimized())) + { + make_ui_sound("UISndWindowOpen"); + } + //RN: for now, we don't allow rehosting from one multifloater to another // just need to fix the bugs LLMultiFloater* hostp = getHost(); @@ -509,14 +518,6 @@ void LLFloater::open() /* Flawfinder: ignore */ setVisibleAndFrontmost(mAutoFocus); } - if (mSoundFlags != SILENT) - { - if (!getVisible() || isMinimized()) - { - make_ui_sound("UISndWindowOpen"); - } - } - onOpen(); } @@ -535,6 +536,7 @@ void LLFloater::close(bool app_quitting) if (mSoundFlags != SILENT && getVisible() + && !getHost() && !app_quitting) { make_ui_sound("UISndWindowClose"); @@ -2458,7 +2460,6 @@ void LLMultiFloater::open() /* Flawfinder: ignore */ if (mTabContainer->getTabCount() > 0) { LLFloater::open(); /* Flawfinder: ignore */ - resizeToContents(); } else { diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index a7c9cf0f92..d46a866e2b 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1647,7 +1647,8 @@ BOOL LLMenuItemBranchDownGL::handleAcceleratorKey(KEY key, MASK mask) BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) { BOOL menu_open = mBranch->getVisible(); - if (getHighlight() && getMenu()->getVisible()) + // don't do keyboard navigation of top-level menus unless in keyboard mode, or menu expanded + if (getHighlight() && getMenu()->getVisible() && (isActive() || LLMenuGL::getKeyboardMode())) { if (key == KEY_LEFT) { @@ -4144,9 +4145,9 @@ void LLMenuBarGL::checkMenuTrigger() BOOL LLMenuBarGL::jumpKeysActive() { - // require item to be highlighted to activate key triggers - // as menu bars are always visible - return getHighlightedItem() && LLMenuGL::jumpKeysActive(); + // require user to be in keyboard navigation mode to activate key triggers + // as menu bars are always visible and it is easy to leave the mouse cursor over them + return LLMenuGL::getKeyboardMode() && getHighlightedItem() && LLMenuGL::jumpKeysActive(); } // rearrange the child rects so they fit the shape of the menu bar. @@ -4404,6 +4405,7 @@ BOOL LLMenuHolderGL::hideMenus() BOOL menu_visible = hasVisibleMenu(); if (menu_visible) { + LLMenuGL::setKeyboardMode(FALSE); // clicked off of menu, hide them all for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 4a5ae1dadf..c21bbdcc75 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -386,21 +386,23 @@ BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks) BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *carge_data, EAcceptance *accept, LLString &tooltip_msg) { - if (!drop) - { - //TODO: refactor this - S32 variable_lines = getDocPosMax(); - S32 pos = (VERTICAL == mOrientation) ? y : x; - S32 thumb_length = (VERTICAL == mOrientation) ? mThumbRect.getHeight() : mThumbRect.getWidth(); - S32 thumb_track_length = (VERTICAL == mOrientation) ? (mRect.getHeight() - 2 * SCROLLBAR_SIZE) : (mRect.getWidth() - 2 * SCROLLBAR_SIZE); - S32 usable_track_length = thumb_track_length - thumb_length; - F32 ratio = (VERTICAL == mOrientation) ? F32(pos - SCROLLBAR_SIZE - thumb_length) / usable_track_length - : F32(pos - SCROLLBAR_SIZE) / usable_track_length; - S32 new_pos = (VERTICAL == mOrientation) ? llclamp( S32(variable_lines - ratio * variable_lines + 0.5f), 0, variable_lines ) - : llclamp( S32(ratio * variable_lines + 0.5f), 0, variable_lines ); - changeLine( new_pos - mDocPos, TRUE ); - } - return TRUE; + // enable this to get drag and drop to control scrollbars + //if (!drop) + //{ + // //TODO: refactor this + // S32 variable_lines = getDocPosMax(); + // S32 pos = (VERTICAL == mOrientation) ? y : x; + // S32 thumb_length = (VERTICAL == mOrientation) ? mThumbRect.getHeight() : mThumbRect.getWidth(); + // S32 thumb_track_length = (VERTICAL == mOrientation) ? (mRect.getHeight() - 2 * SCROLLBAR_SIZE) : (mRect.getWidth() - 2 * SCROLLBAR_SIZE); + // S32 usable_track_length = thumb_track_length - thumb_length; + // F32 ratio = (VERTICAL == mOrientation) ? F32(pos - SCROLLBAR_SIZE - thumb_length) / usable_track_length + // : F32(pos - SCROLLBAR_SIZE) / usable_track_length; + // S32 new_pos = (VERTICAL == mOrientation) ? llclamp( S32(variable_lines - ratio * variable_lines + 0.5f), 0, variable_lines ) + // : llclamp( S32(ratio * variable_lines + 0.5f), 0, variable_lines ); + // changeLine( new_pos - mDocPos, TRUE ); + //} + //return TRUE; + return FALSE; } BOOL LLScrollbar::handleMouseUp(S32 x, S32 y, MASK mask) |