diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llpanel.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llradiogroup.cpp | 2 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 34 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 3 | ||||
-rw-r--r-- | indra/llui/lluictrl.h | 3 |
5 files changed, 24 insertions, 20 deletions
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 0d340699c5..07c0f3ce84 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -110,8 +110,6 @@ LLPanel::LLPanel(const LLPanel::Params& p) // *NOTE: Be sure to also change LLPanel::initFromParams(). We have too // many classes derived from LLPanel to retrofit them all to pass in params. { - setIsChrome(FALSE); - if (p.has_border) { addBorder(p.border); diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index f9f0307d17..86bd2f05ce 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -106,7 +106,7 @@ void LLRadioGroup::setIndexEnabled(S32 index, BOOL enabled) child->setEnabled(enabled); if (index == mSelectedIndex && enabled == FALSE) { - mSelectedIndex = -1; + setSelectedIndex(-1); } break; } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index f0238dba49..3ce5a0320b 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -652,6 +652,13 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; + // set focus first, in case click callbacks want to change it + // RN: do we really need to have a tab stop? + if (hasTabStop()) + { + setFocus( TRUE ); + } + // Let scrollbar have first dibs handled = LLTextBase::handleMouseDown(x, y, mask); @@ -694,12 +701,6 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) handled = TRUE; } - if (hasTabStop()) - { - setFocus( TRUE ); - handled = TRUE; - } - // Delay cursor flashing resetCursorBlink(); @@ -708,29 +709,32 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) { - BOOL handled = LLTextBase::handleRightMouseDown(x, y, mask); - if (!handled && hasTabStop()) + if (hasTabStop()) + { + setFocus(TRUE); + } + if (!LLTextBase::handleRightMouseDown(x, y, mask)) { - setFocus( TRUE ); showContextMenu(x, y); - handled = TRUE; } - return handled; + return TRUE; } BOOL LLTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; - handled = LLTextBase::handleMouseDown(x, y, mask); + if (hasTabStop()) + { + setFocus(TRUE); + } - if (!handled) + if (!LLTextBase::handleMouseDown(x, y, mask)) { - setFocus( TRUE ); if( canPastePrimary() ) { setCursorAtLocalPos( x, y, true ); + // does not rely on focus being set pastePrimary(); } } diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0faff5eff6..08fc8fb784 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -42,6 +42,7 @@ static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl"); LLUICtrl::Params::Params() : tab_stop("tab_stop", true), + chrome("chrome", false), label("label"), initial_value("value"), init_callback("init_callback"), @@ -86,6 +87,7 @@ void LLUICtrl::initFromParams(const Params& p) { LLView::initFromParams(p); + setIsChrome(p.chrome); setControlName(p.control_name); if(p.enabled_controls.isProvided()) { @@ -582,7 +584,6 @@ void LLUICtrl::setIsChrome(BOOL is_chrome) // virtual BOOL LLUICtrl::getIsChrome() const { - LLView* parent_ctrl = getParent(); while(parent_ctrl) { diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 45fe47772b..dd22851100 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -126,7 +126,8 @@ public: struct Params : public LLInitParam::Block<Params, LLView::Params> { Optional<std::string> label; - Optional<bool> tab_stop; + Optional<bool> tab_stop, + chrome; Optional<LLSD> initial_value; Optional<CommitCallbackParam> init_callback, |