summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
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.cpp35
-rwxr-xr-xindra/llui/llmultifloater.cpp13
-rwxr-xr-xindra/llui/llmultifloater.h2
-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
19 files changed, 117 insertions, 32 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 74ef8dd0c3..176ff36359 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 513a7e2ab0..8efd9ba3d0 100755
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1821,7 +1821,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 a5166f4cde..b3389dd2b0 100755
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -390,7 +390,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 acde3b0493..83254c2840 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -526,7 +526,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 45505e232e..d83028ec4a 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);
LL_DEBUGS("UserInput") << "hover handled by " << getName() << LL_ENDL;
}
+
+ 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/llmultifloater.cpp b/indra/llui/llmultifloater.cpp
index 48b5b08c1b..d1a597511e 100755
--- a/indra/llui/llmultifloater.cpp
+++ b/indra/llui/llmultifloater.cpp
@@ -67,14 +67,13 @@ void LLMultiFloater::buildTabContainer()
}
}
-void LLMultiFloater::onOpen(const LLSD& key)
+void LLMultiFloater::onClose(bool app_quitting)
{
-// if (mTabContainer->getTabCount() <= 0)
-// {
-// // for now, don't allow multifloaters
-// // without any child floaters
-// closeFloater();
-// }
+ if(isMinimized())
+ {
+ setMinimized(FALSE);
+ }
+ LLFloater::onClose(app_quitting);
}
void LLMultiFloater::draw()
diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h
index c1b1a357ed..c106a62527 100755
--- a/indra/llui/llmultifloater.h
+++ b/indra/llui/llmultifloater.h
@@ -44,7 +44,7 @@ public:
void buildTabContainer();
virtual BOOL postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ /*virtual*/ void onClose(bool app_quitting);
virtual void draw();
virtual void setVisible(BOOL visible);
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index e1d401d94a..8c506d76bb 100755
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -517,7 +517,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 65df0e5b80..05dceeb783 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);
@@ -903,18 +908,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 57862fc626..7e7d4ac6e6 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();
};
@@ -307,6 +315,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 f08aeecc99..eb25b95263 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 04ea60a4c2..aa0d16115e 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 10f6cc567b..3a96d8ed24 100755
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -142,6 +142,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 040930aea5..eaf8000ba3 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 f7426a703a..b162f25887 100755
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -453,11 +453,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