summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-10-12 13:22:58 -0700
committerSteve Bennetts <steve@lindenlab.com>2009-10-12 13:22:58 -0700
commit4a1ef20c317897e7e509c7f599e97fcc90ffaefc (patch)
treec496bd8785b94bb60bca33ea59758c5929341451 /indra/llui
parent895e8ad446ab383e1211f759e8b55aa0fff2efc1 (diff)
parentd4b2897700c66354413af42ab055bd1aaa47f91c (diff)
merge
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lldockablefloater.cpp10
-rw-r--r--indra/llui/lldockablefloater.h3
-rw-r--r--indra/llui/lldockcontrol.cpp22
-rw-r--r--indra/llui/llfloater.cpp3
-rw-r--r--indra/llui/llfloater.h13
-rw-r--r--indra/llui/llmenubutton.cpp6
-rw-r--r--indra/llui/llmenubutton.h1
-rw-r--r--indra/llui/llpanel.cpp2
-rw-r--r--indra/llui/lltextbase.cpp3
-rw-r--r--indra/llui/lltooltip.cpp14
-rw-r--r--indra/llui/lluictrlfactory.h2
11 files changed, 68 insertions, 11 deletions
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp
index 4525f0a45b..c512ef25be 100644
--- a/indra/llui/lldockablefloater.cpp
+++ b/indra/llui/lldockablefloater.cpp
@@ -91,6 +91,16 @@ void LLDockableFloater::setVisible(BOOL visible)
LLFloater::setVisible(visible);
}
+void LLDockableFloater::onDockHidden()
+{
+ setCanDock(FALSE);
+}
+
+void LLDockableFloater::onDockShown()
+{
+ setCanDock(TRUE);
+}
+
void LLDockableFloater::setDocked(bool docked, bool pop_on_undock)
{
if (mDockControl.get() != NULL && mDockControl.get()->isDockVisible())
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index ed90567ad3..7d91d007ee 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -68,6 +68,9 @@ public:
*/
/*virtual*/ void setVisible(BOOL visible);
+ virtual void onDockHidden();
+ virtual void onDockShown();
+
private:
/**
* Provides unique of dockable floater.
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp
index 146c7a969a..cdcd823b1c 100644
--- a/indra/llui/lldockcontrol.cpp
+++ b/indra/llui/lldockcontrol.cpp
@@ -33,6 +33,7 @@
#include "linden_common.h"
#include "lldockcontrol.h"
+#include "lldockablefloater.h"
LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,
const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_allowed_rect_callback) :
@@ -91,8 +92,8 @@ void LLDockControl::repositionDockable()
// recalculate dockable position if dock position changed, dock visibility changed,
// root view rect changed or recalculation is forced
- if (mEnabled && (mPrevDockRect != dockRect || prev_visibility != mDockWidget->getVisible()
- || mRootRect != rootRect || mRecalculateDocablePosition))
+ if (mPrevDockRect != dockRect || prev_visibility != mDockWidget->getVisible()
+ || mRootRect != rootRect || mRecalculateDocablePosition)
{
// undock dockable and off() if dock not visible
if (!isDockVisible())
@@ -100,10 +101,25 @@ void LLDockControl::repositionDockable()
mDockableFloater->setDocked(false);
// force off() since dockable may not have dockControll at this time
off();
+ LLDockableFloater* dockable_floater =
+ dynamic_cast<LLDockableFloater*> (mDockableFloater);
+ if(dockable_floater != NULL)
+ {
+ dockable_floater->onDockHidden();
+ }
}
else
{
- moveDockable();
+ if(mEnabled)
+ {
+ moveDockable();
+ }
+ LLDockableFloater* dockable_floater =
+ dynamic_cast<LLDockableFloater*> (mDockableFloater);
+ if(dockable_floater != NULL)
+ {
+ dockable_floater->onDockShown();
+ }
}
mPrevDockRect = dockRect;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 564e4d748f..b7a15a2b33 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -664,7 +664,8 @@ void LLFloater::closeFloater(bool app_quitting)
dirtyRect();
- // Close callback
+ // Close callbacks
+ onClose(app_quitting);
mCloseSignal(this, LLSD(app_quitting));
// Hide or Destroy
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 1dc5177f81..17ffc94014 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -208,8 +208,8 @@ public:
virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask);
virtual void draw();
- // *TODO: Eliminate this in favor of mOpenSignal
virtual void onOpen(const LLSD& key) {}
+ virtual void onClose(bool app_quitting) {}
// This cannot be "const" until all derived floater canClose()
// methods are const as well. JC
@@ -293,11 +293,18 @@ private:
void addResizeCtrls();
void addDragHandle();
+public:
+ // Called when floater is opened, passes mKey
+ // Public so external views or floaters can watch for this floater opening
+ commit_signal_t mOpenSignal;
+
+ // Called when floater is closed, passes app_qitting as LLSD()
+ // Public so external views or floaters can watch for this floater closing
+ commit_signal_t mCloseSignal;
+
protected:
std::string mRectControl;
std::string mVisibilityControl;
- commit_signal_t mOpenSignal; // Called when floater is opened, passes mKey
- commit_signal_t mCloseSignal; // Called when floater is closed, passes app_qitting as LLSD()
LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg
LLDragHandle* mDragHandle;
diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp
index 2bb6749c83..8dbcd6e229 100644
--- a/indra/llui/llmenubutton.cpp
+++ b/indra/llui/llmenubutton.cpp
@@ -83,6 +83,12 @@ void LLMenuButton::toggleMenu()
}
+void LLMenuButton::hideMenu()
+{
+ mMenu->setVisible(FALSE);
+}
+
+
BOOL LLMenuButton::handleKeyHere(KEY key, MASK mask )
{
if( KEY_RETURN == key && mask == MASK_NONE && !gKeyboard->getKeyRepeated(key))
diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h
index 94b0e4355d..02eb9d3806 100644
--- a/indra/llui/llmenubutton.h
+++ b/indra/llui/llmenubutton.h
@@ -54,6 +54,7 @@ public:
/*virtual*/ void draw();
/*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask );
+ void hideMenu();
protected:
friend class LLUICtrlFactory;
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 1695aee2b8..69ff3dddc3 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -522,7 +522,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu
// be built/added. JC
if (parent)
{
- S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1;
+ S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : parent->getLastTabGroup();
parent->addChild(this, tab_group);
}
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 62f03f47e6..3dacf979c7 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -807,6 +807,9 @@ void LLTextBase::insertSegment(LLTextSegmentPtr segment_to_insert)
++cur_seg_iter;
}
}
+
+ // layout potentially changed
+ needsReflow();
}
BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask)
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 8f5c029816..c55273cacf 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -38,6 +38,7 @@
// Library includes
#include "lltextbox.h"
#include "lliconctrl.h"
+#include "llmenugl.h" // hideMenus()
#include "llui.h" // positionViewNearMouse()
#include "llwindow.h"
@@ -94,7 +95,16 @@ BOOL LLToolTipView::handleHover(S32 x, S32 y, MASK mask)
BOOL LLToolTipView::handleMouseDown(S32 x, S32 y, MASK mask)
{
LLToolTipMgr::instance().blockToolTips();
- return LLView::handleMouseDown(x, y, mask);
+
+ if (LLView::handleMouseDown(x, y, mask))
+ {
+ // If we are handling the mouse event menu holder
+ // won't get a chance to close menus so do this here
+ LLMenuGL::sMenuContainer->hideMenus();
+ return TRUE;
+ }
+
+ return FALSE;
}
BOOL LLToolTipView::handleMiddleMouseDown(S32 x, S32 y, MASK mask)
@@ -189,7 +199,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p)
addChild(LLUICtrlFactory::create<LLIconCtrl>(icon_params));
// move text over to fit image in
- mTextBox->translate(TOOLTIP_ICON_SIZE,0);
+ mTextBox->translate(TOOLTIP_ICON_SIZE + mPadding, 0);
}
if (p.click_callback.isProvided())
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index e47010c316..3c77c655b8 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -321,7 +321,7 @@ fail:
static void loadWidgetTemplate(const std::string& widget_tag, LLInitParam::BaseBlock& block);
private:
- //static void setCtrlValue(LLView* view, LLXMLNodePtr node);
+ // this exists to get around dependency on llview
static void setCtrlParent(LLView* view, LLView* parent, S32 tab_group);
// Avoid directly using LLUI and LLDir in the template code