summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcombobox.cpp31
-rw-r--r--indra/llui/llradiogroup.cpp4
-rw-r--r--indra/llui/llscrolllistctrl.cpp9
-rw-r--r--indra/llui/lluictrl.cpp18
-rw-r--r--indra/llui/lluictrl.h2
-rw-r--r--indra/llui/lluifwd.h40
6 files changed, 74 insertions, 30 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index b4fdbfeb0e..28237823dd 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -640,12 +640,6 @@ void LLComboBox::showList()
// NB: this call will trigger the focuslost callback which will hide the list, so do it first
// before finally showing the list
- if (!mList->getFirstSelected())
- {
- // if nothing is selected, select the first item
- // so that the callback is not immediately triggered on setFocus()
- mList->selectFirstItem();
- }
mList->setFocus(TRUE);
// Show the list and push the button down
@@ -714,7 +708,7 @@ void LLComboBox::onButtonDown(void *userdata)
else
{
self->hideList();
- }
+ }
}
@@ -737,30 +731,35 @@ void LLComboBox::onItemSelected(LLUICtrl* item, void *userdata)
self->mTextEntry->selectAll();
}
}
- else
- {
- // invalid selection, just restore existing value
- LLString orig_selection = self->mAllowTextEntry ? self->mTextEntry->getText() : self->mButton->getLabelSelected();
-
- self->mList->selectItemByLabel(orig_selection);
- }
- self->onCommit();
+ // hiding the list reasserts the old value stored in the text editor/dropdown button
self->hideList();
+
+ // commit does the reverse, asserting the value in the list
+ self->onCommit();
}
BOOL LLComboBox::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen)
{
LLString tool_tip;
+ if(LLUICtrl::handleToolTip(x, y, msg, sticky_rect_screen))
+ {
+ return TRUE;
+ }
+
if (LLUI::sShowXUINames)
{
tool_tip = getShowNamesToolTip();
}
- else
+ else if (!mToolTipMsg.empty())
{
tool_tip = mToolTipMsg;
}
+ else
+ {
+ tool_tip = getValue().asString();
+ }
if( !tool_tip.empty() )
{
diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp
index 53541f5128..6fba415d35 100644
--- a/indra/llui/llradiogroup.cpp
+++ b/indra/llui/llradiogroup.cpp
@@ -245,7 +245,9 @@ void LLRadioGroup::draw()
radio->setValue( selected );
if (take_focus && selected && !gFocusMgr.childHasKeyboardFocus(radio))
{
- radio->focusFirstItem();
+ // don't flash keyboard focus when navigating via keyboard
+ BOOL DONT_FLASH = FALSE;
+ radio->focusFirstItem(FALSE, DONT_FLASH);
}
current_button++;
}
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index c29789e083..9d38bd0dab 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -1381,6 +1381,8 @@ LLScrollListItem* LLScrollListCtrl::addSeparator(EAddPosition pos)
// Returns false if item not found.
BOOL LLScrollListCtrl::selectItemByLabel(const LLString& label, BOOL case_sensitive)
{
+ // ensure that no stale items are selected, even if we don't find a match
+ deselectAllItems(TRUE);
//RN: assume no empty items
if (label.empty())
{
@@ -1762,10 +1764,9 @@ BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky
{
LLScrollListCell* hit_cell = hit_item->getColumn(column_index);
if (!hit_cell) return FALSE;
- S32 cell_required_width = hit_cell->getContentWidth();
+ //S32 cell_required_width = hit_cell->getContentWidth();
if (hit_cell
- && hit_cell->isText()
- && cell_required_width > columnp->mWidth)
+ && hit_cell->isText())
{
S32 rect_left = getColumnOffsetFromIndex(column_index) + mItemListRect.mLeft;
@@ -1781,8 +1782,8 @@ BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky
&(sticky_rect_screen->mRight), &(sticky_rect_screen->mTop) );
msg = hit_cell->getValue().asString();
- handled = TRUE;
}
+ handled = TRUE;
}
// otherwise, look for a tooltip associated with this column
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 241adb667e..ee6176fff6 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -285,8 +285,6 @@ void LLUICtrl::setIsChrome(BOOL is_chrome)
// virtual
BOOL LLUICtrl::getIsChrome() const
{
- // am I or any of my ancestors flagged as "chrome"?
- if (mIsChrome) return TRUE;
LLView* parent_ctrl = getParent();
while(parent_ctrl)
@@ -300,11 +298,12 @@ BOOL LLUICtrl::getIsChrome() const
if(parent_ctrl)
{
- // recurse into parent_ctrl and ask if it is in a chrome subtree
- return ((LLUICtrl*)parent_ctrl)->getIsChrome();
+ return mIsChrome || ((LLUICtrl*)parent_ctrl)->getIsChrome();
+ }
+ else
+ {
+ return mIsChrome ;
}
-
- return FALSE;
}
// this comparator uses the crazy disambiguating logic of LLCompareByTabOrder,
@@ -341,7 +340,7 @@ public:
};
-BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields)
+BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash)
{
// try to select default tab group child
LLCtrlQuery query = LLView::getTabOrderQuery();
@@ -355,7 +354,10 @@ BOOL LLUICtrl::focusFirstItem(BOOL prefer_text_fields)
{
ctrl->setFocus(TRUE);
ctrl->onTabInto();
- gFocusMgr.triggerFocusFlash();
+ if(focus_flash)
+ {
+ gFocusMgr.triggerFocusFlash();
+ }
}
return TRUE;
}
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index ae360f401f..e47ee318be 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -155,7 +155,7 @@ public:
virtual void setMinValue(LLSD min_value);
virtual void setMaxValue(LLSD max_value);
- /*virtual*/ BOOL focusFirstItem(BOOL prefer_text_fields = FALSE );
+ /*virtual*/ BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
class LLTextInputFilter : public LLQueryFilter, public LLSingleton<LLTextInputFilter>
{
diff --git a/indra/llui/lluifwd.h b/indra/llui/lluifwd.h
new file mode 100644
index 0000000000..23f441ffea
--- /dev/null
+++ b/indra/llui/lluifwd.h
@@ -0,0 +1,40 @@
+/**
+ * @file lluifwd.h
+ * @author James Cook
+ * @brief Forward declarations of common LLUI widget types.
+ *
+ * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
+ * $License$
+ */
+#ifndef LLUIFWD_H
+#define LLUIFWD_H
+
+class LLButton;
+class LLCheckBoxCtrl;
+class LLComboBox;
+class LLDragHandle;
+class LLFloater;
+class LLIconCtrl;
+class LLLineEditor;
+class LLMenuGL;
+class LLPanel;
+class LLRadioGroup;
+class LLResizeBar;
+class LLResizeHandle;
+class LLScrollbar;
+class LLScrollContainer;
+class LLScrollingPanelList;
+class LLScrollListCtrl;
+class LLSlider;
+class LLSliderCtrl;
+class LLSpinCtrl;
+class LLTabContainer;
+class LLTabContainerVertical;
+class LLTextBox;
+class LLTextEditor;
+class LLTextureCtrl;
+class LLUICtrl;
+class LLView;
+class LLViewBorder;
+
+#endif