From f1eac16260fccce643f499c1b5591f3130003d10 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 1 Jul 2010 11:38:55 -0700 Subject: EXT-8092 My Outfits > If outfit name is longer than can be displayed, show full name in tooltip reviewed by Richard cc#219 --- indra/llui/llaccordionctrltab.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 09cb15d7a8..11b0befdf3 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -249,6 +249,15 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::reshape(S32 width, S32 height LLRect textboxRect(HEADER_TEXT_LEFT_OFFSET,(height+header_height)/2 ,width,(height-header_height)/2); mHeaderTextbox->reshape(textboxRect.getWidth(), textboxRect.getHeight()); mHeaderTextbox->setRect(textboxRect); + + if (mHeaderTextbox->getTextPixelWidth() > mHeaderTextbox->getRect().getWidth()) + { + setToolTip(mHeaderTextbox->getText()); + } + else + { + setToolTip(LLStringUtil::null); + } } void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::onMouseEnter(S32 x, S32 y, MASK mask) @@ -989,6 +998,7 @@ BOOL LLAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask) { //inside tab header //fix for EXT-6619 + mHeader->handleToolTip(x, y, mask); return TRUE; } return LLUICtrl::handleToolTip(x, y, mask); -- cgit v1.2.3 From 551acaa2df046a25f90d716bd1153522821073e9 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Jul 2010 14:19:07 -0700 Subject: eliminated a bunch of silent warnings on startup about multiple widget registration --- indra/llui/llloadingindicator.cpp | 2 +- indra/llui/llui.cpp | 1 - indra/llui/lluictrlfactory.cpp | 20 ++++++++++++++------ indra/llui/lluictrlfactory.h | 5 +++-- 4 files changed, 18 insertions(+), 10 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp index f8b029e19c..bf92f77386 100644 --- a/indra/llui/llloadingindicator.cpp +++ b/indra/llui/llloadingindicator.cpp @@ -41,7 +41,7 @@ #include "lluictrlfactory.h" #include "lluiimage.h" -static LLDefaultChildRegistry::Register r("loading_indicator"); +//static LLDefaultChildRegistry::Register r("loading_indicator"); /////////////////////////////////////////////////////////////////////////////// // LLLoadingIndicator::Data class diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index dff1cb93e7..7f9dca08d2 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -97,7 +97,6 @@ static LLDefaultChildRegistry::Register register_flyout_button(" static LLDefaultChildRegistry::Register register_search_editor("search_editor"); // register other widgets which otherwise may not be linked in -static LLDefaultChildRegistry::Register register_menu_button("menu_button"); static LLDefaultChildRegistry::Register register_loading_indicator("loading_indicator"); diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 6b337e0d74..a46d961709 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -452,14 +452,22 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st { // associate parameter block type with template .xml file std::string* existing_tag = LLWidgetNameRegistry::instance().getValue(param_block_type); - if (existing_tag != NULL && *existing_tag != tag) + if (existing_tag != NULL) { - std::cerr << "Duplicate entry for T::Params, try creating empty param block in derived classes that inherit T::Params" << std::endl; - // forcing crash here - char* foo = 0; - *foo = 1; + if(*existing_tag != tag) + { + std::cerr << "Duplicate entry for T::Params, try creating empty param block in derived classes that inherit T::Params" << std::endl; + // forcing crash here + char* foo = 0; + *foo = 1; + } + else + { + // widget already registered + return; + } } - LLWidgetNameRegistry ::instance().defaultRegistrar().add(param_block_type, tag); + LLWidgetNameRegistry::instance().defaultRegistrar().add(param_block_type, tag); // associate widget type with factory function LLDefaultWidgetRegistry::instance().defaultRegistrar().add(widget_type, creator_func); //FIXME: comment this in when working on schema generation diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 7da96ffce3..c99acee48e 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -373,8 +373,9 @@ LLChildRegistry::Register::Register(const char* tag, LLWidgetCreator LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), &LLUICtrlFactory::createDefaultWidget, tag); // since registry_t depends on T, do this in line here - typedef typename T::child_registry_t registry_t; - LLChildRegistryRegistry::instance().defaultRegistrar().add(&typeid(T), registry_t::instance()); + // TODO: uncomment this for schema generation + //typedef typename T::child_registry_t registry_t; + //LLChildRegistryRegistry::instance().defaultRegistrar().add(&typeid(T), registry_t::instance()); } -- cgit v1.2.3 From ff7a83323dbcb105899f75432403ca3037a2d612 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Jul 2010 15:32:46 -0700 Subject: comments --- indra/llui/llloadingindicator.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp index bf92f77386..2ad5c5a530 100644 --- a/indra/llui/llloadingindicator.cpp +++ b/indra/llui/llloadingindicator.cpp @@ -41,6 +41,7 @@ #include "lluictrlfactory.h" #include "lluiimage.h" +// registered in llui.cpp to avoid being left out by MS linker //static LLDefaultChildRegistry::Register r("loading_indicator"); /////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 187a4b638d8648977fa148bd409750096542fad2 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Jul 2010 19:48:39 -0700 Subject: EXT-7654 - About Land Floater> Icons missing fixed layout of embedded icons in text labels --- indra/llui/lltextbase.cpp | 23 ++++++++++++----------- indra/llui/lltextbase.h | 1 + indra/llui/lluictrl.h | 8 ++------ 3 files changed, 15 insertions(+), 17 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 17e41d9e24..ccd22ee050 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -193,6 +193,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mHPad(p.h_pad), mVPad(p.v_pad), mHAlign(p.font_halign), + mVAlign(p.font_valign), mLineSpacingMult(p.line_spacing.multiple), mLineSpacingPixels(p.line_spacing.pixels), mClipPartial(p.clip_partial && !p.allow_scroll), @@ -482,9 +483,9 @@ void LLTextBase::drawCursor() text_color = mFgColor.get(); fontp = mDefaultFont; } - fontp->render(text, mCursorPos, cursor_rect.mLeft, cursor_rect.mTop, + fontp->render(text, mCursorPos, cursor_rect, LLColor4(1.f - text_color.mV[VRED], 1.f - text_color.mV[VGREEN], 1.f - text_color.mV[VBLUE], alpha), - LLFontGL::LEFT, LLFontGL::TOP, + LLFontGL::LEFT, mVAlign, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, 1); @@ -2435,12 +2436,12 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele S32 end = llmin( selection_start, seg_end ); S32 length = end - start; font->render(text, start, - rect.mLeft, rect.mTop, + rect, color, - LLFontGL::LEFT, LLFontGL::TOP, + LLFontGL::LEFT, mEditor.mVAlign, LLFontGL::NORMAL, mStyle->getShadowType(), - length, rect.getWidth(), + length, &right_x, mEditor.getUseEllipses()); } @@ -2454,12 +2455,12 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele S32 length = end - start; font->render(text, start, - rect.mLeft, rect.mTop, + rect, LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ), - LLFontGL::LEFT, LLFontGL::TOP, + LLFontGL::LEFT, mEditor.mVAlign, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - length, rect.getWidth(), + length, &right_x, mEditor.getUseEllipses()); } @@ -2471,12 +2472,12 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele S32 end = seg_end; S32 length = end - start; font->render(text, start, - rect.mLeft, rect.mTop, + rect, color, - LLFontGL::LEFT, LLFontGL::TOP, + LLFontGL::LEFT, mEditor.mVAlign, LLFontGL::NORMAL, mStyle->getShadowType(), - length, rect.getWidth(), + length, &right_x, mEditor.getUseEllipses()); } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index fe8ebb1b80..ff63cc26f5 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -357,6 +357,7 @@ protected: S32 mHPad; // padding on left of text S32 mVPad; // padding above text LLFontGL::HAlign mHAlign; + LLFontGL::VAlign mVAlign; F32 mLineSpacingMult; // multiple of line height used as space for a single line of text (e.g. 1.5 to get 50% padding) S32 mLineSpacingPixels; // padding between lines const LLFontGL* mDefaultFont; // font that is used when none specified diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index b9a4f61e15..1f9d2c9049 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -47,14 +47,10 @@ const BOOL TAKE_FOCUS_YES = TRUE; const BOOL TAKE_FOCUS_NO = FALSE; -// NOTE: the LLFocusableElement class declaration has been moved from here to llfocusmgr.h. - class LLUICtrl : public LLView, public boost::signals2::trackable { public: - - typedef boost::function commit_callback_t; typedef boost::signals2::signal commit_signal_t; // *TODO: add xml support for this type of signal in the future @@ -111,8 +107,8 @@ public: commit_callback; Optional validate_callback; - Optional mouseenter_callback; - Optional mouseleave_callback; + Optional mouseenter_callback, + mouseleave_callback; Optional control_name; Optional enabled_controls; -- cgit v1.2.3