diff options
author | Dessie Linden <dessie@lindenlab.com> | 2010-07-02 07:07:23 -0700 |
---|---|---|
committer | Dessie Linden <dessie@lindenlab.com> | 2010-07-02 07:07:23 -0700 |
commit | 3de5be44adb91d3a7e1ff3ca8b415964a722ce49 (patch) | |
tree | 12a993fde38848529cdcdbadbce2d58cc383d7d2 /indra/llui | |
parent | 4ffcfe0a5fe21dcb49d79851eb43bd5d80623e0d (diff) | |
parent | 1417bd3985f339915f259bf5971ef21e47e30163 (diff) |
Merged from viewer-release
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 10 | ||||
-rw-r--r-- | indra/llui/llloadingindicator.cpp | 3 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 23 | ||||
-rw-r--r-- | indra/llui/lltextbase.h | 1 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 1 | ||||
-rw-r--r-- | indra/llui/lluictrl.h | 8 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 20 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 5 |
8 files changed, 44 insertions, 27 deletions
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 584d45612e..37fc571bbd 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -259,6 +259,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) @@ -1008,6 +1017,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); diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp index f8b029e19c..2ad5c5a530 100644 --- a/indra/llui/llloadingindicator.cpp +++ b/indra/llui/llloadingindicator.cpp @@ -41,7 +41,8 @@ #include "lluictrlfactory.h" #include "lluiimage.h" -static LLDefaultChildRegistry::Register<LLLoadingIndicator> r("loading_indicator"); +// registered in llui.cpp to avoid being left out by MS linker +//static LLDefaultChildRegistry::Register<LLLoadingIndicator> r("loading_indicator"); /////////////////////////////////////////////////////////////////////////////// // LLLoadingIndicator::Data class 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/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<LLFlyoutButton> register_flyout_button(" static LLDefaultChildRegistry::Register<LLSearchEditor> register_search_editor("search_editor"); // register other widgets which otherwise may not be linked in -static LLDefaultChildRegistry::Register<LLMenuButton> register_menu_button("menu_button"); static LLDefaultChildRegistry::Register<LLLoadingIndicator> register_loading_indicator("loading_indicator"); 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<void (LLUICtrl* ctrl, const LLSD& param)> commit_callback_t; typedef boost::signals2::signal<void (LLUICtrl* ctrl, const LLSD& param)> commit_signal_t; // *TODO: add xml support for this type of signal in the future @@ -111,8 +107,8 @@ public: commit_callback; Optional<EnableCallbackParam> validate_callback; - Optional<CommitCallbackParam> mouseenter_callback; - Optional<CommitCallbackParam> mouseleave_callback; + Optional<CommitCallbackParam> mouseenter_callback, + mouseleave_callback; Optional<std::string> control_name; Optional<EnableControls> enabled_controls; 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<DERIVED>::Register<T>::Register(const char* tag, LLWidgetCreator LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), &LLUICtrlFactory::createDefaultWidget<T>, 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()); } |