summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2009-07-10 20:43:08 +0000
committerRichard Nelson <richard@lindenlab.com>2009-07-10 20:43:08 +0000
commit923d84d08f98b33657d6bd861c34b985125db757 (patch)
treeaa0d08135e2ba46cb69cde25e1026962fa2ddc66 /indra/llui
parent24be0ba83c97bcefb8afe565a7483c2e99bbf11a (diff)
EXT-127: Tooltips don't disappear immediately after moving mouse out of object
reviewed by Austin
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcombobox.cpp7
-rw-r--r--indra/llui/llscrollcontainer.cpp36
-rw-r--r--indra/llui/llscrollcontainer.h1
-rw-r--r--indra/llui/llscrolllistcolumn.cpp2
-rw-r--r--indra/llui/llscrolllistctrl.cpp12
-rw-r--r--indra/llui/lluictrl.cpp32
-rw-r--r--indra/llui/llview.cpp7
7 files changed, 6 insertions, 91 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index 5dfca4be16..5caad1919a 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -738,12 +738,7 @@ BOOL LLComboBox::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_re
msg = tool_tip;
// Convert rect local to screen coordinates
- localPointToScreen(
- 0, 0,
- &(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) );
- localPointToScreen(
- getRect().getWidth(), getRect().getHeight(),
- &(sticky_rect_screen->mRight), &(sticky_rect_screen->mTop) );
+ *sticky_rect_screen = calcScreenRect();
}
return TRUE;
}
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index ea4bd2526e..402c050d2e 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -333,34 +333,6 @@ BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask,
return TRUE;
}
-
-BOOL LLScrollContainer::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect)
-{
- S32 local_x, local_y;
- for( S32 i = 0; i < SCROLLBAR_COUNT; i++ )
- {
- local_x = x - mScrollbar[i]->getRect().mLeft;
- local_y = y - mScrollbar[i]->getRect().mBottom;
- if( mScrollbar[i]->handleToolTip(local_x, local_y, msg, sticky_rect) )
- {
- return TRUE;
- }
- }
- // Handle 'child' view.
- if( mScrolledView )
- {
- local_x = x - mScrolledView->getRect().mLeft;
- local_y = y - mScrolledView->getRect().mBottom;
- if( mScrolledView->handleToolTip(local_x, local_y, msg, sticky_rect) )
- {
- return TRUE;
- }
- }
-
- // Opaque
- return TRUE;
-}
-
void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const
{
const LLRect& rect = mScrolledView->getRect();
@@ -500,12 +472,8 @@ bool LLScrollContainer::addChild(LLView* view, S32 tab_group)
{
if (!mScrolledView)
{
- //*TODO: Move LLFolderView to llui and enable this check
-// if (dynamic_cast<LLPanel*>(view) || dynamic_cast<LLContainerView*>(view) || dynamic_cast<LLScrollingPanelList*>(view) || dynamic_cast<LLFolderView*>(view))
- {
- // Use the first panel or container as the scrollable view (bit of a hack)
- mScrolledView = view;
- }
+ // Use the first panel or container as the scrollable view (bit of a hack)
+ mScrolledView = view;
}
bool ret_val = LLView::addChild(view, tab_group);
diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h
index 9cbfbc94a1..c2d4d2c861 100644
--- a/indra/llui/llscrollcontainer.h
+++ b/indra/llui/llscrollcontainer.h
@@ -105,7 +105,6 @@ public:
EAcceptance* accept,
std::string& tooltip_msg);
- virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect);
virtual void draw();
virtual bool addChild(LLView* view, S32 tab_group = 0);
diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp
index 686e0b6cb7..073e14386f 100644
--- a/indra/llui/llscrolllistcolumn.cpp
+++ b/indra/llui/llscrolllistcolumn.cpp
@@ -65,8 +65,6 @@ LLScrollColumnHeader::LLScrollColumnHeader(const LLScrollColumnHeader::Params& p
resize_bar_p.enabled(false);
mResizeBar = LLUICtrlFactory::create<LLResizeBar>(resize_bar_p);
addChild(mResizeBar);
-
- setToolTip(p.label());
}
LLScrollColumnHeader::~LLScrollColumnHeader()
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 75afbffc11..84a725ce02 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -1512,19 +1512,12 @@ BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sti
if (hit_cell
&& hit_cell->isText())
{
-
S32 rect_left = getColumnOffsetFromIndex(column_index) + mItemListRect.mLeft;
S32 rect_bottom = getRowOffsetFromIndex(getItemIndex(hit_item));
LLRect cell_rect;
cell_rect.setOriginAndSize(rect_left, rect_bottom, rect_left + columnp->getWidth(), mLineHeight);
// Convert rect local to screen coordinates
- localPointToScreen(
- cell_rect.mLeft, cell_rect.mBottom,
- &(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) );
- localPointToScreen(
- cell_rect.mRight, cell_rect.mTop,
- &(sticky_rect_screen->mRight), &(sticky_rect_screen->mTop) );
-
+ localRectToScreen(cell_rect, sticky_rect_screen);
msg = hit_cell->getValue().asString();
}
handled = TRUE;
@@ -1849,8 +1842,7 @@ S32 LLScrollListCtrl::getColumnOffsetFromIndex(S32 index)
S32 LLScrollListCtrl::getRowOffsetFromIndex(S32 index)
{
- S32 row_bottom = ((mItemListRect.mTop - (index - mScrollLines)) * mLineHeight)
- - mLineHeight;
+ S32 row_bottom = (mItemListRect.mTop - ((index - mScrollLines + 1) * mLineHeight) );
return row_bottom;
}
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 43430cba24..7d33a5ad1a 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -806,38 +806,6 @@ LLUICtrl* LLUICtrl::findRootMostFocusRoot()
return focus_root;
}
-
-/*
-// Don't let the children handle the tool tip. Handle it here instead.
-BOOL LLUICtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen)
-{
- BOOL handled = FALSE;
- if (getVisible() && pointInView( x, y ) )
- {
- if( !mToolTipMsg.empty() )
- {
- msg = mToolTipMsg;
-
- // Convert rect local to screen coordinates
- localPointToScreen(
- 0, 0,
- &(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) );
- localPointToScreen(
- getRect().getWidth(), getRect().getHeight(),
- &(sticky_rect_screen->mRight), &(sticky_rect_screen->mTop) );
-
- handled = TRUE;
- }
- }
-
- if (!handled)
- {
- return LLView::handleToolTip(x, y, msg, sticky_rect_screen);
- }
-
- return handled;
-}*/
-
// Skip over any parents that are not LLUICtrl's
// Used in focus logic since only LLUICtrl elements can have focus
LLUICtrl* LLUICtrl::getParentUICtrl() const
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 777cf096ac..f01aacb797 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -743,12 +743,7 @@ BOOL LLView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_s
msg = tool_tip;
// Convert rect local to screen coordinates
- localPointToScreen(
- 0, 0,
- &(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom) );
- localPointToScreen(
- mRect.getWidth(), mRect.getHeight(),
- &(sticky_rect_screen->mRight), &(sticky_rect_screen->mTop) );
+ *sticky_rect_screen = calcScreenRect();
}
// don't allow any siblings to handle this event
// even if we don't have a tooltip