diff options
-rw-r--r-- | indra/llui/lltextbase.cpp | 8 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 2 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 21 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_general.xml | 10 |
4 files changed, 34 insertions, 7 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 1f120a1483..6c983fd92e 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1138,6 +1138,8 @@ void LLTextBase::reflow(S32 start_index) line_height = llmax(line_height, segment_height); remaining_pixels -= segment_width; + // getNumChars() and getDimensions() should return consistent results + llassert_always(remaining_pixels >= 0); seg_offset += character_count; S32 last_segment_char_on_line = segment->getStart() + seg_offset; @@ -2464,6 +2466,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/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 5807654e43..53967e4963 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -452,4 +452,4 @@ dummy_widget_creator_func_t* LLUICtrlFactory::getDefaultWidgetFunc(const std::ty const std::string* LLUICtrlFactory::getWidgetTag(const std::type_info* widget_type) { return LLWidgetNameRegistry::instance().getValue(widget_type); -} +}
\ No newline at end of file diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index b785102426..60f5fe9e1c 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -311,9 +311,28 @@ fail: params.from_xui = true; - T* widget = createWidget<T>(params, parent); + if (!params.validateBlock()) + { + llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; + } + T* widget; + { + LLFastTimer timer(FTM_WIDGET_CONSTRUCTION); + widget = new T(params); + } + { + LLFastTimer timer(FTM_INIT_FROM_PARAMS); + widget->initFromParams(params); + } + + if (parent) + { + S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1; + setCtrlParent(widget, parent, tab_group); + } typedef typename T::child_registry_t registry_t; + createChildren(widget, node, registry_t::instance(), output_node); if (widget && !widget->postBuild()) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 9721a42dcf..7c9256e69d 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -110,7 +110,7 @@ width="200"> I want to access content rated: </text> - <text + <text type="string" length="1" follows="left|top" @@ -179,7 +179,7 @@ left_pad="5" name="show_location_checkbox" top_delta="5" - width="256" /> + width="256" /> <text type="string" length="1" @@ -216,7 +216,7 @@ layout="topleft" left_pad="12" name="radio3" - value="2" + value="2" width="100" /> </radio_group> <check_box @@ -260,7 +260,7 @@ width="200"> My effects: </text> - <text + <text type="string" length="1" follows="left|top" @@ -344,5 +344,5 @@ word_wrap="true"> log_in_to_change </text_editor> - + </panel> |