From 4610e911c959cdd21728822ae80b9e717ccd3012 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Tue, 19 Jan 2010 16:39:03 +0200 Subject: working on floaters rezise-position bugs: EXT-4414, EXT-2625 --HG-- branch : product-engine --- indra/llui/llfloater.cpp | 15 +++----- indra/llui/llresizehandle.cpp | 81 +++++++++++++++++++++---------------------- 2 files changed, 44 insertions(+), 52 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a17e306325..194325cc20 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2360,7 +2360,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out LLRect::tCoordType screen_width = getSnapRect().getWidth(); LLRect::tCoordType screen_height = getSnapRect().getHeight(); - + // only automatically resize non-minimized, resizable floaters if( floater->isResizable() && !floater->isMinimized() ) { @@ -2385,16 +2385,11 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out new_width = llmax(new_width, min_width); new_height = llmax(new_height, min_height); - floater->reshape( new_width, new_height, TRUE ); - if (floater->followsRight()) - { - floater->translate(old_width - new_width, 0); - } + LLRect new_rect; + new_rect.setLeftTopAndSize(view_rect.mTop,view_rect.mLeft,new_width, new_height); - if (floater->followsTop()) - { - floater->translate(0, old_height - new_height); - } + floater->reshape( new_width, new_height, TRUE ); + floater->setRect(new_rect); } } diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp index 6239a8f721..3df09d124a 100644 --- a/indra/llui/llresizehandle.cpp +++ b/indra/llui/llresizehandle.cpp @@ -124,7 +124,7 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) { // Make sure the mouse in still over the application. We don't want to make the parent // so big that we can't see the resize handle any more. - + S32 screen_x; S32 screen_y; localPointToScreen(x, y, &screen_x, &screen_y); @@ -146,68 +146,61 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) LLRect scaled_rect = orig_rect; S32 delta_x = screen_x - mDragLastScreenX; S32 delta_y = screen_y - mDragLastScreenY; + + if(delta_x == 0 && delta_y == 0) + return FALSE; + LLCoordGL mouse_dir; // use hysteresis on mouse motion to preserve user intent when mouse stops moving mouse_dir.mX = (screen_x == mLastMouseScreenX) ? mLastMouseDir.mX : screen_x - mLastMouseScreenX; mouse_dir.mY = (screen_y == mLastMouseScreenY) ? mLastMouseDir.mY : screen_y - mLastMouseScreenY; + mLastMouseScreenX = screen_x; mLastMouseScreenY = screen_y; mLastMouseDir = mouse_dir; - S32 x_multiple = 1; - S32 y_multiple = 1; - switch( mCorner ) - { - case LEFT_TOP: - x_multiple = -1; - y_multiple = 1; - break; - case LEFT_BOTTOM: - x_multiple = -1; - y_multiple = -1; - break; - case RIGHT_TOP: - x_multiple = 1; - y_multiple = 1; - break; - case RIGHT_BOTTOM: - x_multiple = 1; - y_multiple = -1; - break; - } + S32 new_width = orig_rect.getWidth(); + S32 new_height = orig_rect.getHeight(); - S32 new_width = orig_rect.getWidth() + x_multiple * delta_x; - if( new_width < mMinWidth ) - { - new_width = mMinWidth; - delta_x = x_multiple * (mMinWidth - orig_rect.getWidth()); - } - - S32 new_height = orig_rect.getHeight() + y_multiple * delta_y; - if( new_height < mMinHeight ) - { - new_height = mMinHeight; - delta_y = y_multiple * (mMinHeight - orig_rect.getHeight()); - } + S32 new_pos_x = orig_rect.mLeft; + S32 new_pos_y = orig_rect.mTop; switch( mCorner ) { - case LEFT_TOP: - scaled_rect.translate(delta_x, 0); + case LEFT_TOP: + new_width-=delta_x; + new_height+=delta_y; + new_pos_x+=delta_x; + new_pos_y+=delta_y; break; case LEFT_BOTTOM: - scaled_rect.translate(delta_x, delta_y); + new_width-=delta_x; + new_height-=delta_y; + new_pos_x+=delta_x; break; case RIGHT_TOP: + new_width+=delta_x; + new_height+=delta_y; + new_pos_y+=delta_y; break; case RIGHT_BOTTOM: - scaled_rect.translate(0, delta_y); + new_width+=delta_x; + new_height-=delta_y; break; } + new_width = llmax(new_width,mMinWidth); + new_height = llmax(new_height,mMinHeight); + + LLRect::tCoordType screen_width = resizing_view->getParent()->getSnapRect().getWidth(); + LLRect::tCoordType screen_height = resizing_view->getParent()->getSnapRect().getHeight(); + + new_width = llmin(new_width, screen_width); + new_height = llmin(new_height, screen_height); + // temporarily set new parent rect - scaled_rect.mRight = scaled_rect.mLeft + new_width; - scaled_rect.mTop = scaled_rect.mBottom + new_height; + scaled_rect.setLeftTopAndSize(new_pos_x,new_pos_y,new_width,new_height); + resizing_view->setRect(scaled_rect); LLView* snap_view = NULL; @@ -258,7 +251,11 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) resizing_view->setRect(orig_rect); // translate and scale to new shape - resizing_view->setShape(scaled_rect, true); + resizing_view->reshape(scaled_rect.getWidth(),scaled_rect.getHeight()); + resizing_view->setRect(scaled_rect); + //set shape to handle dependent floaters... + resizing_view->handleReshape(scaled_rect, false); + // update last valid mouse cursor position based on resized view's actual size LLRect new_rect = resizing_view->getRect(); -- cgit v1.2.3 From ac8f5e6f91dab3c3cb9c2fb2ed0274e71f17f1bb Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Tue, 19 Jan 2010 18:23:42 +0200 Subject: fix for low EXT-4464 There is no visual indication of current selection while traversing Group Profile accordion using keyboard actually that was done for some reason... but I really really really don't understand them --HG-- branch : product-engine --- indra/llui/llaccordionctrltab.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 9d6ba57c29..4bfe44135a 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -157,7 +157,8 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw() // because the user's mental model of focus is that it goes away after // the accordion is closed. if (getParent()->hasFocus() - && !(collapsible && !expanded)) + /*&& !(collapsible && !expanded)*/ // WHY?? + ) { mImageHeaderFocused->draw(0,0,width,height); } -- cgit v1.2.3 From e761c0ece7e58a4d3c15f445b41670b90023a4cf Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Wed, 20 Jan 2010 19:06:05 +0200 Subject: fix for major EXT-4414 Floaters can be expanded over bottom bar left<->top...:) --HG-- branch : product-engine --- indra/llui/llfloater.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 3734a22f7e..4f519afa06 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2388,10 +2388,12 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out new_height = llmax(new_height, min_height); LLRect new_rect; - new_rect.setLeftTopAndSize(view_rect.mTop,view_rect.mLeft,new_width, new_height); + new_rect.setLeftTopAndSize(view_rect.mLeft,view_rect.mTop,new_width, new_height); floater->reshape( new_width, new_height, TRUE ); floater->setRect(new_rect); + + floater->translateIntoRect( getLocalRect(), false ); } } -- cgit v1.2.3 From da00631c638acbf3d3b6ecbe5edb5abecf03252c Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Wed, 20 Jan 2010 18:21:54 +0200 Subject: Update for low bug EXT-4371 - Text from search history drop-down list merge with landmarks on 'Favorites Bar'. Made border customisable in combo box. --HG-- branch : product-engine --- indra/llui/llscrolllistctrl.cpp | 5 ++--- indra/llui/llscrolllistctrl.h | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index a53a30b501..4e84013db0 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -142,6 +142,7 @@ LLScrollListCtrl::Params::Params() contents(""), scroll_bar_bg_visible("scroll_bar_bg_visible"), scroll_bar_bg_color("scroll_bar_bg_color") + , border("border") { name = "scroll_list"; mouse_opaque = true; @@ -231,10 +232,8 @@ LLScrollListCtrl::LLScrollListCtrl(const LLScrollListCtrl::Params& p) if (p.has_border) { LLRect border_rect = getLocalRect(); - LLViewBorder::Params params; - params.name("dig border"); + LLViewBorder::Params params = p.border; params.rect(border_rect); - params.bevel_style(LLViewBorder::BEVEL_IN); mBorder = LLUICtrlFactory::create (params); addChild(mBorder); } diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 78bc60db6e..907dc90bea 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -51,6 +51,7 @@ #include "lldate.h" #include "llscrolllistitem.h" #include "llscrolllistcolumn.h" +#include "llviewborder.h" class LLScrollListCell; class LLTextBox; @@ -109,6 +110,8 @@ public: scroll_bar_bg_color; Optional contents; + + Optional border; Params(); }; -- cgit v1.2.3