summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2013-10-22 13:40:52 -0700
committerdolphin <dolphin@lindenlab.com>2013-10-22 13:40:52 -0700
commit93b1111507f5e5c812b6a9e8e47bdf7db67931a0 (patch)
tree214b852c8451409d5d355437ddad48199bef976a /indra/llui
parent03cc47698489929b66fbceb139e4c95d13392b9d (diff)
parent0d0a8d841cab3fbb569a7382b78b0b4fb485eefb (diff)
Merge with viewer-bear
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llcombobox.cpp7
-rwxr-xr-xindra/llui/llcombobox.h2
-rwxr-xr-xindra/llui/llcommandmanager.cpp4
-rwxr-xr-xindra/llui/llcommandmanager.h7
-rwxr-xr-xindra/llui/llfloater.cpp2
-rwxr-xr-xindra/llui/llfloater.h2
-rw-r--r--indra/llui/llfolderviewitem.cpp2
-rwxr-xr-xindra/llui/llmodaldialog.cpp37
-rwxr-xr-xindra/llui/llscrollcontainer.cpp2
-rwxr-xr-xindra/llui/lltabcontainer.cpp23
-rwxr-xr-xindra/llui/lltabcontainer.h11
-rwxr-xr-xindra/llui/lltextbase.cpp2
-rwxr-xr-xindra/llui/lltextbox.cpp13
-rwxr-xr-xindra/llui/lltexteditor.cpp13
-rwxr-xr-xindra/llui/lltexteditor.h2
-rwxr-xr-xindra/llui/lltoolbar.cpp2
-rwxr-xr-xindra/llui/llui.h5
17 files changed, 111 insertions, 25 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index d4e14d9419..56be52f69a 100755
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -534,6 +534,13 @@ void LLComboBox::createLineEditor(const LLComboBox::Params& p)
}
}
+void LLComboBox::setLeftTextPadding(S32 pad)
+{
+ S32 left_pad, right_pad;
+ mTextEntry->getTextPadding(&left_pad, &right_pad);
+ mTextEntry->setTextPadding(pad, right_pad);
+}
+
void* LLComboBox::getCurrentUserdata()
{
LLScrollListItem* item = mList->getFirstSelected();
diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h
index 64dbaea306..1e04fb0866 100755
--- a/indra/llui/llcombobox.h
+++ b/indra/llui/llcombobox.h
@@ -190,6 +190,8 @@ public:
virtual BOOL operateOnAll(EOperation op);
//========================================================================
+
+ void setLeftTextPadding(S32 pad);
void* getCurrentUserdata();
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 625fb8e870..49cfb2255e 100755
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -50,6 +50,8 @@ const LLCommandId LLCommandId::null = LLCommandId("null command");
LLCommand::Params::Params()
: available_in_toybox("available_in_toybox", false)
, icon("icon")
+ , hover_icon_unselected("hover_icon_unselected")
+ , hover_icon_selected("hover_icon_selected")
, label_ref("label_ref")
, name("name")
, tooltip_ref("tooltip_ref")
@@ -71,6 +73,8 @@ LLCommand::LLCommand(const LLCommand::Params& p)
: mIdentifier(p.name)
, mAvailableInToybox(p.available_in_toybox)
, mIcon(p.icon)
+ , mHoverIconUnselected(p.hover_icon_unselected)
+ , mHoverIconSelected(p.hover_icon_selected)
, mLabelRef(p.label_ref)
, mName(p.name)
, mTooltipRef(p.tooltip_ref)
diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h
index ff5a8a3257..9f276f712d 100755
--- a/indra/llui/llcommandmanager.h
+++ b/indra/llui/llcommandmanager.h
@@ -96,6 +96,9 @@ public:
Mandatory<std::string> name;
Mandatory<std::string> tooltip_ref;
+ Optional<std::string> hover_icon_selected;
+ Optional<std::string> hover_icon_unselected;
+
Mandatory<std::string> execute_function;
Optional<LLSD> execute_parameters;
@@ -124,6 +127,8 @@ public:
const std::string& labelRef() const { return mLabelRef; }
const std::string& name() const { return mName; }
const std::string& tooltipRef() const { return mTooltipRef; }
+ const std::string& hoverIconUnselected() const {return mHoverIconUnselected; }
+ const std::string& hoverIconSelected() const {return mHoverIconSelected; }
const std::string& executeFunctionName() const { return mExecuteFunction; }
const LLSD& executeParameters() const { return mExecuteParameters; }
@@ -150,6 +155,8 @@ private:
std::string mLabelRef;
std::string mName;
std::string mTooltipRef;
+ std::string mHoverIconUnselected;
+ std::string mHoverIconSelected;
std::string mExecuteFunction;
LLSD mExecuteParameters;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 273ceb4038..03ad664928 100755
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1802,7 +1802,7 @@ void LLFloater::onClickClose( LLFloater* self )
self->onClickCloseBtn();
}
-void LLFloater::onClickCloseBtn()
+void LLFloater::onClickCloseBtn(bool app_quitting)
{
closeFloater(false);
}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 59448530d9..1693af318d 100755
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -389,7 +389,7 @@ protected:
void destroy(); // Don't call this directly. You probably want to call closeFloater()
- virtual void onClickCloseBtn();
+ virtual void onClickCloseBtn(bool app_quitting = false);
virtual void updateTitleButtons();
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 6c147ccc12..1750ca0ed4 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -521,7 +521,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask )
BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
{
- static LLCachedControl<S32> drag_and_drop_threshold(*LLUI::sSettingGroups["config"],"DragAndDropDistanceThreshold");
+ static LLCachedControl<S32> drag_and_drop_threshold(*LLUI::sSettingGroups["config"],"DragAndDropDistanceThreshold", 3);
mIsMouseOverTitle = (y > (getRect().getHeight() - mItemHeight));
diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp
index 8c2be44904..ff85b0ad09 100755
--- a/indra/llui/llmodaldialog.cpp
+++ b/indra/llui/llmodaldialog.cpp
@@ -34,7 +34,7 @@
#include "llui.h"
#include "llwindow.h"
#include "llkeyboard.h"
-
+#include "llmenugl.h"
// static
std::list<LLModalDialog*> LLModalDialog::sModalStack;
@@ -161,6 +161,18 @@ void LLModalDialog::setVisible( BOOL visible )
BOOL LLModalDialog::handleMouseDown(S32 x, S32 y, MASK mask)
{
+ LLView* popup_menu = LLMenuGL::sMenuContainer->getVisibleMenu();
+ if (popup_menu != NULL)
+ {
+ S32 mx, my;
+ LLUI::getMousePositionScreen(&mx, &my);
+ LLRect menu_screen_rc = popup_menu->calcScreenRect();
+ if(!menu_screen_rc.pointInRect(mx, my))
+ {
+ LLMenuGL::sMenuContainer->hideMenus();
+ }
+ }
+
if (mModal)
{
if (!LLFloater::handleMouseDown(x, y, mask))
@@ -173,16 +185,34 @@ BOOL LLModalDialog::handleMouseDown(S32 x, S32 y, MASK mask)
{
LLFloater::handleMouseDown(x, y, mask);
}
+
+
return TRUE;
}
BOOL LLModalDialog::handleHover(S32 x, S32 y, MASK mask)
-{
+{
if( childrenHandleHover(x, y, mask) == NULL )
{
getWindow()->setCursor(UI_CURSOR_ARROW);
- lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl;
+ lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl;
}
+
+ LLView* popup_menu = LLMenuGL::sMenuContainer->getVisibleMenu();
+ if (popup_menu != NULL)
+ {
+ S32 mx, my;
+ LLUI::getMousePositionScreen(&mx, &my);
+ LLRect menu_screen_rc = popup_menu->calcScreenRect();
+ if(menu_screen_rc.pointInRect(mx, my))
+ {
+ S32 local_x = mx - popup_menu->getRect().mLeft;
+ S32 local_y = my - popup_menu->getRect().mBottom;
+ popup_menu->handleHover(local_x, local_y, mask);
+ gFocusMgr.setMouseCapture(NULL);
+ }
+ }
+
return TRUE;
}
@@ -210,6 +240,7 @@ BOOL LLModalDialog::handleDoubleClick(S32 x, S32 y, MASK mask)
BOOL LLModalDialog::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
+ LLMenuGL::sMenuContainer->hideMenus();
childrenHandleRightMouseDown(x, y, mask);
return TRUE;
}
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index cbcce0ece5..238eae21c2 100755
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -519,7 +519,7 @@ bool LLScrollContainer::addChild(LLView* view, S32 tab_group)
void LLScrollContainer::updateScroll()
{
- if (!mScrolledView)
+ if (!getVisible() || !mScrolledView)
{
return;
}
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 148dc6b232..0499d35850 100755
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -193,12 +193,15 @@ LLTabContainer::TabParams::TabParams()
: tab_top_image_unselected("tab_top_image_unselected"),
tab_top_image_selected("tab_top_image_selected"),
tab_top_image_flash("tab_top_image_flash"),
+ tab_top_image_hovered("tab_top_image_hovered"),
tab_bottom_image_unselected("tab_bottom_image_unselected"),
tab_bottom_image_selected("tab_bottom_image_selected"),
tab_bottom_image_flash("tab_bottom_image_flash"),
+ tab_bottom_image_hovered("tab_bottom_image_hovered"),
tab_left_image_unselected("tab_left_image_unselected"),
tab_left_image_selected("tab_left_image_selected"),
- tab_left_image_flash("tab_left_image_flash")
+ tab_left_image_flash("tab_left_image_flash"),
+ tab_left_image_hovered("tab_left_image_hovered")
{}
LLTabContainer::Params::Params()
@@ -218,7 +221,8 @@ LLTabContainer::Params::Params()
open_tabs_on_drag_and_drop("open_tabs_on_drag_and_drop", false),
tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0),
use_ellipses("use_ellipses"),
- font_halign("halign")
+ font_halign("halign"),
+ use_highlighting_on_hover("use_highlighting_on_hover",false)
{}
LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
@@ -254,7 +258,8 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p)
mCustomIconCtrlUsed(p.use_custom_icon_ctrl),
mOpenTabsOnDragAndDrop(p.open_tabs_on_drag_and_drop),
mTabIconCtrlPad(p.tab_icon_ctrl_pad),
- mUseTabEllipses(p.use_ellipses)
+ mUseTabEllipses(p.use_ellipses),
+ mUseHighlightingOnHover(p.use_highlighting_on_hover)
{
static LLUICachedControl<S32> tabcntr_vert_tab_min_width ("UITabCntrVertTabMinWidth", 0);
@@ -891,18 +896,30 @@ void LLTabContainer::update_images(LLTabTuple* tuple, TabParams params, LLTabCon
tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_top_image_unselected));
tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_top_image_selected));
tuple->mButton->setImageFlash(static_cast<LLUIImage*>(params.tab_top_image_flash));
+ if(mUseHighlightingOnHover)
+ {
+ tuple->mButton->setImageHoverUnselected(static_cast<LLUIImage*>(params.tab_top_image_hovered));
+ }
}
else if (pos == LLTabContainer::BOTTOM)
{
tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_bottom_image_unselected));
tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_bottom_image_selected));
tuple->mButton->setImageFlash(static_cast<LLUIImage*>(params.tab_bottom_image_flash));
+ if(mUseHighlightingOnHover)
+ {
+ tuple->mButton->setImageHoverUnselected(static_cast<LLUIImage*>(params.tab_bottom_image_hovered));
+ }
}
else if (pos == LLTabContainer::LEFT)
{
tuple->mButton->setImageUnselected(static_cast<LLUIImage*>(params.tab_left_image_unselected));
tuple->mButton->setImageSelected(static_cast<LLUIImage*>(params.tab_left_image_selected));
tuple->mButton->setImageFlash(static_cast<LLUIImage*>(params.tab_left_image_flash));
+ if(mUseHighlightingOnHover)
+ {
+ tuple->mButton->setImageHoverUnselected(static_cast<LLUIImage*>(params.tab_left_image_hovered));
+ }
}
}
}
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index 057809dc42..c942da30d2 100755
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -62,12 +62,15 @@ public:
Optional<LLUIImage*> tab_top_image_unselected,
tab_top_image_selected,
tab_top_image_flash,
+ tab_top_image_hovered,
tab_bottom_image_unselected,
tab_bottom_image_selected,
tab_bottom_image_flash,
+ tab_bottom_image_hovered,
tab_left_image_unselected,
tab_left_image_selected,
- tab_left_image_flash;
+ tab_left_image_flash,
+ tab_left_image_hovered;
TabParams();
};
@@ -114,6 +117,11 @@ public:
*/
Optional<S32> tab_icon_ctrl_pad;
+ /**
+ * This variable is used to found out should we highlight tab button on hover
+ */
+ Optional<bool> use_highlighting_on_hover;
+
Params();
};
@@ -308,6 +316,7 @@ private:
bool mOpenTabsOnDragAndDrop;
S32 mTabIconCtrlPad;
bool mUseTabEllipses;
+ bool mUseHighlightingOnHover;
};
#endif // LL_TABCONTAINER_H
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index cc171661ce..5ec4cf4fe5 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1029,7 +1029,7 @@ BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLTextBase::handleMouseUp(S32 x, S32 y, MASK mask)
{
LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y);
- if (cur_segment && cur_segment->handleMouseUp(x, y, mask))
+ if (hasMouseCapture() && cur_segment && cur_segment->handleMouseUp(x, y, mask))
{
// Did we just click on a link?
if (mURLClickSignal
diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp
index 11cfa1d263..d175204e6d 100755
--- a/indra/llui/lltextbox.cpp
+++ b/indra/llui/lltextbox.cpp
@@ -60,10 +60,13 @@ BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask)
if (!handled && mClickedCallback)
{
+ handled = TRUE;
+ }
+
+ if (handled)
+ {
// Route future Mouse messages here preemptively. (Release on mouse up.)
gFocusMgr.setMouseCapture( this );
-
- handled = TRUE;
}
return handled;
@@ -71,7 +74,7 @@ BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask)
{
- BOOL handled = FALSE;
+ BOOL handled = LLTextBase::handleMouseUp(x, y, mask);
if (getSoundFlags() & MOUSE_UP)
{
@@ -93,10 +96,6 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask)
handled = TRUE;
}
}
- else
- {
- handled = LLTextBase::handleMouseUp(x, y, mask);
- }
return handled;
}
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 0c16e06109..62140dd9d6 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -666,6 +666,14 @@ void LLTextEditor::selectAll()
updatePrimary();
}
+void LLTextEditor::selectByCursorPosition(S32 prev_cursor_pos, S32 next_cursor_pos)
+{
+ setCursorPos(prev_cursor_pos);
+ startSelection();
+ setCursorPos(next_cursor_pos);
+ endSelection();
+}
+
BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
{
BOOL handled = FALSE;
@@ -713,7 +721,6 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
setCursorAtLocalPos( x, y, true );
startSelection();
}
- gFocusMgr.setMouseCapture( this );
}
handled = TRUE;
@@ -722,6 +729,10 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
// Delay cursor flashing
resetCursorBlink();
+ if (handled && !gFocusMgr.getMouseCapture())
+ {
+ gFocusMgr.setMouseCapture( this );
+ }
return handled;
}
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index 32b543ec0e..d3b7bc0eb7 100755
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -144,6 +144,8 @@ public:
virtual void selectAll();
virtual BOOL canSelectAll() const;
+ void selectByCursorPosition(S32 prev_cursor_pos, S32 next_cursor_pos);
+
virtual bool canLoadOrSaveToFile();
void selectNext(const std::string& search_text_in, BOOL case_insensitive, BOOL wrap = TRUE);
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 928e82cb8c..6bfe113933 100755
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -928,6 +928,8 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id)
button_p.label = LLTrans::getString(commandp->labelRef());
button_p.tool_tip = LLTrans::getString(commandp->tooltipRef());
button_p.image_overlay = LLUI::getUIImage(commandp->icon());
+ button_p.image_hover_unselected = LLUI::getUIImage(commandp->hoverIconUnselected());
+ button_p.image_hover_selected = LLUI::getUIImage(commandp->hoverIconSelected());
button_p.button_flash_enable = commandp->isFlashingAllowed();
button_p.overwriteFrom(mButtonParams[mButtonType]);
LLToolBarButton* button = LLUICtrlFactory::create<LLToolBarButton>(button_p);
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index 0a0e0e164e..0bc4424a8c 100755
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -405,11 +405,6 @@ public:
const std::string& comment = "Declared In Code")
: LLCachedControl<T>(LLUI::getControlControlGroup(name), name, default_value, comment)
{}
-
- // This constructor will signal an error if the control doesn't exist in the control group
- LLUICachedControl(const std::string& name)
- : LLCachedControl<T>(LLUI::getControlControlGroup(name), name)
- {}
};
namespace LLInitParam