diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lldockablefloater.cpp | 23 | ||||
-rw-r--r-- | indra/llui/lldockablefloater.h | 1 | ||||
-rw-r--r-- | indra/llui/lldockcontrol.cpp | 5 | ||||
-rw-r--r-- | indra/llui/lldockcontrol.h | 1 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.cpp | 13 | ||||
-rw-r--r-- | indra/llui/lllayoutstack.h | 13 | ||||
-rw-r--r-- | indra/llui/lltextbase.cpp | 11 | ||||
-rw-r--r-- | indra/llui/lltextbase.h | 3 | ||||
-rw-r--r-- | indra/llui/lltextbox.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltextbox.h | 2 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltexteditor.h | 2 | ||||
-rw-r--r-- | indra/llui/lluicolortable.cpp | 10 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 2 |
15 files changed, 66 insertions, 32 deletions
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index c3dd4ae647..9a2f2ab4d3 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -136,21 +136,10 @@ void LLDockableFloater::setVisible(BOOL visible) void LLDockableFloater::setMinimized(BOOL minimize) { - if(minimize && isDocked()) + if(minimize) { setVisible(FALSE); } - - if (minimize) - { - setCanDock(false); - } - else if (!minimize && mDockControl.get() != NULL && mDockControl.get()->isDockVisible()) - { - setCanDock(true); - } - - LLFloater::setMinimized(minimize); } LLView * LLDockableFloater::getDockWidget() @@ -217,6 +206,16 @@ void LLDockableFloater::draw() LLFloater::draw(); } +void LLDockableFloater::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + if (isDocked()) + { + setDocked(false); + } + + LLFloater::reshape(width, height, called_from_parent); +} + void LLDockableFloater::setDockControl(LLDockControl* dockControl) { mDockControl.reset(dockControl); diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index 46491d8a29..e5f94dca91 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -65,6 +65,7 @@ public: /* virtula */BOOL postBuild(); /* virtual */void setDocked(bool docked, bool pop_on_undock = true); /* virtual */void draw(); + /* virtual */void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); /** * If descendant class overrides setVisible() then it must still invoke its diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index 045505af5b..456a2925a3 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -266,6 +266,11 @@ void LLDockControl::off() mEnabled = false; } +void LLDockControl::forceRecalculatePosition() +{ + mRecalculateDocablePosition = true; +} + void LLDockControl::drawToungue() { if (mEnabled) diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h index eaedb4c307..30a45bedc7 100644 --- a/indra/llui/lldockcontrol.h +++ b/indra/llui/lldockcontrol.h @@ -63,6 +63,7 @@ public: public: void on(); void off(); + void forceRecalculatePosition(); void setDock(LLView* dockWidget); LLView* getDock() { diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 14a6ddb7e0..1fb618adee 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -413,6 +413,19 @@ void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL au } } +bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_widthp, S32* min_heightp) +{ + LayoutPanel* panel = findEmbeddedPanelByName(panel_name); + + if (panel) + { + if (min_widthp) *min_widthp = panel->mMinWidth; + if (min_heightp) *min_heightp = panel->mMinHeight; + } + + return NULL != panel; +} + static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout(BOOL force_resize) { diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 3a073fa1b2..abd5436018 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -81,8 +81,16 @@ public: S32 getNumPanels() { return mPanels.size(); } void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); - - + + /** + * Gets minimal width and/or height of the specified by name panel. + * + * If it is necessary to get only the one dimension pass NULL for another one. + * @returns true if specified by panel_name internal panel exists, false otherwise. + */ + bool getPanelMinSize(const std::string& panel_name, S32* min_widthp, S32* min_heightp); + + void updateLayout(BOOL force_resize = FALSE); static void updateClass(); protected: @@ -92,7 +100,6 @@ protected: private: struct LayoutPanel; - void updateLayout(BOOL force_resize = FALSE); void calcMinExtents(); S32 getDefaultHeight(S32 cur_height); S32 getDefaultWidth(S32 cur_width); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 9706878a57..a06b7e237b 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1451,7 +1451,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) } } -void LLTextBase::setText(const LLStringExplicit &utf8str) +void LLTextBase::setText(const LLStringExplicit &utf8str ,const LLStyle::Params& input_params) { // clear out the existing text and segments getViewModel()->setDisplay(LLWStringUtil::null); @@ -1466,7 +1466,7 @@ void LLTextBase::setText(const LLStringExplicit &utf8str) std::string text(utf8str); LLStringUtil::removeCRLF(text); - appendText(text, false); + appendText(text, false, input_params); onValueChange(0, getLength()); } @@ -1507,8 +1507,11 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c link_params.color = match.getColor(); // apply font name from requested style_params std::string font_name = LLFontGL::nameFromFont(style_params.font()); - link_params.font.name.setIfNotProvided(font_name); - link_params.font.style = "UNDERLINE"; + std::string font_size = LLFontGL::sizeFromFont(style_params.font()); + link_params.font.name(font_name); + link_params.font.size(font_name); + link_params.font.style("UNDERLINE"); + link_params.link_href = match.getUrl(); // output the text before the Url diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index fb01cd1e7c..c376a73615 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -137,8 +137,9 @@ public: // Text accessors // TODO: add optional style parameter - virtual void setText(const LLStringExplicit &utf8str); // uses default style + virtual void setText(const LLStringExplicit &utf8str , const LLStyle::Params& input_params = LLStyle::Params()); // uses default style virtual std::string getText() const; + void setMaxTextLength(S32 length) { mMaxTextByteLength = length; } // wide-char versions void setWText(const LLWString& text); diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 00f1d833a3..4c4123cf45 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -112,12 +112,12 @@ BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) return handled; } -void LLTextBox::setText(const LLStringExplicit& text) +void LLTextBox::setText(const LLStringExplicit& text , const LLStyle::Params& input_params ) { // does string argument insertion mText.assign(text); - LLTextBase::setText(mText.getString()); + LLTextBase::setText(mText.getString(), input_params ); } void LLTextBox::setClickedCallback( boost::function<void (void*)> cb, void* userdata /*= NULL */ ) diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 73f8a7c299..01b4bfa5ed 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -58,7 +58,7 @@ public: /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ void setText( const LLStringExplicit& text ); + /*virtual*/ void setText( const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params() ); void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index d136c6b49d..224f066968 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -311,12 +311,12 @@ LLTextEditor::~LLTextEditor() // LLTextEditor // Public methods -void LLTextEditor::setText(const LLStringExplicit &utf8str) +void LLTextEditor::setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params) { blockUndo(); deselect(); - LLTextBase::setText(utf8str); + LLTextBase::setText(utf8str, input_params); resetDirty(); } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 10fc94dedc..fb014b86bf 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -168,7 +168,7 @@ public: void appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo); // Non-undoable - void setText(const LLStringExplicit &utf8str); + void setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params = LLStyle::Params()); // Removes text from the end of document diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index f1e3000547..9be33483d0 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -192,19 +192,27 @@ void LLUIColorTable::clear() LLUIColor LLUIColorTable::getColor(const std::string& name, const LLColor4& default_color) const { string_color_map_t::const_iterator iter = mUserSetColors.find(name); + if(iter != mUserSetColors.end()) { return LLUIColor(&iter->second); } iter = mLoadedColors.find(name); - return (iter != mLoadedColors.end() ? LLUIColor(&iter->second) : LLUIColor(default_color)); + + if(iter != mLoadedColors.end()) + { + return LLUIColor(&iter->second); + } + + return LLUIColor(default_color); } // update user color, loaded colors are parsed on initialization void LLUIColorTable::setColor(const std::string& name, const LLColor4& color) { setColor(name, color, mUserSetColors); + setColor(name, color, mLoadedColors); } bool LLUIColorTable::loadFromSettings() diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index aaadc1b58d..08fc8fb784 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -38,10 +38,6 @@ #include "llpanel.h" #include "lluictrlfactory.h" -// This breaks the ability to construct dummy LLUICtrls for calls like -// getChild<LLUICtrl>("not-there") -//static LLWidgetNameRegistry::StaticRegistrar r(&typeid(LLUICtrl::Params), "ui_ctrl"); -// This doesn't appear to read/apply ui_ctrl.xml static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl"); LLUICtrl::Params::Params() diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index adfbb41feb..1c1450d7e9 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -433,8 +433,8 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st LLWidgetNameRegistry ::instance().defaultRegistrar().add(param_block_type, tag); // associate widget type with factory function LLDefaultWidgetRegistry::instance().defaultRegistrar().add(widget_type, creator_func); - LLWidgetTypeRegistry::instance().defaultRegistrar().add(tag, widget_type); //FIXME: comment this in when working on schema generation + //LLWidgetTypeRegistry::instance().defaultRegistrar().add(tag, widget_type); //LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &getEmptyParamBlock<T>); } |