summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorSergei Litovchuk <slitovchuk@productengine.com>2009-11-14 19:15:51 +0200
committerSergei Litovchuk <slitovchuk@productengine.com>2009-11-14 19:15:51 +0200
commit93c1e1bd6eaa8f77e746b1346b1729ed564081b4 (patch)
tree430e532c6cda6ca8e79e04bb236c2e65954e8400 /indra/llui
parent9e11d70225d3e53e2ee31304c4930f01939fe1c3 (diff)
No ticket.
- Fixed toggleable menu in Picks panel. - Minor optimization of LLToggleableMenu. --HG-- branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltoggleablemenu.cpp9
-rw-r--r--indra/llui/lltoggleablemenu.h3
2 files changed, 11 insertions, 1 deletions
diff --git a/indra/llui/lltoggleablemenu.cpp b/indra/llui/lltoggleablemenu.cpp
index 717e135412..5df1d35383 100644
--- a/indra/llui/lltoggleablemenu.cpp
+++ b/indra/llui/lltoggleablemenu.cpp
@@ -40,6 +40,7 @@ static LLDefaultChildRegistry::Register<LLToggleableMenu> r("toggleable_menu");
LLToggleableMenu::LLToggleableMenu(const LLToggleableMenu::Params& p)
: LLMenuGL(p),
+ mButtonRect(),
mClosedByButtonClick(false)
{
}
@@ -56,13 +57,19 @@ void LLToggleableMenu::handleVisibilityChange (BOOL curVisibilityIn)
}
}
-void LLToggleableMenu::setButtonRect(const LLRect& rect, LLView* current_view)
+void LLToggleableMenu::setButtonRect(const LLRect& rect, LLView* current_view)
{
LLRect screen;
current_view->localRectToScreen(rect, &screen);
mButtonRect = screen;
}
+void LLToggleableMenu::setButtonRect(LLView* current_view)
+{
+ LLRect rect = current_view->getLocalRect();
+ setButtonRect(rect, current_view);
+}
+
bool LLToggleableMenu::toggleVisibility()
{
if (mClosedByButtonClick)
diff --git a/indra/llui/lltoggleablemenu.h b/indra/llui/lltoggleablemenu.h
index 3cd66e04a8..9d8c5261b9 100644
--- a/indra/llui/lltoggleablemenu.h
+++ b/indra/llui/lltoggleablemenu.h
@@ -49,8 +49,11 @@ protected:
public:
virtual void handleVisibilityChange (BOOL curVisibilityIn);
+ const LLRect& getButtonRect() const { return mButtonRect; }
+
// Converts the given local button rect to a screen rect
void setButtonRect(const LLRect& rect, LLView* current_view);
+ void setButtonRect(LLView* current_view);
// Returns "true" if menu was not closed by button click
// and is not still visible. If menu is visible toggles