diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/llui/lldockablefloater.cpp | 19 | ||||
-rw-r--r-- | indra/llui/llfloater.cpp | 1 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 1 | ||||
-rw-r--r-- | indra/llui/llpanel.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llradiogroup.cpp | 7 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 11 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 1 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 1 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 6 | ||||
-rw-r--r-- | indra/llui/llview.cpp | 7 |
11 files changed, 42 insertions, 16 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 74b49b846e..82ec02d2eb 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -26,7 +26,6 @@ include_directories( ) set(llui_SOURCE_FILES - llalertdialog.cpp llbutton.cpp llcheckboxctrl.cpp llclipboard.cpp @@ -112,7 +111,6 @@ set(llui_SOURCE_FILES set(llui_HEADER_FILES CMakeLists.txt - llalertdialog.h llbutton.h llcallbackmap.h llcheckboxctrl.h diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index 9c69e4f2b6..9dc7861992 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -38,6 +38,8 @@ //static LLHandle<LLFloater> LLDockableFloater::sInstanceHandle; +static const std::string VOICE_FLOATER("floater_voice_controls"), IM_FLOATER("panel_im"); + //static void LLDockableFloater::init(LLDockableFloater* thiz) { @@ -98,8 +100,15 @@ void LLDockableFloater::toggleInstance(const LLSD& sdname) else if (instance != NULL) { instance->setMinimized(FALSE); - instance->setVisible(TRUE); - gFloaterView->bringToFront(instance); + if (instance->getVisible()) + { + instance->setVisible(FALSE); + } + else + { + instance->setVisible(TRUE); + gFloaterView->bringToFront(instance); + } } } @@ -107,9 +116,11 @@ void LLDockableFloater::resetInstance() { if (mUniqueDocking && sInstanceHandle.get() != this) { - if (sInstanceHandle.get() != NULL && sInstanceHandle.get()->isDocked()) + if (sInstanceHandle.get() != NULL && sInstanceHandle.get()->isDocked() + && (getName() != VOICE_FLOATER || sInstanceHandle.get()->getName() != IM_FLOATER) + && (getName() != IM_FLOATER || sInstanceHandle.get()->getName() != VOICE_FLOATER)) { - sInstanceHandle.get()->setVisible(FALSE); + sInstanceHandle.get()->setVisible(FALSE); } sInstanceHandle = getHandle(); } diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 5fd707fea3..f7fd2dbdfe 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2716,6 +2716,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o params.rect.left.set(0); } + params.from_xui = true; setupParams(params, parent); initFromParams(params); diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 1fb618adee..5e15fa3919 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -246,6 +246,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o output_node, output_params, &default_params); } + p.from_xui = true; setupParams(p, parent); LLLayoutStack* layout_stackp = LLUICtrlFactory::create<LLLayoutStack>(p); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 750b190953..738a96f730 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -37,7 +37,6 @@ #define LLPANEL_CPP #include "llpanel.h" -#include "llalertdialog.h" #include "llfocusmgr.h" #include "llfontgl.h" #include "llrect.h" @@ -542,6 +541,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu output_node, output_params, &default_params); } + params.from_xui = true; setupParams(params, parent); { LLFastTimer timer(FTM_PANEL_CONSTRUCTION); diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 74e30cd633..997b9c13f8 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -112,6 +112,7 @@ void LLRadioGroup::initFromParams(const Params& p) ++it) { LLRadioGroup::ItemParams item_params(*it); + item_params.font.setIfNotProvided(mFont); // apply radio group font by default item_params.commit_callback.function = boost::bind(&LLRadioGroup::onClickButton, this, _1); item_params.from_xui = p.from_xui; @@ -332,7 +333,7 @@ void LLRadioGroup::setValue( const LLSD& value ) iter != mRadioButtons.end(); ++iter) { LLRadioCtrl* radio = *iter; - if (llsd_equals(radio->getPayload(), value)) + if (radio->getPayload().asString() == value.asString()) { setSelectedIndex(idx); idx = -1; @@ -384,7 +385,7 @@ BOOL LLRadioGroup::setSelectedByValue(const LLSD& value, BOOL selected) for (button_list_t::const_iterator iter = mRadioButtons.begin(); iter != mRadioButtons.end(); ++iter) { - if(llsd_equals((*iter)->getPayload(), value)) + if((*iter)->getPayload().asString() == value.asString()) { setSelectedIndex(idx); return TRUE; @@ -406,7 +407,7 @@ BOOL LLRadioGroup::isSelected(const LLSD& value) const for (button_list_t::const_iterator iter = mRadioButtons.begin(); iter != mRadioButtons.end(); ++iter) { - if(llsd_equals((*iter)->getPayload(), value)) + if((*iter)->getPayload().asString() == value.asString()) { if (idx == mSelectedIndex) { diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 1f120a1483..cb0907a771 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1137,6 +1137,11 @@ void LLTextBase::reflow(S32 start_index) // grow line height as necessary based on reported height of this segment line_height = llmax(line_height, segment_height); remaining_pixels -= segment_width; + if (remaining_pixels < 0) + { + // getNumChars() and getDimensions() should return consistent results + remaining_pixels = 0; + } seg_offset += character_count; @@ -2464,6 +2469,12 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin { LLWString text = mEditor.getWText(); + LLUIImagePtr image = mStyle->getImage(); + if( image.notNull()) + { + num_pixels -= image->getWidth(); + } + // search for newline and if found, truncate there S32 last_char = mStart + segment_offset; for (; last_char != mEnd; ++last_char) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 67d3ed408b..1ea6b66a93 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1947,6 +1947,7 @@ namespace LLInitParam if (res_fontp) { mData.mValue = res_fontp; + return; } U8 fontstyle = 0; diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 01715c2792..27237800d4 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -456,3 +456,4 @@ const std::string* LLUICtrlFactory::getWidgetTag(const std::type_info* widget_ty { return LLWidgetNameRegistry::instance().getValue(widget_type); } + diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 9d26a9c9ef..6788f29ba9 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -184,6 +184,8 @@ public: { T* widget = NULL; + T::setupParams(params, parent); + if (!params.validateBlock()) { llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; @@ -307,11 +309,11 @@ fail: } // Apply layout transformations, usually munging rect - T::setupParams(params, parent); - + params.from_xui = true; T* widget = createWidget<T>(params, parent); typedef typename T::child_registry_t registry_t; + createChildren(widget, node, registry_t::instance(), output_node); if (widget && !widget->postBuild()) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 9f6fc1f298..a8d8626e49 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2501,7 +2501,6 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.layout = parent->getLayout(); } - p.from_xui = true; if (parent) { @@ -2510,7 +2509,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) LLRect last_rect = parent->getLocalRect(); bool layout_topleft = (p.layout() == "topleft"); - if (layout_topleft) + if (layout_topleft && p.from_xui) { //invert top to bottom if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top; @@ -2536,7 +2535,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.rect.right.setProvided(false); // recalculate the right } } - else + else if (p.from_xui) // only do negative coordinate magic for XUI { if (p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth(); if (p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth(); @@ -2557,7 +2556,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.rect.top.setProvided(false); // recalculate the top } } - else + else if (p.from_xui) { if (p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight(); if (p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight(); |