diff options
Diffstat (limited to 'indra/newview/llsidepaneltaskinfo.cpp')
-rw-r--r-- | indra/newview/llsidepaneltaskinfo.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 475a6b1da7..f71a4a475b 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -80,6 +80,7 @@ static LLRegisterPanelClassWrapper<LLSidepanelTaskInfo> t_task_info("sidepanel_t LLSidepanelTaskInfo::LLSidepanelTaskInfo() { setMouseOpaque(FALSE); + LLSelectMgr::instance().mUpdateSignal.connect(boost::bind(&LLSidepanelTaskInfo::refreshAll, this)); } @@ -271,7 +272,6 @@ void LLSidepanelTaskInfo::refresh() // BUG: fails if a root and non-root are both single-selected. const BOOL is_perm_modify = (mObjectSelection->getFirstRootNode() && LLSelectMgr::getInstance()->selectGetRootsModify()) || LLSelectMgr::getInstance()->selectGetModify(); - const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); S32 string_index = 0; std::string MODIFY_INFO_STRINGS[] = @@ -365,14 +365,14 @@ void LLSidepanelTaskInfo::refresh() if (is_one_object) { - if (keyboard_focus_view != LineEditorObjectName) + if (!LineEditorObjectName->hasFocus()) { childSetText("Object Name",nodep->mName); } if (LineEditorObjectDesc) { - if (keyboard_focus_view != LineEditorObjectDesc) + if (!LineEditorObjectDesc->hasFocus()) { LineEditorObjectDesc->setText(nodep->mDescription); } @@ -1178,9 +1178,30 @@ void LLSidepanelTaskInfo::save() onCommitIncludeInSearch(getChild<LLCheckBoxCtrl>("search_check"), this); } +// removes keyboard focus so that all fields can be updated +// and then restored focus +void LLSidepanelTaskInfo::refreshAll() +{ + // update UI as soon as we have an object + // but remove keyboard focus first so fields are free to update + LLFocusableElement* focus = NULL; + if (hasFocus()) + { + focus = gFocusMgr.getKeyboardFocus(); + setFocus(FALSE); + } + refresh(); + if (focus) + { + focus->setFocus(TRUE); + } +} + + void LLSidepanelTaskInfo::setObjectSelection(LLObjectSelectionHandle selection) { mObjectSelection = selection; + refreshAll(); } LLSidepanelTaskInfo* LLSidepanelTaskInfo::getActivePanel() |