diff options
author | richard <none@none> | 2009-10-30 11:43:45 -0700 |
---|---|---|
committer | richard <none@none> | 2009-10-30 11:43:45 -0700 |
commit | 0d9682113d28b9814374a784a9724aa1ba4bb942 (patch) | |
tree | 2c627e5da47f695129fce129a1278673263189a2 | |
parent | 95031093c795f3a97cdc673c7b7807c944742ab8 (diff) |
EXT-1980 - Bottom bar buttons retain highlight
EXT-1936 - [BSI] Reversion - clicking on avatar name in group chat should bring up profile
also fixed buttons not working on avatar list in IM window
reviewed by Leyla
-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 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 22 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_bottomtray.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/panel.xml | 3 |
8 files changed, 46 insertions, 24 deletions
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 095200ddc3..56f3edd704 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -104,8 +104,6 @@ LLPanel::LLPanel(const LLPanel::Params& p) mEnableCallbackRegistrar(false), mXMLFilename(p.filename) { - 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, diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ba32e07464..b574a9c110 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2424,19 +2424,35 @@ void LLViewerWindow::updateUI() BOOL handled_by_top_ctrl = FALSE; LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); + LLView* captor_view = dynamic_cast<LLView*>(mouse_captor); + + //FIXME: only include captor and captor's ancestors if mouse is truly over them --RN //build set of views containing mouse cursor by traversing UI hierarchy and testing //screen rect against mouse cursor view_handle_set_t mouse_hover_set; - // start at current mouse captor (if is a view) or UI root - LLView* root_view = NULL; - root_view = dynamic_cast<LLView*>(mouse_captor); + // constraint mouse enter events to children of mouse captor + LLView* root_view = captor_view; + + // if mouse captor doesn't exist or isn't a LLView + // then allow mouse enter events on entire UI hierarchy if (!root_view) { root_view = mRootView; } + // include all ancestors of captor_view as automatically having mouse + if (captor_view) + { + LLView* captor_parent_view = captor_view->getParent(); + while(captor_parent_view) + { + mouse_hover_set.insert(captor_parent_view->getHandle()); + captor_parent_view = captor_parent_view->getParent(); + } + } + // aggregate visible views that contain mouse cursor in display order // while the top_ctrl contains the mouse cursor, only it and its descendants will receive onMouseEnter events diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 9065c6b3e8..73a1bae1c6 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -10,6 +10,7 @@ left="0" name="bottom_tray" top="28" + chrome="true" border_visible="false" width="1000"> <layout_stack diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml index b81a70b845..2bcdd26f82 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -2,4 +2,5 @@ <panel bg_opaque_color="PanelFocusBackgroundColor" bg_alpha_color="PanelDefaultBackgroundColor" background_visible="false" - background_opaque="false"/>
\ No newline at end of file + background_opaque="false" + chrome="false"/>
\ No newline at end of file |