From 03ff3dc57d4650c5451c2b304a2ee6fbee3ff74e Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 2 Nov 2009 14:58:24 -0800 Subject: Added hand-cursor to clickable text boxes, fixed hover_color warnings for login screen. Reviewed with Richard. --- indra/llui/lltextbox.cpp | 26 ++++++++++++++++++++++++++ indra/llui/lltextbox.h | 21 ++++++++------------- 2 files changed, 34 insertions(+), 13 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 20bceb4675..00f1d833a3 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -45,6 +45,9 @@ LLTextBox::LLTextBox(const LLTextBox::Params& p) mClickedCallback(NULL) {} +LLTextBox::~LLTextBox() +{} + BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLTextBase::handleMouseDown(x, y, mask); @@ -97,6 +100,18 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) return handled; } +BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) +{ + BOOL handled = LLTextBase::handleHover(x, y, mask); + if (!handled && mClickedCallback) + { + // Clickable text boxes change the cursor to a hand + LLUI::getWindow()->setCursor(UI_CURSOR_HAND); + return TRUE; + } + return handled; +} + void LLTextBox::setText(const LLStringExplicit& text) { // does string argument insertion @@ -105,6 +120,11 @@ void LLTextBox::setText(const LLStringExplicit& text) LLTextBase::setText(mText.getString()); } +void LLTextBox::setClickedCallback( boost::function cb, void* userdata /*= NULL */ ) +{ + mClickedCallback = boost::bind(cb, userdata); +} + S32 LLTextBox::getTextPixelWidth() { return getContentsRect().getWidth(); @@ -115,6 +135,12 @@ S32 LLTextBox::getTextPixelHeight() return getContentsRect().getHeight(); } + +LLSD LLTextBox::getValue() const +{ + return LLSD(getText()); +} + BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text ) { mText.setArg(key, text); diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index da0bcbe972..73f8a7c299 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -33,8 +33,6 @@ #ifndef LL_LLTEXTBOX_H #define LL_LLTEXTBOX_H -#include "v4color.h" -#include "llstring.h" #include "lluistring.h" #include "lltextbase.h" @@ -54,28 +52,25 @@ protected: friend class LLUICtrlFactory; public: - virtual ~LLTextBox() {} + virtual ~LLTextBox(); - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*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 ); void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } - void setClickedCallback( boost::function cb, void* userdata = NULL ){ mClickedCallback = boost::bind(cb, userdata); } // mouse down and up within button - - //const LLFontGL* getFont() const { return mDefaultFont; } - //void setFont(const LLFontGL* font) { mDefaultFont = font; } + void setClickedCallback( boost::function cb, void* userdata = NULL ); void reshapeToFitText(); - //const std::string& getText() const { return mText.getString(); } S32 getTextPixelWidth(); S32 getTextPixelHeight(); - virtual LLSD getValue() const { return LLSD(getText()); } - virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); + /*virtual*/ LLSD getValue() const; + /*virtual*/ BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); protected: void onUrlLabelUpdated(const std::string &url, const std::string &label); -- cgit v1.2.3 From a6b6ca9a24cbc1bfe0b3e45602e1eda1e1e9c8f9 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 2 Nov 2009 14:58:39 -0800 Subject: made floater close/minimize buttons "chrome" so they don't take keyboard focus removed LLHudView::colorFromType which was unused reviewed by James --- indra/llui/llfloater.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 8c72b079ee..26a8b6c48f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1839,6 +1839,7 @@ void LLFloater::buildButtons() p.follows.flags(FOLLOWS_TOP|FOLLOWS_RIGHT); p.tool_tip(sButtonToolTips[i]); p.scale_image(true); + p.chrome(true); LLButton* buttonp = LLUICtrlFactory::create(p); addChild(buttonp); -- cgit v1.2.3 From 995c18b1c7eb8fd23c0a35d5f504c03b7f2b144f Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 2 Nov 2009 19:28:24 -0800 Subject: removed picture_style from LLButton::Params and allow empty labels --- indra/llui/llbutton.cpp | 32 ++++---------------------------- indra/llui/llbutton.h | 5 +---- indra/llui/llfloater.cpp | 1 - indra/llui/llflyoutbutton.cpp | 1 + indra/llui/llmenugl.cpp | 2 -- indra/llui/llscrollbar.cpp | 2 ++ indra/llui/lltabcontainer.cpp | 4 +++- 7 files changed, 11 insertions(+), 36 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index a7946cacf5..8daceb9485 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -95,8 +95,7 @@ LLButton::Params::Params() is_toggle("is_toggle", false), scale_image("scale_image", true), hover_glow_amount("hover_glow_amount"), - commit_on_return("commit_on_return", true), - picture_style("picture_style", false) + commit_on_return("commit_on_return", true) { addSynonym(is_toggle, "toggle"); held_down_delay.seconds = 0.5f; @@ -153,17 +152,9 @@ LLButton::LLButton(const LLButton::Params& p) static LLUICachedControl llbutton_orig_h_pad ("UIButtonOrigHPad", 0); static Params default_params(LLUICtrlFactory::getDefaultParams()); - //if we aren't a picture_style button set label as name if not provided - if (!p.picture_style.isProvided() || !p.picture_style) + if (!p.label_selected.isProvided()) { - if (!p.label.isProvided()) - { - mUnselectedLabel = p.name(); - } - if (!p.label_selected.isProvided()) - { - mSelectedLabel = mUnselectedLabel.getString(); - } + mSelectedLabel = mUnselectedLabel; } // Hack to make sure there is space for at least one character @@ -1099,19 +1090,4 @@ void LLButton::resetMouseDownTimer() { mMouseDownTimer.stop(); mMouseDownTimer.reset(); -} - - -// *TODO: Remove this function after the initial XUI XML re-export pass. -// static -void LLButton::setupParamsForExport(Params& p, LLView* parent) -{ - std::string label = p.label; - if (label.empty()) - { - //if our label is empty this is a picture style button - p.picture_style = true; - } - - LLUICtrl::setupParamsForExport(p, parent); -} +} \ No newline at end of file diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 85580a98bf..08f289092f 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -115,8 +115,7 @@ public: // misc Optional is_toggle, scale_image, - commit_on_return, - picture_style; //if true, don't display label + commit_on_return; Optional hover_glow_amount; Optional held_down_delay; @@ -247,8 +246,6 @@ protected: LLFrameTimer mMouseDownTimer; - // If the label is empty, set the picture_style attribute - static void setupParamsForExport(Params& p, LLView* parent); private: void drawBorder(LLUIImage* imagep, const LLColor4& color, S32 size); void resetMouseDownTimer(); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 26a8b6c48f..90ba2dc41f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1826,7 +1826,6 @@ void LLFloater::buildButtons() LLButton::Params p; p.name(sButtonNames[i]); p.rect(btn_rect); - p.label(""); p.image_unselected.name(sButtonActiveImageNames[i]); // Selected, no matter if hovered or not, is "pressed" p.image_selected.name(sButtonPressedImageNames[i]); diff --git a/indra/llui/llflyoutbutton.cpp b/indra/llui/llflyoutbutton.cpp index 3483bac782..abb0b869eb 100644 --- a/indra/llui/llflyoutbutton.cpp +++ b/indra/llui/llflyoutbutton.cpp @@ -48,6 +48,7 @@ LLFlyoutButton::LLFlyoutButton(const Params& p) // Text label button LLButton::Params bp(p.action_button); bp.name(p.label); + bp.label(p.label); bp.rect.left(0).bottom(0).width(getRect().getWidth() - FLYOUT_BUTTON_ARROW_WIDTH).height(getRect().getHeight()); bp.click_callback.function(boost::bind(&LLFlyoutButton::onActionButtonClick, this, _2)); bp.follows.flags(FOLLOWS_ALL); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 91e7e46195..7847cc1790 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1555,8 +1555,6 @@ LLMenuScrollItem::LLMenuScrollItem(const Params& p) } LLButton::Params bparams; - bparams.label(""); - bparams.label_selected(""); bparams.mouse_opaque(true); bparams.scale_image(false); bparams.click_callback(p.scroll_callback); diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index dfd315d451..b450ecbbf9 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -115,6 +115,7 @@ LLScrollbar::LLScrollbar(const Params & p) LLButton::Params up_btn(mOrientation == VERTICAL ? p.up_button : p.left_button); up_btn.name(std::string("Line Up")); + up_btn.label(std::string("Line Up")); up_btn.rect(line_up_rect); up_btn.click_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2)); up_btn.mouse_held_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2)); @@ -125,6 +126,7 @@ LLScrollbar::LLScrollbar(const Params & p) LLButton::Params down_btn(mOrientation == VERTICAL ? p.down_button : p.right_button); down_btn.name(std::string("Line Down")); + down_btn.label(std::string("Line Down")); down_btn.rect(line_down_rect); down_btn.follows.flags(FOLLOWS_RIGHT|FOLLOWS_BOTTOM); down_btn.click_callback.function(boost::bind(&LLScrollbar::onLineDownBtnPressed, this, _2)); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index cde4c75518..6ca9c4ceda 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -927,7 +927,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) textbox = LLUICtrlFactory::create (params); LLButton::Params p; - p.name(""); + p.name("placeholder"); btn = LLUICtrlFactory::create(p); } else @@ -1645,6 +1645,7 @@ void LLTabContainer::initButtons() LLButton::Params prev_btn_params; prev_btn_params.name(std::string("Up Arrow")); + prev_btn_params.label(std::string("Up Arrow")); prev_btn_params.rect(up_arrow_btn_rect); prev_btn_params.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); prev_btn_params.image_unselected.name("scrollbutton_up_out_blue.tga"); @@ -1654,6 +1655,7 @@ void LLTabContainer::initButtons() LLButton::Params next_btn_params; next_btn_params.name(std::string("Down Arrow")); + next_btn_params.label(std::string("Down Arrow")); next_btn_params.rect(down_arrow_btn_rect); next_btn_params.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_LEFT); next_btn_params.image_unselected.name("scrollbutton_down_out_blue.tga"); -- cgit v1.2.3 From b270a792abbfdef95b930cfc61b1e8f0e2aa4c6c Mon Sep 17 00:00:00 2001 From: angela Date: Tue, 3 Nov 2009 13:28:39 +0800 Subject: (i) in inspectors is squished, maybe rectangle too small --- indra/llui/lltooltip.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 23c87c7522..4bc9a9c042 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -198,6 +198,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) { LLButton::Params icon_params; icon_params.name = "tooltip_info"; + icon_params.label(""); // provid label but set to empty so name does not overwrite it -angela LLRect icon_rect; LLUIImage* imagep = p.image; TOOLTIP_ICON_SIZE = (imagep ? imagep->getWidth() : 16); @@ -206,6 +207,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) //icon_params.follows.flags = FOLLOWS_LEFT | FOLLOWS_BOTTOM; icon_params.image_unselected(imagep); icon_params.image_selected(imagep); + icon_params.scale_image(true); icon_params.flash_color(icon_params.highlight_color()); mInfoButton = LLUICtrlFactory::create(icon_params); @@ -223,6 +225,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) { LLButton::Params p_button; p_button.name(std::string("play_media")); + p_button.label(""); // provid label but set to empty so name does not overwrite it -angela TOOLTIP_PLAYBUTTON_SIZE = 16; LLRect button_rect; button_rect.setOriginAndSize((mPadding +TOOLTIP_ICON_SIZE+ mPadding ), mPadding, TOOLTIP_ICON_SIZE, TOOLTIP_ICON_SIZE); @@ -247,6 +250,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) { LLButton::Params p_w_button; p_w_button.name(std::string("home_page")); + p_w_button.label(""); // provid label but set to empty so name does not overwrite it -angela TOOLTIP_PLAYBUTTON_SIZE = 16; LLRect button_rect; button_rect.setOriginAndSize((mPadding +TOOLTIP_ICON_SIZE+ mPadding ), mPadding, TOOLTIP_ICON_SIZE, TOOLTIP_ICON_SIZE); -- cgit v1.2.3 From d3bb2931abefc817af38e1db56fdc93197d01d12 Mon Sep 17 00:00:00 2001 From: CG Linden Date: Mon, 2 Nov 2009 22:21:36 -0800 Subject: Add missing eol at eof --- indra/llui/lliconctrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index 82ffac9580..b1bd2b89a9 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -123,4 +123,5 @@ void LLIconCtrl::setIconImageDrawSize() mImagep->getImage()->setKnownDrawSize(mDrawWidth, mDrawHeight) ; } } -} \ No newline at end of file +} + -- cgit v1.2.3 From f1d834c50d7155102a6482e1c4e4205ddca65be2 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Tue, 3 Nov 2009 17:31:26 +0200 Subject: fix for normal task EXT-239 Save chat window state and position between sessions --HG-- branch : product-engine --- indra/llui/llfloater.cpp | 6 ++++++ indra/llui/llfloater.h | 3 +++ indra/llui/llfloaterreg.cpp | 3 +-- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 8c72b079ee..99aebbcb30 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -772,6 +772,12 @@ LLMultiFloater* LLFloater::getHost() return (LLMultiFloater*)mHostHandle.get(); } +void LLFloater::applySavedVariables() +{ + applyRectControl(); + applyDockState(); +} + void LLFloater::applyRectControl() { if (mRectControl.size() > 1) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index ef0d06a58e..95c8dd84f6 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -280,6 +280,9 @@ public: protected: void setRectControl(const std::string& rectname) { mRectControl = rectname; }; + + virtual void applySavedVariables(); + void applyRectControl(); void applyDockState(); void storeRectControl(); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index aca4dc56ee..f8e07913fb 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -134,8 +134,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe res->mKey = key; res->setInstanceName(name); - res->applyRectControl(); // Can't apply rect control until setting instance name - res->applyDockState();//same... + res->applySavedVariables(); // Can't apply rect and dock state until setting instance name if (res->mAutoTile && !res->getHost() && index > 0) { const LLRect& cur_rect = res->getRect(); -- cgit v1.2.3 From 00e56b09071f4e29ccec1a5451161817ffba4d96 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 3 Nov 2009 19:08:11 +0000 Subject: DEV-41358 DEV-41361: Added support for secondlife:///app/worldmap SLurls to the LLUrlRegistry. These are now displayed with the more human-readable label of "Show Map for XXXX" and sport a context menu with various operations. I also added "Show on Map" options to the context menus for other location-based SLurls. I also internationalized the text for "Teleport to" and the new "Show Map for" strings. --- indra/llui/lltextbase.cpp | 1 + indra/llui/llurlaction.cpp | 12 +++++++++ indra/llui/llurlaction.h | 3 +++ indra/llui/llurlentry.cpp | 58 +++++++++++++++++++++++++++++++++++++++++--- indra/llui/llurlentry.h | 12 +++++++++ indra/llui/llurlregistry.cpp | 1 + 6 files changed, 83 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 9a26f0b472..e11e5f446e 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1419,6 +1419,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) registrar.add("Url.OpenExternal", boost::bind(&LLUrlAction::openURLExternal, url)); registrar.add("Url.Execute", boost::bind(&LLUrlAction::executeSLURL, url)); registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url)); + registrar.add("Url.ShowOnMap", boost::bind(&LLUrlAction::showLocationOnMap, url)); registrar.add("Url.CopyLabel", boost::bind(&LLUrlAction::copyLabelToClipboard, url)); registrar.add("Url.CopyUrl", boost::bind(&LLUrlAction::copyURLToClipboard, url)); diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index f3401f91f7..679db5e39b 100644 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -121,6 +121,18 @@ void LLUrlAction::teleportToLocation(std::string url) } } +void LLUrlAction::showLocationOnMap(std::string url) +{ + LLUrlMatch match; + if (LLUrlRegistry::instance().findUrl(url, match)) + { + if (! match.getLocation().empty()) + { + executeSLURL("secondlife:///app/worldmap/" + match.getLocation()); + } + } +} + void LLUrlAction::copyURLToClipboard(std::string url) { LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(url)); diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index 6b9d565b44..4830cf27ef 100644 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -67,6 +67,9 @@ public: /// if the Url specifies an SL location, teleport there static void teleportToLocation(std::string url); + /// if the Url specifies an SL location, show it on a map + static void showLocationOnMap(std::string url); + /// perform the appropriate action for left-clicking on a Url static void clickAction(std::string url); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 52e4229fb4..ddb6c6baff 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -468,6 +468,7 @@ std::string LLUrlEntryTeleport::getLabel(const std::string &url, const LLUrlLabe LLURI uri(url); LLSD path_array = uri.pathArray(); S32 path_parts = path_array.size(); + const std::string label = LLTrans::getString("SLurlLabelTeleport"); if (path_parts == 6) { // handle teleport url with (X,Y,Z) coordinates @@ -475,7 +476,7 @@ std::string LLUrlEntryTeleport::getLabel(const std::string &url, const LLUrlLabe std::string x = path_array[path_parts-3]; std::string y = path_array[path_parts-2]; std::string z = path_array[path_parts-1]; - return "Teleport to " + location + " (" + x + "," + y + "," + z + ")"; + return label + " " + location + " (" + x + "," + y + "," + z + ")"; } else if (path_parts == 5) { @@ -483,20 +484,20 @@ std::string LLUrlEntryTeleport::getLabel(const std::string &url, const LLUrlLabe std::string location = unescapeUrl(path_array[path_parts-3]); std::string x = path_array[path_parts-2]; std::string y = path_array[path_parts-1]; - return "Teleport to " + location + " (" + x + "," + y + ")"; + return label + " " + location + " (" + x + "," + y + ")"; } else if (path_parts == 4) { // handle teleport url with (X) coordinate only std::string location = unescapeUrl(path_array[path_parts-2]); std::string x = path_array[path_parts-1]; - return "Teleport to " + location + " (" + x + ")"; + return label + " " + location + " (" + x + ")"; } else if (path_parts == 3) { // handle teleport url with no coordinates std::string location = unescapeUrl(path_array[path_parts-1]); - return "Teleport to " + location; + return label + " " + location; } return url; @@ -599,3 +600,52 @@ std::string LLUrlEntrySLLabel::getUrl(const std::string &string) return getUrlFromWikiLink(string); } +// +// LLUrlEntryWorldMap Describes secondlife:/// URLs +// +LLUrlEntryWorldMap::LLUrlEntryWorldMap() +{ + mPattern = boost::regex("secondlife:///app/worldmap/\\S+/?(\\d+)?/?(\\d+)?/?(\\d+)?/?\\S*", + boost::regex::perl|boost::regex::icase); + mMenuName = "menu_url_map.xml"; + mTooltip = LLTrans::getString("TooltipMapUrl"); +} + +std::string LLUrlEntryWorldMap::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + // + // we handle SLURLs in the following formats: + // - secondlife:///app/worldmap/PLACE/X/Y/Z + // - secondlife:///app/worldmap/PLACE/X/Y + // - secondlife:///app/worldmap/PLACE/X + // + LLURI uri(url); + LLSD path_array = uri.pathArray(); + S32 path_parts = path_array.size(); + if (path_parts < 3) + { + return url; + } + + const std::string label = LLTrans::getString("SLurlLabelShowOnMap"); + std::string location = path_array[2]; + std::string x = (path_parts > 3) ? path_array[3] : "128"; + std::string y = (path_parts > 4) ? path_array[4] : "128"; + std::string z = (path_parts > 5) ? path_array[5] : "0"; + return label + " " + location + " (" + x + "," + y + "," + z + ")"; +} + +std::string LLUrlEntryWorldMap::getLocation(const std::string &url) const +{ + // return the part of the Url after secondlife:///app/worldmap/ part + const std::string search_string = "//app/worldmap/"; + size_t pos = url.find(search_string); + if (pos == std::string::npos) + { + return ""; + } + + pos += search_string.size(); + return url.substr(pos, url.size() - pos); +} + diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index afb2fdcde9..180ef85673 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -243,4 +243,16 @@ public: /*virtual*/ std::string getUrl(const std::string &string); }; +/// +/// LLUrlEntryWorldMap Describes a Second Life worldmap Url, e.g., +/// secondlife:///app/worldmap/Ahern/50/50/50 +/// +class LLUrlEntryWorldMap : public LLUrlEntryBase +{ +public: + LLUrlEntryWorldMap(); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getLocation(const std::string &url) const; +}; + #endif diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 249c7320d6..60275b60bc 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -51,6 +51,7 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntryGroup()); registerUrl(new LLUrlEntryParcel()); registerUrl(new LLUrlEntryTeleport()); + registerUrl(new LLUrlEntryWorldMap()); registerUrl(new LLUrlEntryObjectIM()); registerUrl(new LLUrlEntryPlace()); registerUrl(new LLUrlEntrySL()); -- cgit v1.2.3 From c10a40e54ea32825f46f91525814c19f1cb818e6 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 4 Nov 2009 11:53:29 +0000 Subject: DEV-41358: corrected a minor typo in a comment and refactored some code to avoid duplication. --- indra/llui/llurlentry.cpp | 46 ++++++++++++++++------------------------------ indra/llui/llurlentry.h | 2 +- 2 files changed, 17 insertions(+), 31 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index ddb6c6baff..dae4b512d1 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -145,6 +145,18 @@ void LLUrlEntryBase::callObservers(const std::string &id, const std::string &lab } } +static std::string getStringAfterToken(const std::string str, const std::string token) +{ + size_t pos = str.find(token); + if (pos == std::string::npos) + { + return ""; + } + + pos += token.size(); + return str.substr(pos, str.size() - pos); +} + // // LLUrlEntryHTTP Describes generic http: and https: Urls // @@ -154,7 +166,6 @@ LLUrlEntryHTTP::LLUrlEntryHTTP() boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_http.xml"; mTooltip = LLTrans::getString("TooltipHttpUrl"); - //mIcon = "gear.tga"; } std::string LLUrlEntryHTTP::getLabel(const std::string &url, const LLUrlLabelCallback &cb) @@ -390,7 +401,7 @@ std::string LLUrlEntryParcel::getLabel(const std::string &url, const LLUrlLabelC } // -// LLUrlEntryPlace Describes secondlife:/// URLs +// LLUrlEntryPlace Describes secondlife:// URLs // LLUrlEntryPlace::LLUrlEntryPlace() { @@ -433,15 +444,7 @@ std::string LLUrlEntryPlace::getLabel(const std::string &url, const LLUrlLabelCa std::string LLUrlEntryPlace::getLocation(const std::string &url) const { // return the part of the Url after secondlife:// part - const std::string search_string = "://"; - size_t pos = url.find(search_string); - if (pos == std::string::npos) - { - return ""; - } - - pos += search_string.size(); - return url.substr(pos, url.size() - pos); + return ::getStringAfterToken(url, "://"); } // @@ -506,15 +509,7 @@ std::string LLUrlEntryTeleport::getLabel(const std::string &url, const LLUrlLabe std::string LLUrlEntryTeleport::getLocation(const std::string &url) const { // return the part of the Url after ///app/teleport - const std::string search_string = "teleport"; - size_t pos = url.find(search_string); - if (pos == std::string::npos) - { - return ""; - } - - pos += search_string.size() + 1; - return url.substr(pos, url.size() - pos); + return ::getStringAfterToken(url, "app/teleport/"); } /// @@ -638,14 +633,5 @@ std::string LLUrlEntryWorldMap::getLabel(const std::string &url, const LLUrlLabe std::string LLUrlEntryWorldMap::getLocation(const std::string &url) const { // return the part of the Url after secondlife:///app/worldmap/ part - const std::string search_string = "//app/worldmap/"; - size_t pos = url.find(search_string); - if (pos == std::string::npos) - { - return ""; - } - - pos += search_string.size(); - return url.substr(pos, url.size() - pos); + return ::getStringAfterToken(url, "app/worldmap/"); } - diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 180ef85673..4507572b1e 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -186,7 +186,7 @@ public: /// /// LLUrlEntryPlace Describes a Second Life location Url, e.g., -/// secondlife:///Ahern/50/50/50 +/// secondlife://Ahern/50/50/50 /// class LLUrlEntryPlace : public LLUrlEntryBase { -- cgit v1.2.3 From f59c8b5e4e2625930e24ea28cd8e3a713cffed43 Mon Sep 17 00:00:00 2001 From: Sergey Borushevsky Date: Wed, 4 Nov 2009 20:09:06 +0200 Subject: Implemented normal task EXT-2149 (IM Text Editors should display grayed text "TO [avatar_name/group_name/ad-hoc conference]") --HG-- branch : product-engine --- indra/llui/lllineeditor.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 3d7bbdff89..d3daa941cf 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -172,6 +172,8 @@ public: virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text ); void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; } + const std::string& getLabel() { return mLabel.getString(); } + void setText(const LLStringExplicit &new_text); const std::string& getText() const { return mText.getString(); } -- cgit v1.2.3 From 0ee426016aeae605eeb8ab3aa535b2b52462a3d9 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 4 Nov 2009 10:37:13 -0800 Subject: added newline at end of llbutton.cpp removed non-localized, invisible labels from scrollbar and tab container arrows EXT-1626 - there is text overlaping in group info mini inspector reviewed by James --- indra/llui/llbutton.cpp | 2 +- indra/llui/llscrollbar.cpp | 2 -- indra/llui/lltabcontainer.cpp | 4 +--- indra/llui/lltextbase.cpp | 6 +----- 4 files changed, 3 insertions(+), 11 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 8daceb9485..bbaf908d2e 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -1090,4 +1090,4 @@ void LLButton::resetMouseDownTimer() { mMouseDownTimer.stop(); mMouseDownTimer.reset(); -} \ No newline at end of file +} diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index b450ecbbf9..dfd315d451 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -115,7 +115,6 @@ LLScrollbar::LLScrollbar(const Params & p) LLButton::Params up_btn(mOrientation == VERTICAL ? p.up_button : p.left_button); up_btn.name(std::string("Line Up")); - up_btn.label(std::string("Line Up")); up_btn.rect(line_up_rect); up_btn.click_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2)); up_btn.mouse_held_callback.function(boost::bind(&LLScrollbar::onLineUpBtnPressed, this, _2)); @@ -126,7 +125,6 @@ LLScrollbar::LLScrollbar(const Params & p) LLButton::Params down_btn(mOrientation == VERTICAL ? p.down_button : p.right_button); down_btn.name(std::string("Line Down")); - down_btn.label(std::string("Line Down")); down_btn.rect(line_down_rect); down_btn.follows.flags(FOLLOWS_RIGHT|FOLLOWS_BOTTOM); down_btn.click_callback.function(boost::bind(&LLScrollbar::onLineDownBtnPressed, this, _2)); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 6ca9c4ceda..6073b54371 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -986,7 +986,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) p.follows.flags = p.follows.flags() | FOLLOWS_BOTTOM; } - btn = LLUICtrlFactory::create(p); +++ btn = LLUICtrlFactory::create(p); } } @@ -1645,7 +1645,6 @@ void LLTabContainer::initButtons() LLButton::Params prev_btn_params; prev_btn_params.name(std::string("Up Arrow")); - prev_btn_params.label(std::string("Up Arrow")); prev_btn_params.rect(up_arrow_btn_rect); prev_btn_params.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); prev_btn_params.image_unselected.name("scrollbutton_up_out_blue.tga"); @@ -1655,7 +1654,6 @@ void LLTabContainer::initButtons() LLButton::Params next_btn_params; next_btn_params.name(std::string("Down Arrow")); - next_btn_params.label(std::string("Down Arrow")); next_btn_params.rect(down_arrow_btn_rect); next_btn_params.follows.flags(FOLLOWS_BOTTOM | FOLLOWS_LEFT); next_btn_params.image_unselected.name("scrollbutton_down_out_blue.tga"); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 9a26f0b472..8cbb53dda2 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1450,9 +1450,7 @@ void LLTextBase::setText(const LLStringExplicit &utf8str) appendText(text, false); - //resetDirty(); onValueChange(0, getLength()); - needsReflow(); } //virtual @@ -1630,8 +1628,6 @@ void LLTextBase::appendAndHighlightText(const std::string &new_text, bool prepen insertStringNoUndo(getLength(), wide_text, &segments); } - needsReflow(); - // Set the cursor and scroll position if( selection_start != selection_end ) { @@ -2115,7 +2111,7 @@ LLRect LLTextBase::getVisibleDocumentRect() const LLRect doc_rect = mDocumentView->getLocalRect(); doc_rect.mLeft -= mDocumentView->getRect().mLeft; // adjust for height of text above widget baseline - doc_rect.mBottom = llmin(0, doc_rect.getHeight() - mTextRect.getHeight()); + doc_rect.mBottom = doc_rect.getHeight() - mTextRect.getHeight(); return doc_rect; } } -- cgit v1.2.3 From b806edf4ac47d18e1a43fb8dbb5fbcad8d13192f Mon Sep 17 00:00:00 2001 From: Bryan O'Sullivan Date: Wed, 4 Nov 2009 14:59:23 -0800 Subject: Redo Bao's broken merge --- indra/llui/llfloater.cpp | 6 ++++++ indra/llui/llfloater.h | 3 +++ indra/llui/llfloaterreg.cpp | 3 +-- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 8c72b079ee..99aebbcb30 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -772,6 +772,12 @@ LLMultiFloater* LLFloater::getHost() return (LLMultiFloater*)mHostHandle.get(); } +void LLFloater::applySavedVariables() +{ + applyRectControl(); + applyDockState(); +} + void LLFloater::applyRectControl() { if (mRectControl.size() > 1) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index ef0d06a58e..95c8dd84f6 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -280,6 +280,9 @@ public: protected: void setRectControl(const std::string& rectname) { mRectControl = rectname; }; + + virtual void applySavedVariables(); + void applyRectControl(); void applyDockState(); void storeRectControl(); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index aca4dc56ee..f8e07913fb 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -134,8 +134,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe res->mKey = key; res->setInstanceName(name); - res->applyRectControl(); // Can't apply rect control until setting instance name - res->applyDockState();//same... + res->applySavedVariables(); // Can't apply rect and dock state until setting instance name if (res->mAutoTile && !res->getHost() && index > 0) { const LLRect& cur_rect = res->getRect(); -- cgit v1.2.3 From 0520ad677a380e81f6d166bfbcbed23333533b77 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 4 Nov 2009 15:06:56 -0800 Subject: EXT-1739 Preferences > Sounds > Device settings -- Input/Output controls don't work EXT-2073 Need ability to change font style of tab headers EXT-1505 Kill text drop shadow on Menu and Tabs reviewed by Richard --- indra/llui/llmenugl.cpp | 24 ++++++------------------ indra/llui/lltabcontainer.cpp | 4 +++- 2 files changed, 9 insertions(+), 19 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 91e7e46195..36d8e5ed71 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -459,12 +459,6 @@ void LLMenuItemGL::draw( void ) LLColor4 color; - LLFontGL::ShadowType shadow_style = LLFontGL::NO_SHADOW; - if (getEnabled() && !mDrawTextDisabled ) - { - shadow_style = LLFontGL::DROP_SHADOW_SOFT; - } - if ( getEnabled() && getHighlight() ) { color = mHighlightForeground.get(); @@ -482,26 +476,26 @@ void LLMenuItemGL::draw( void ) if (mBriefItem) { mFont->render( mLabel, 0, BRIEF_PAD_PIXELS / 2, 0, color, - LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style ); + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL); } else { if( !mDrawBoolLabel.empty() ) { mFont->render( mDrawBoolLabel.getWString(), 0, (F32)LEFT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color, - LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } mFont->render( mLabel.getWString(), 0, (F32)LEFT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color, - LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); if( !mDrawAccelLabel.empty() ) { mFont->render( mDrawAccelLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color, - LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } if( !mDrawBranchLabel.empty() ) { mFont->render( mDrawBranchLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color, - LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style, S32_MAX, S32_MAX, NULL, FALSE ); + LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } } @@ -1460,12 +1454,6 @@ void LLMenuItemBranchDownGL::draw( void ) gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0 ); } - LLFontGL::ShadowType shadow_style = LLFontGL::NO_SHADOW; - if (getEnabled() && !getDrawTextDisabled() ) - { - shadow_style = LLFontGL::DROP_SHADOW_SOFT; - } - LLColor4 color; if (getHighlight()) { @@ -1480,7 +1468,7 @@ void LLMenuItemBranchDownGL::draw( void ) color = mDisabledColor.get(); } getFont()->render( mLabel.getWString(), 0, (F32)getRect().getWidth() / 2.f, (F32)LABEL_BOTTOM_PAD_PIXELS, color, - LLFontGL::HCENTER, LLFontGL::BOTTOM, LLFontGL::NORMAL, shadow_style ); + LLFontGL::HCENTER, LLFontGL::BOTTOM, LLFontGL::NORMAL); // underline navigation key only when keyboard navigation has been initiated diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index cde4c75518..04c57dcb4e 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -155,7 +155,7 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mTotalTabWidth(0), mTabPosition(p.tab_position), mFontHalign(p.font_halign), - mFont(p.font.isProvided() ? p.font() : (mIsVertical ? LLFontGL::getFontSansSerif() : LLFontGL::getFontSansSerifSmall())), + mFont(p.font), mFirstTabParams(p.first_tab), mMiddleTabParams(p.middle_tab), mLastTabParams(p.last_tab) @@ -946,6 +946,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) p.scale_image(true); p.font_halign = mFontHalign; p.tab_stop(false); + p.label_shadow(false); if (indent) { p.pad_left(indent); @@ -965,6 +966,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) p.image_unselected(tab_img); p.image_selected(tab_selected_img); p.tab_stop(false); + p.label_shadow(false); // Try to squeeze in a bit more text p.pad_left(4); p.pad_right(2); -- cgit v1.2.3 From 83fb99a9ac2f07334233e7307cc18a4d340c8527 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 4 Nov 2009 18:28:45 -0800 Subject: ext-2038 - script editor, cursor becomes stuck in some rows ext-2037 0 Script editor, garbage characters inserted in text --- indra/llui/lltextbase.cpp | 28 ++++++++++++++++++++++------ indra/llui/lltextbase.h | 6 +++--- 2 files changed, 25 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index e5aac0d5e7..97ba691341 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1108,7 +1108,7 @@ void LLTextBase::reflow(S32 start_index) S32_MAX); S32 segment_width, segment_height; - segment->getDimensions(seg_offset, character_count, segment_width, segment_height); + bool force_newline = segment->getDimensions(seg_offset, character_count, segment_width, segment_height); // grow line height as necessary based on reported height of this segment line_height = llmax(line_height, segment_height); remaining_pixels -= segment_width; @@ -1153,6 +1153,18 @@ void LLTextBase::reflow(S32 start_index) else { // subtract pixels used and increment segment + if (force_newline) + { + mLineInfoList.push_back(line_info( + line_start_index, + last_segment_char_on_line, + line_rect, + line_count)); + line_start_index = segment->getStart() + seg_offset; + cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels; + line_height = 0; + remaining_pixels = text_width; + } ++seg_iter; seg_offset = 0; } @@ -2124,7 +2136,7 @@ LLRect LLTextBase::getVisibleDocumentRect() const LLTextSegment::~LLTextSegment() {} -void LLTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { width = 0; height = 0; } +bool LLTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { width = 0; height = 0; return false;} S32 LLTextSegment::getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const { return 0; } S32 LLTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const { return 0; } void LLTextSegment::updateLayout(const LLTextBase& editor) {} @@ -2352,12 +2364,13 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) mTooltip = tooltip; } -void LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const +bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { LLWString text = mEditor.getWText(); height = mFontHeight; width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); + return num_chars >= 1 && text[mStart + num_chars - 1] == '\n'; } S32 LLNormalTextSegment::getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const @@ -2404,8 +2417,9 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin // but not both S32 last_char_in_run = mStart + segment_offset + num_chars; // check length first to avoid indexing off end of string - if (last_char_in_run >= mEditor.getLength() - || text[last_char_in_run] == '\n') + if (last_char_in_run < mEnd + && (last_char_in_run >= mEditor.getLength() + || text[last_char_in_run] == '\n')) { num_chars++; } @@ -2444,7 +2458,7 @@ LLInlineViewSegment::~LLInlineViewSegment() mView->die(); } -void LLInlineViewSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const +bool LLInlineViewSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { if (first_char == 0 && num_chars == 0) { @@ -2458,6 +2472,8 @@ void LLInlineViewSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt width = mLeftPad + mRightPad + mView->getRect().getWidth(); height = mBottomPad + mTopPad + mView->getRect().getHeight(); } + + return false; } S32 LLInlineViewSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 4cca522a23..8cae8fde22 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -370,7 +370,7 @@ public: LLTextSegment(S32 start, S32 end) : mStart(start), mEnd(end){}; virtual ~LLTextSegment(); - virtual void getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; + virtual bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; virtual S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; virtual S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; virtual void updateLayout(const class LLTextBase& editor); @@ -421,7 +421,7 @@ public: LLNormalTextSegment( const LLStyleSP& style, S32 start, S32 end, LLTextBase& editor ); LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, BOOL is_visible = TRUE); - /*virtual*/ void getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; + /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); @@ -474,7 +474,7 @@ public: LLInlineViewSegment(const Params& p, S32 start, S32 end); ~LLInlineViewSegment(); - /*virtual*/ void getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; + /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; /*virtual*/ void updateLayout(const class LLTextBase& editor); /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); -- cgit v1.2.3 From 0292fec348dbe3c65c6e56b2bef8149e4ce58d54 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 4 Nov 2009 19:22:55 -0800 Subject: fixed clipping not working with gl_rect calls EXT-1397 - description edit field is broken --- indra/llui/lllocalcliprect.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lllocalcliprect.cpp b/indra/llui/lllocalcliprect.cpp index 058b6ae178..f5a78e1099 100644 --- a/indra/llui/lllocalcliprect.cpp +++ b/indra/llui/lllocalcliprect.cpp @@ -77,6 +77,8 @@ LLScreenClipRect::LLScreenClipRect(const LLRect& rect, BOOL enabled) LLScreenClipRect::~LLScreenClipRect() { + // finish any deferred calls in this clipping region + gGL.flush(); if (mEnabled) { popClipRect(); -- cgit v1.2.3 From ecaf21b22616cad649784e6874249e35f1feee7b Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 4 Nov 2009 20:46:17 -0800 Subject: better fix for clipping not working --- indra/llui/lllocalcliprect.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllocalcliprect.cpp b/indra/llui/lllocalcliprect.cpp index f5a78e1099..43c21e250c 100644 --- a/indra/llui/lllocalcliprect.cpp +++ b/indra/llui/lllocalcliprect.cpp @@ -77,8 +77,6 @@ LLScreenClipRect::LLScreenClipRect(const LLRect& rect, BOOL enabled) LLScreenClipRect::~LLScreenClipRect() { - // finish any deferred calls in this clipping region - gGL.flush(); if (mEnabled) { popClipRect(); @@ -115,6 +113,9 @@ void LLScreenClipRect::updateScissorRegion() { if (sClipRectStack.empty()) return; + // finish any deferred calls in the old clipping region + gGL.flush(); + LLRect rect = sClipRectStack.top(); stop_glerror(); S32 x,y,w,h; -- cgit v1.2.3 From f8d1644a4132356c2a0220110b9d9bc981f73b16 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Thu, 5 Nov 2009 13:17:12 +0200 Subject: fix for major bug ext-2209 Nearby Chat log is broken --HG-- branch : product-engine --- indra/llui/llfloaterreg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index f8e07913fb..03925f922c 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -367,7 +367,7 @@ std::string LLFloaterReg::declareVisibilityControl(const std::string& name) std::string LLFloaterReg::declareDockStateControl(const std::string& name) { std::string controlname = getDockStateControlName(name); - LLUI::sSettingGroups["floater"]->declareBOOL(controlname, FALSE, + LLUI::sSettingGroups["floater"]->declareBOOL(controlname, TRUE, llformat("Window Docking state for %s", name.c_str()), TRUE); return controlname; -- cgit v1.2.3 From 0a7290772a6b39555adb966c7a48ef44151c1f05 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 5 Nov 2009 15:36:11 -0800 Subject: moved scroll_column_header default params to scroll_column_header.xml reviewed by James --- indra/llui/llscrolllistcolumn.cpp | 11 +++-------- indra/llui/llscrolllistctrl.cpp | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index ba53f84877..d281341202 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -44,6 +44,9 @@ const S32 MIN_COLUMN_WIDTH = 20; +// defaults for LLScrollColumnHeader param block pulled from widgets/scroll_column_header.xml +static LLWidgetNameRegistry::StaticRegistrar sRegisterColumnHeaderParams(&typeid(LLScrollColumnHeader::Params), "scroll_column_header"); + //--------------------------------------------------------------------------- // LLScrollColumnHeader //--------------------------------------------------------------------------- @@ -51,15 +54,7 @@ LLScrollColumnHeader::Params::Params() : column("column") { name = "column_header"; - image_unselected.name("square_btn_32x128.tga"); - image_selected.name("square_btn_selected_32x128.tga"); - image_disabled.name("square_btn_32x128.tga"); - image_disabled_selected.name("square_btn_selected_32x128.tga"); - image_overlay.name("combobox_arrow.tga"); - image_overlay_alignment("right"); - font_halign = LLFontGL::LEFT; tab_stop(false); - scale_image(true); } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index a6cd6412e5..1c2c02e1cc 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2624,7 +2624,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params LLRect temp_rect = LLRect(left,top+mHeadingHeight,right,top); - LLScrollColumnHeader::Params params; + LLScrollColumnHeader::Params params(LLUICtrlFactory::getDefaultParams()); params.name = "btn_" + name; params.rect = temp_rect; params.column = new_column; -- cgit v1.2.3 From fac0b6836a59681443fb2bbd13e6b5eb9c07cef5 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 5 Nov 2009 20:36:15 -0800 Subject: refactored top level ui into main_view.xml --- indra/llui/llfloater.cpp | 2 ++ indra/llui/llmenugl.cpp | 6 ++---- indra/llui/llmenugl.h | 4 +++- indra/llui/lltooltip.cpp | 4 +++- 4 files changed, 10 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index aac27e6562..f2cdad8854 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1857,6 +1857,8 @@ void LLFloater::buildButtons() ///////////////////////////////////////////////////// // LLFloaterView +static LLDefaultChildRegistry::Register r("floater_view"); + LLFloaterView::LLFloaterView (const Params& p) : LLUICtrl (p), mFocusCycleMode(FALSE), diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 956e843987..f078b67912 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3247,11 +3247,9 @@ BOOL LLMenuBarGL::handleHover( S32 x, S32 y, MASK mask ) ///============================================================================ LLCoordGL LLMenuHolderGL::sContextMenuSpawnPos(S32_MAX, S32_MAX); -LLMenuHolderGL::LLMenuHolderGL() - : LLPanel() +LLMenuHolderGL::LLMenuHolderGL(const LLMenuHolderGL::Params& p) + : LLPanel(p) { - setName("Menu Holder"); - setMouseOpaque(FALSE); sItemActivationTimer.stop(); mCanHide = TRUE; } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 09d9e407c7..b0681d252d 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -765,7 +765,9 @@ private: class LLMenuHolderGL : public LLPanel { public: - LLMenuHolderGL(); + struct Params : public LLInitParam::Block + {}; + LLMenuHolderGL(const Params& p); virtual ~LLMenuHolderGL() {} virtual BOOL hideMenus(); diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 4bc9a9c042..fe1c2ba67c 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -57,6 +57,8 @@ LLToolTipView *gToolTipView = NULL; // Member functions // +static LLDefaultChildRegistry::Register register_tooltip_view("tooltip_view"); + LLToolTipView::Params::Params() { mouse_opaque = false; @@ -142,7 +144,7 @@ void LLToolTipView::drawStickyRect() // -static LLDefaultChildRegistry::Register r("tool_tip"); +static LLDefaultChildRegistry::Register register_tooltip("tool_tip"); LLToolTip::Params::Params() -- cgit v1.2.3 From 0b3bbf8cfc2b3c2afcb9cc79a8c74677d8645b92 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 6 Nov 2009 13:51:16 -0800 Subject: EXT-1501 Menu fonts now configurable in XUI, set size to SansSerifSmall --- indra/llui/llmenugl.cpp | 23 +++++++++++++++++++++++ indra/llui/llmenugl.h | 21 +-------------------- 2 files changed, 24 insertions(+), 20 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 956e843987..c6a38c7ca7 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -118,6 +118,7 @@ const F32 PIE_SHRINK_TIME = 0.2f; // time of transition between unbounded and bo const F32 ACTIVATE_HIGHLIGHT_TIME = 0.3f; +static MenuRegistry::Register register_menu_item("menu_item"); static MenuRegistry::Register register_separator("menu_item_separator"); static MenuRegistry::Register register_menu_item_call("menu_item_call"); static MenuRegistry::Register register_menu_item_check("menu_item_check"); @@ -132,6 +133,28 @@ static LLDefaultChildRegistry::Register register_menu_default("menu"); ///============================================================================ /// Class LLMenuItemGL ///============================================================================ + +LLMenuItemGL::Params::Params() +: shortcut("shortcut"), + jump_key("jump_key", KEY_NONE), + use_mac_ctrl("use_mac_ctrl", false), + rect("rect"), + left("left"), + top("top"), + right("right"), + bottom("bottom"), + width("width"), + height("height"), + bottom_delta("bottom_delta"), + left_delta("left_delta"), + enabled_color("enabled_color"), + disabled_color("disabled_color"), + highlight_bg_color("highlight_bg_color"), + highlight_fg_color("highlight_fg_color") +{ + mouse_opaque = true; +} + // Default constructor LLMenuItemGL::LLMenuItemGL(const LLMenuItemGL::Params& p) : LLUICtrl(p), diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 09d9e407c7..dc8ed3b3fd 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -79,26 +79,7 @@ public: highlight_fg_color; - Params() - : shortcut("shortcut"), - jump_key("jump_key", KEY_NONE), - use_mac_ctrl("use_mac_ctrl", false), - rect("rect"), - left("left"), - top("top"), - right("right"), - bottom("bottom"), - width("width"), - height("height"), - bottom_delta("bottom_delta"), - left_delta("left_delta"), - enabled_color("enabled_color"), - disabled_color("disabled_color"), - highlight_bg_color("highlight_bg_color"), - highlight_fg_color("highlight_fg_color") - { - mouse_opaque = true; - } + Params(); }; protected: -- cgit v1.2.3 From 4eb72a12a2280d3be6ac556ad80eb953d249e8eb Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 9 Nov 2009 15:29:47 -0800 Subject: data driven layout of top-level UI elements EXT-1219 Side tray slide-out animation cleaned up some layout of bottom tray contents reviewed by James --- indra/llui/llconsole.cpp | 2 ++ indra/llui/lllayoutstack.cpp | 43 ++++++++++++++++++++++++++++++++++--------- indra/llui/lllayoutstack.h | 8 +++++++- indra/llui/lluictrlfactory.h | 2 +- indra/llui/llview.cpp | 3 +++ indra/llui/llview.h | 3 --- 6 files changed, 47 insertions(+), 14 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index e0053b4cc7..48c76cf105 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -60,6 +60,8 @@ LLConsole* gConsole = NULL; // Created and destroyed in LLViewerWindow. const F32 FADE_DURATION = 2.f; const S32 MIN_CONSOLE_WIDTH = 200; +static LLDefaultChildRegistry::Register r("console"); + LLConsole::LLConsole(const LLConsole::Params& p) : LLUICtrl(p), LLFixedBuffer(p.max_lines), diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index bac5491943..596b3a3e70 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -137,6 +137,7 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mPanelSpacing(p.border_size), mOrientation((p.orientation() == "vertical") ? VERTICAL : HORIZONTAL), mAnimate(p.animate), + mAnimatedThisFrame(false), mClip(p.clip) {} @@ -172,6 +173,7 @@ void LLLayoutStack::draw() // only force drawing invisible children if visible amount is non-zero drawChild(panelp, 0, 0, !clip_rect.isEmpty()); } + mAnimatedThisFrame = false; } void LLLayoutStack::removeChild(LLView* view) @@ -411,8 +413,10 @@ void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL au } } +static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout(BOOL force_resize) { + LLFastTimer ft(FTM_UPDATE_LAYOUT); static LLUICachedControl resize_bar_overlap ("UIResizeBarOverlap", 0); calcMinExtents(); @@ -431,10 +435,13 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (mAnimate) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_OPEN_TIME)); - if ((*panel_it)->mVisibleAmt > 0.99f) + if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = 1.f; + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_OPEN_TIME)); + if ((*panel_it)->mVisibleAmt > 0.99f) + { + (*panel_it)->mVisibleAmt = 1.f; + } } } else @@ -446,10 +453,13 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (mAnimate) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); - if ((*panel_it)->mVisibleAmt < 0.001f) + if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = 0.f; + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); + if ((*panel_it)->mVisibleAmt < 0.001f) + { + (*panel_it)->mVisibleAmt = 0.f; + } } } else @@ -631,10 +641,10 @@ void LLLayoutStack::updateLayout(BOOL force_resize) // adjust running headroom count based on new sizes shrink_headroom_total += delta_size; - panelp->reshape(new_width, new_height); - panelp->setOrigin(cur_x, cur_y - new_height); + LLRect panel_rect; + panel_rect.setLeftTopAndSize(cur_x, cur_y, new_width, new_height); + panelp->setShape(panel_rect); - LLRect panel_rect = panelp->getRect(); LLRect resize_bar_rect = panel_rect; if (mOrientation == HORIZONTAL) { @@ -705,6 +715,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize) llassert_always(force_resize == FALSE); updateLayout(TRUE); } + + mAnimatedThisFrame = true; } // end LLLayoutStack::updateLayout @@ -772,3 +784,16 @@ void LLLayoutStack::calcMinExtents() } } } + +// update layout stack animations, etc. once per frame +// NOTE: we use this to size world view based on animating UI, *before* we draw the UI +// we might still need to call updateLayout during UI draw phase, in case UI elements +// are resizing themselves dynamically +//static +void LLLayoutStack::idle() +{ + for (LLInstanceTracker::instance_iter it = beginInstances(); it != endInstances(); ++it) + { + (*it)->updateLayout(); + } +} diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 9ded48ef6a..11d604b7ec 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -38,7 +38,7 @@ class LLPanel; -class LLLayoutStack : public LLView +class LLLayoutStack : public LLView, LLInstanceTracker { public: struct Params : public LLInitParam::Block @@ -81,6 +81,10 @@ public: S32 getNumPanels() { return mPanels.size(); } void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); + + + static void idle(); + protected: LLLayoutStack(const Params&); friend class LLUICtrlFactory; @@ -105,6 +109,8 @@ private: S32 mMinHeight; // calculated by calcMinExtents S32 mPanelSpacing; + // true if we already applied animation this frame + bool mAnimatedThisFrame; bool mAnimate; bool mClip; }; // end class LLLayoutStack diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 17e32dc7a9..0ccd3047f6 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -188,7 +188,7 @@ public: T* widget = new T(params); widget->initFromParams(params); if (parent) - widget->setParent(parent); + parent->addChild(widget); return widget; } diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index fe7fd59de8..da564befa9 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1698,8 +1698,11 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const return child; } +static LLFastTimer::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); + LLView* LLView::findChildView(const std::string& name, BOOL recurse) const { + LLFastTimer ft(FTM_FIND_VIEWS); //richard: should we allow empty names? //if(name.empty()) // return NULL; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index c3b442e022..2607120e17 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -267,9 +267,6 @@ public: // remove the specified child from the view, and set it's parent to NULL. virtual void removeChild(LLView* view); - // helper function for lluictrlfactory.h create<> template - void setParent(LLView* parent) { if (parent) parent->addChild(this); } - virtual BOOL postBuild() { return TRUE; } child_tab_order_t getCtrlOrder() const { return mCtrlOrder; } -- cgit v1.2.3 From 668ba958c77d46c87f54f8d6e77b5aac921b5733 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 9 Nov 2009 15:59:53 -0800 Subject: Disabled saving notifications to disk because the load code hasn't worked for months, it spams the logs, and it hits the disk. Discussed with Q, the author. --- indra/llui/llnotifications.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index ef222bad60..eb8cc3e2c5 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -81,6 +81,11 @@ private: void savePersistentNotifications() { + /* NOTE: As of 2009-11-09 the reload of notifications on startup does not + work, and has not worked for months. Skip saving notifications until the + read can be fixed, because this hits the disk once per notification and + causes log spam. James + llinfos << "Saving open notifications to " << mFileName << llendl; llofstream notify_file(mFileName.c_str()); @@ -107,6 +112,7 @@ private: LLPointer formatter = new LLSDXMLFormatter(); formatter->format(output, notify_file, LLSDFormatter::OPTIONS_PRETTY); + */ } void loadPersistentNotifications() -- cgit v1.2.3 From 2bc97bd68a774dd373c5688b5dc660abe90b37cc Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 9 Nov 2009 16:01:21 -0800 Subject: renamed LLLayoutStack::idle to LLLayoutStack::updateClass converted mWorldViewPlaceholder to a LLHandle improved layout of panel_bottomtray reviewed by James --- indra/llui/lllayoutstack.cpp | 2 +- indra/llui/lllayoutstack.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 596b3a3e70..5999e1a29e 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -790,7 +790,7 @@ void LLLayoutStack::calcMinExtents() // we might still need to call updateLayout during UI draw phase, in case UI elements // are resizing themselves dynamically //static -void LLLayoutStack::idle() +void LLLayoutStack::updateClass() { for (LLInstanceTracker::instance_iter it = beginInstances(); it != endInstances(); ++it) { diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 11d604b7ec..8475079f5e 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -83,7 +83,7 @@ public: void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); - static void idle(); + static void updateClass(); protected: LLLayoutStack(const Params&); -- cgit v1.2.3 From c84624b2e9656241bd08ea613e37c9d87087096b Mon Sep 17 00:00:00 2001 From: angela Date: Tue, 10 Nov 2009 10:47:53 +0800 Subject: clean up include llfontgl --- indra/llui/llui.cpp | 1 - indra/llui/llview.cpp | 1 - 2 files changed, 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index a82e6eb372..4cf503b413 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -43,7 +43,6 @@ #include "llrender.h" #include "llrect.h" #include "lldir.h" -#include "llfontgl.h" #include "llgl.h" // Project includes diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index fe7fd59de8..f9b4a6b73d 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -40,7 +40,6 @@ #include "llrender.h" #include "llevent.h" -#include "llfontgl.h" #include "llfocusmgr.h" #include "llrect.h" #include "llstl.h" -- cgit v1.2.3 From caa468a5f184a1c2dd2cd1f2c4a7aafc5acf05d0 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 10 Nov 2009 12:58:10 -0800 Subject: fix for gcc --- indra/llui/lluictrlfactory.cpp | 6 ++++++ indra/llui/lluictrlfactory.h | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index c3c0daed0f..8ab015f2bb 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -449,3 +449,9 @@ const std::string* LLUICtrlFactory::getWidgetTag(const std::type_info* widget_ty { return LLWidgetNameRegistry::instance().getValue(widget_type); } + +// static +void LLUICtrlFactory::connect(LLView* parent, LLView* child) +{ + parent->addChild(child); +} \ No newline at end of file diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 0ccd3047f6..8a9c9e23c1 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -188,10 +188,15 @@ public: T* widget = new T(params); widget->initFromParams(params); if (parent) - parent->addChild(widget); + { + connect(parent, widget); + } return widget; } + // fix for gcc template instantiation annoyance + static void connect(LLView* parent, LLView* child); + LLView* createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t&, LLXMLNodePtr output_node ); template -- cgit v1.2.3 From 25d8cf689aa04a1bd4ebb336714730d29040d05c Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 10 Nov 2009 13:03:16 -0800 Subject: further fixes in gcc land --- indra/llui/lllayoutstack.cpp | 2 +- indra/llui/lllayoutstack.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 5999e1a29e..9399ace1f7 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -792,7 +792,7 @@ void LLLayoutStack::calcMinExtents() //static void LLLayoutStack::updateClass() { - for (LLInstanceTracker::instance_iter it = beginInstances(); it != endInstances(); ++it) + for (LLInstanceTracker::instance_iter it = beginInstances(); it != endInstances(); ++it) { (*it)->updateLayout(); } diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 8475079f5e..3a073fa1b2 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -38,7 +38,7 @@ class LLPanel; -class LLLayoutStack : public LLView, LLInstanceTracker +class LLLayoutStack : public LLView, public LLInstanceTracker { public: struct Params : public LLInitParam::Block -- cgit v1.2.3