From d54c86e1df3de7c55c4f943a9d69e4475ef13458 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sun, 4 Mar 2012 23:15:53 -0600 Subject: [PATCH] UI polish (scrollbar focus, tearoff menus), plus drag and drop fix. --- indra/llui/llmenugl.cpp | 18 ++++++++---------- indra/llui/lltexteditor.cpp | 3 ++- indra/newview/dohexeditor.cpp | 3 ++- indra/newview/llinventorybridge.cpp | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 3a47db9e6..50c56f9ed 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -4671,7 +4671,7 @@ void LLMenuHolderGL::setActivatedItem(LLMenuItemGL* item) LLTearOffMenu::LLTearOffMenu(LLMenuGL* menup) : LLFloater(menup->getName(), LLRect(0, 100, 100, 0), menup->getLabel(), FALSE, DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT, FALSE, FALSE) { - //S32 floater_header_size = LLFLOATER_HEADER_SIZE; + S32 floater_header_size = LLFLOATER_HEADER_SIZE; setName(menup->getName()); setTitle(menup->getLabel()); @@ -4684,16 +4684,20 @@ LLTearOffMenu::LLTearOffMenu(LLMenuGL* menup) : LLRect rect; menup->localRectToOtherView(LLRect(-1, menup->getRect().getHeight(), menup->getRect().getWidth() + 3, 0), &rect, gFloaterView); // make sure this floater is big enough for menu - mTargetHeight = (F32)(rect.getHeight() + LLFLOATER_HEADER_SIZE + 5); + mTargetHeight = (F32)(rect.getHeight() + floater_header_size); reshape(rect.getWidth(), rect.getHeight()); setRect(rect); // attach menu to floater - menup->setFollowsAll(); + menup->setFollows(FOLLOWS_BOTTOM|FOLLOWS_LEFT); mOldParent = menup->getParent(); addChild(menup); menup->setVisible(TRUE); - menup->translate(-menup->getRect().mLeft + 1, -menup->getRect().mBottom + 1); + + LLRect menu_rect = menup->getRect(); + menu_rect.setOriginAndSize( 1, 1, + menu_rect.getWidth(), menu_rect.getHeight()); + menup->setRect(menu_rect); menup->setDropShadowed(FALSE); mMenu = menup; @@ -4713,12 +4717,6 @@ void LLTearOffMenu::draw() // animate towards target height reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(0.05f)))); } - else - { - // when in stasis, remain big enough to hold menu contents - mTargetHeight = (F32)(mMenu->getRect().getHeight() + LLFLOATER_HEADER_SIZE + 4); - reshape(mMenu->getRect().getWidth() + 3, mMenu->getRect().getHeight() + LLFLOATER_HEADER_SIZE + 5); - } LLFloater::draw(); } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index fc877ba59..4bc9ee1fc 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1277,7 +1277,8 @@ BOOL LLTextEditor::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_ BOOL LLTextEditor::handleScrollWheel(S32 x, S32 y, S32 clicks) { // Pretend the mouse is over the scrollbar - return mScrollbar->handleScrollWheel( 0, 0, clicks ); + mScrollbar->handleScrollWheel( 0, 0, clicks ); + return TRUE; } BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) diff --git a/indra/newview/dohexeditor.cpp b/indra/newview/dohexeditor.cpp index ce0b91bdd..046360785 100644 --- a/indra/newview/dohexeditor.cpp +++ b/indra/newview/dohexeditor.cpp @@ -269,7 +269,8 @@ U32 DOHexEditor::getProperSelectionEnd() BOOL DOHexEditor::handleScrollWheel(S32 x, S32 y, S32 clicks) { - return mScrollbar->handleScrollWheel( 0, 0, clicks ); + mScrollbar->handleScrollWheel( 0, 0, clicks ); + return TRUE; } BOOL DOHexEditor::handleMouseDown(S32 x, S32 y, MASK mask) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3ed9560d5..4b5ecbfc4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3374,7 +3374,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } // If an item is being dragged between windows, unselect everything in the active window // so that we don't follow the selection to its new location (which is very annoying). - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); if (active_panel) { LLInventoryPanel* panel = dynamic_cast(mInventoryPanel.get()); @@ -3386,7 +3386,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // FAVORITES folder // (copy the item) - else if (move_is_into_favorites) + if (move_is_into_favorites) { dropToFavorites(inv_item); }