From 3dea03ed4af39f11dd554d07085726c37b56e00b Mon Sep 17 00:00:00 2001 From: Kadah_Coba Date: Sat, 2 Mar 2019 23:34:31 -0800 Subject: Added LLTextBase::setParseHTML --- indra/llui/lltextbase.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 5fdde445ef..3331b8aeee 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -366,6 +366,8 @@ public: virtual void onFocusReceived(); virtual void onFocusLost(); + void setParseHTML(bool parse_html) { mParseHTML = parse_html; } + // LLSpellCheckMenuHandler overrides /*virtual*/ bool getSpellCheck() const; -- cgit v1.3 From 4e2f5cda29c39ef041f773a4b897f3cfb0332f77 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 21 Mar 2019 16:10:43 +0200 Subject: SL-10727 FIXED Profile windows are not using last set size --- indra/llui/llfloater.cpp | 17 ++++++++++++++--- indra/llui/llfloater.h | 1 + indra/newview/llfloaterprofile.cpp | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index a245dd8f78..d1e0b3e0b7 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -252,6 +252,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mMinHeight(p.min_height), mHeaderHeight(p.header_height), mLegacyHeaderHeight(p.legacy_header_height), + mDefaultRectForGroup(true), mMinimized(FALSE), mForeground(FALSE), mFirstLook(TRUE), @@ -892,7 +893,10 @@ bool LLFloater::applyRectControl() if (last_in_group && last_in_group != this) { // other floaters in our group, position ourselves relative to them and don't save the rect - mRectControl.clear(); + if (mDefaultRectForGroup) + { + mRectControl.clear(); + } mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP; } else @@ -3399,8 +3403,15 @@ void LLFloater::stackWith(LLFloater& other) } next_rect.translate(floater_offset, -floater_offset); - next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight()); - + const LLRect& rect = getControlGroup()->getRect(mRectControl); + if (rect.notEmpty() && !mDefaultRectForGroup && mResizable) + { + next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, llmax(mMinWidth, rect.getWidth()), llmax(mMinHeight, rect.getHeight())); + } + else + { + next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight()); + } setShape(next_rect); if (!other.getHost()) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 165f67499b..475a790b14 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -436,6 +436,7 @@ public: protected: bool mSaveRect; + bool mDefaultRectForGroup; std::string mRectControl; std::string mPosXControl; std::string mPosYControl; diff --git a/indra/newview/llfloaterprofile.cpp b/indra/newview/llfloaterprofile.cpp index 6b8f881b08..1bf5826c29 100644 --- a/indra/newview/llfloaterprofile.cpp +++ b/indra/newview/llfloaterprofile.cpp @@ -39,6 +39,7 @@ LLFloaterProfile::LLFloaterProfile(const LLSD& key) mAvatarId(key["id"].asUUID()), mNameCallbackConnection() { + mDefaultRectForGroup = false; } LLFloaterProfile::~LLFloaterProfile() -- cgit v1.3 From 8a3fce881fbf971046be50d9d7198e58772e3164 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 18 Apr 2019 19:26:37 +0300 Subject: SL-10791 [Legacy Profiles] Functionality to copy agent id and name from profile --- indra/llui/llmenubutton.cpp | 8 ++++ indra/llui/llmenubutton.h | 3 +- indra/newview/llpanelprofile.cpp | 37 +++++++++++++++- indra/newview/llpanelprofile.h | 2 + .../skins/default/textures/icons/CopyBright.png | Bin 0 -> 519 bytes indra/newview/skins/default/textures/textures.xml | 1 + .../skins/default/xui/en/menu_name_field.xml | 22 ++++++++++ .../default/xui/en/panel_profile_secondlife.xml | 48 ++++++++++++++++----- 8 files changed, 109 insertions(+), 12 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/CopyBright.png create mode 100644 indra/newview/skins/default/xui/en/menu_name_field.xml (limited to 'indra/llui') diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp index 303afcda15..583704418b 100644 --- a/indra/llui/llmenubutton.cpp +++ b/indra/llui/llmenubutton.cpp @@ -40,6 +40,7 @@ void LLMenuButton::MenuPositions::declareValues() declare("topleft", MP_TOP_LEFT); declare("topright", MP_TOP_RIGHT); declare("bottomleft", MP_BOTTOM_LEFT); + declare("bottomright", MP_BOTTOM_RIGHT); } LLMenuButton::Params::Params() @@ -212,6 +213,13 @@ void LLMenuButton::updateMenuOrigin() mY = rect.mBottom; break; } + case MP_BOTTOM_RIGHT: + { + const LLRect& menu_rect = menu->getRect(); + mX = rect.mRight - menu_rect.getWidth(); + mY = rect.mBottom; + break; + } } } diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h index 67ec1983b3..e42f8f53bd 100644 --- a/indra/llui/llmenubutton.h +++ b/indra/llui/llmenubutton.h @@ -41,7 +41,8 @@ public: { MP_TOP_LEFT, MP_TOP_RIGHT, - MP_BOTTOM_LEFT + MP_BOTTOM_LEFT, + MP_BOTTOM_RIGHT } EMenuPosition; struct MenuPositions diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index e5fa8de6a0..d40f874f24 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -34,7 +34,7 @@ // UI #include "llavatariconctrl.h" -// #include "llclipboard.h" //gClipboard +#include "llclipboard.h" #include "llcheckboxctrl.h" #include "lllineeditor.h" #include "llloadingindicator.h" @@ -269,8 +269,10 @@ BOOL LLPanelProfileSecondLife::postBuild() mGroupInviteButton = getChild("group_invite"); mPayButton = getChild("pay"); mIMButton = getChild("im"); + mCopyMenuButton = getChild("copy_btn"); mStatusText->setVisible(FALSE); + mCopyMenuButton->setVisible(FALSE); mAddFriendButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onAddFriendButtonClick, this)); mIMButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onIMButtonClick, this)); @@ -283,6 +285,9 @@ BOOL LLPanelProfileSecondLife::postBuild() mDisplayNameButton->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onClickSetName, this)); mSecondLifePic->setCommitCallback(boost::bind(&LLPanelProfileSecondLife::onCommitTexture, this)); + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar commit; + commit.add("Profile.CopyName", [this](LLUICtrl*, const LLSD& userdata) { onCommitMenu(userdata); }); + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable; enable.add("Profile.EnableCall", [this](LLUICtrl*, const LLSD&) { return mVoiceStatus; }); enable.add("Profile.EnableGod", [](LLUICtrl*, const LLSD&) { return gAgent.isGodlike(); }); @@ -291,6 +296,7 @@ BOOL LLPanelProfileSecondLife::postBuild() mGroupList->setReturnCallback(boost::bind(&LLPanelProfileSecondLife::openGroupProfile, this)); LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this); + mCopyMenuButton->setMenu("menu_name_field.xml", LLMenuButton::MP_BOTTOM_RIGHT); return TRUE; } @@ -407,6 +413,7 @@ void LLPanelProfileSecondLife::resetData() mDescriptionEdit->setValue(LLStringUtil::null); mStatusText->setVisible(FALSE); + mCopyMenuButton->setVisible(FALSE); mGroups.clear(); mGroupList->setGroups(mGroups); } @@ -467,6 +474,7 @@ void LLPanelProfileSecondLife::onAvatarNameCache(const LLUUID& agent_id, const L mAvatarNameCacheConnection.disconnect(); getChild("complete_name")->setValue( av_name.getCompleteName() ); + mCopyMenuButton->setVisible(TRUE); } void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data) @@ -763,6 +771,33 @@ void LLPanelProfileSecondLife::onCommitTexture() } } +void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata) +{ + LLAvatarName av_name; + if (!LLAvatarNameCache::get(getAvatarId(), &av_name)) + { + // shouldn't happen, button(menu) is supposed to be invisible while name is fetching + LL_WARNS() << "Failed to get agent data" << LL_ENDL; + return; + } + + const std::string item_name = userdata.asString(); + LLWString wstr; + if (item_name == "display") + { + wstr = utf8str_to_wstring(av_name.getDisplayName()); + } + else if (item_name == "name") + { + wstr = utf8str_to_wstring(av_name.getAccountName()); + } + else if (item_name == "id") + { + wstr = utf8str_to_wstring(getAvatarId().asString()); + } + LLClipboard::instance().copyToClipboard(wstr, 0, wstr.size()); +} + void LLPanelProfileSecondLife::onAvatarNameCacheSetName(const LLUUID& agent_id, const LLAvatarName& av_name) { if (av_name.getDisplayName().empty()) diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 4ed09761df..ba98a360fa 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -178,6 +178,7 @@ private: /*virtual*/ void updateButtons(); void onClickSetName(); void onCommitTexture(); + void onCommitMenu(const LLSD& userdata); void onAvatarNameCacheSetName(const LLUUID& id, const LLAvatarName& av_name); private: @@ -201,6 +202,7 @@ private: LLButton* mGroupInviteButton; LLButton* mPayButton; LLButton* mIMButton; + LLMenuButton* mCopyMenuButton; bool mVoiceStatus; diff --git a/indra/newview/skins/default/textures/icons/CopyBright.png b/indra/newview/skins/default/textures/icons/CopyBright.png new file mode 100644 index 0000000000..8d21c47295 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/CopyBright.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 2540ee148d..444ad358c3 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -187,6 +187,7 @@ with the same filename but different name + diff --git a/indra/newview/skins/default/xui/en/menu_name_field.xml b/indra/newview/skins/default/xui/en/menu_name_field.xml new file mode 100644 index 0000000000..3c5e5dd353 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_name_field.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml index 8ebb1522b4..e577e6a4d2 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -112,23 +112,51 @@ layout="topleft" visible="false" /> - + border_visible="false"> + + + + Date: Thu, 25 Apr 2019 23:03:18 +0300 Subject: SL-11028 [Legacy Profiles] Selection in account field is malfunctioning --- indra/llui/lltextbase.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index c570285856..61bb64547c 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -445,8 +445,48 @@ void LLTextBase::drawSelectionBackground() ++rect_it) { LLRect selection_rect = *rect_it; - selection_rect = *rect_it; - selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom); + if (mScroller) + { + // If scroller is On content_display_rect has correct rect and safe to use as is + // Note: we might need to account for border + selection_rect.translate(mVisibleTextRect.mLeft - content_display_rect.mLeft, mVisibleTextRect.mBottom - content_display_rect.mBottom); + } + else + { + // If scroller is Off content_display_rect will have rect from document, adjusted to text width, heigh and position + // and we have to acount for offset depending on position + S32 v_delta = 0; + S32 h_delta = 0; + switch (mVAlign) + { + case LLFontGL::TOP: + v_delta = mVisibleTextRect.mTop - content_display_rect.mTop - mVPad; + break; + case LLFontGL::VCENTER: + v_delta = (llmax(mVisibleTextRect.getHeight() - content_display_rect.mTop, -content_display_rect.mBottom) + (mVisibleTextRect.mBottom - content_display_rect.mBottom)) / 2; + break; + case LLFontGL::BOTTOM: + v_delta = mVisibleTextRect.mBottom - content_display_rect.mBottom; + break; + default: + break; + } + switch (mHAlign) + { + case LLFontGL::LEFT: + h_delta = mVisibleTextRect.mLeft - content_display_rect.mLeft + mHPad; + break; + case LLFontGL::HCENTER: + h_delta = (llmax(mVisibleTextRect.getWidth() - content_display_rect.mLeft, -content_display_rect.mRight) + (mVisibleTextRect.mRight - content_display_rect.mRight)) / 2; + break; + case LLFontGL::RIGHT: + h_delta = mVisibleTextRect.mRight - content_display_rect.mRight; + break; + default: + break; + } + selection_rect.translate(h_delta, v_delta); + } gl_rect_2d(selection_rect, selection_color); } } -- cgit v1.3 From 7ff3fe945378f6b43474e99b53e25fe92d69d211 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 3 Jun 2019 19:49:44 +0300 Subject: SL-11340 [Legacy profiles] The classifieds list cannot be scrolled down --- indra/llui/lltabcontainer.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 6521b883f8..1bb666abba 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -392,9 +392,13 @@ void LLTabContainer::draw() S32 cur_scroll_pos = getScrollPos(); if (cur_scroll_pos > 0) { - S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_arrow_btn_size + tabcntr_arrow_btn_size + 1); - if (!mIsVertical) + if (mIsVertical) { + target_pixel_scroll = cur_scroll_pos * (BTN_HEIGHT + tabcntrv_pad); + } + else + { + S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_arrow_btn_size + tabcntr_arrow_btn_size + 1); for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) { if (cur_scroll_pos == 0) @@ -1175,13 +1179,15 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) sendChildToFront(mNextArrowBtn); sendChildToFront(mJumpPrevArrowBtn); sendChildToFront(mJumpNextArrowBtn); - + + updateMaxScrollPos(); + if( select ) { selectLastTab(); + mScrollPos = mMaxScrollPos; } - updateMaxScrollPos(); } void LLTabContainer::addPlaceholder(LLPanel* child, const std::string& label) @@ -2063,9 +2069,9 @@ void LLTabContainer::updateMaxScrollPos() if( tab_total_height > available_height ) { static LLUICachedControl tabcntrv_arrow_btn_size ("UITabCntrvArrowBtnSize", 0); - S32 available_height_with_arrows = getRect().getHeight() - 2*(tabcntrv_arrow_btn_size + 3*tabcntrv_pad); + S32 available_height_with_arrows = getRect().getHeight() - 2*(tabcntrv_arrow_btn_size + 3*tabcntrv_pad) - mNextArrowBtn->getRect().mBottom; S32 additional_needed = tab_total_height - available_height_with_arrows; - setMaxScrollPos((S32) ceil(additional_needed / float(BTN_HEIGHT) ) ); + setMaxScrollPos((S32) ceil(additional_needed / float(BTN_HEIGHT + tabcntrv_pad) ) ); no_scroll = FALSE; } } -- cgit v1.3 From 3d5ffd0af31bb59a839ea6b0d84a2fa11eee734c Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 2 Dec 2019 16:28:13 +0200 Subject: SL-12003 FIXED Viewer Icons do not display in Profiles --- indra/llui/lltextbase.cpp | 6 ++++-- indra/llui/lltextbase.h | 4 +++- indra/newview/skins/default/xui/en/panel_profile_pick.xml | 1 + indra/newview/skins/default/xui/en/panel_profile_secondlife.xml | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 5fc647e410..c20763561c 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -162,6 +162,7 @@ LLTextBase::Params::Params() font_shadow("font_shadow"), wrap("wrap"), trusted_content("trusted_content", true), + always_show_icons("always_show_icons", false), use_ellipses("use_ellipses", false), parse_urls("parse_urls", false), force_urls_external("force_urls_external", false), @@ -209,6 +210,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mClip(p.clip), mClipPartial(p.clip_partial && !p.allow_scroll), mTrustedContent(p.trusted_content), + mAlwaysShowIcons(p.always_show_icons), mTrackEnd( p.track_end ), mScrollIndex(-1), mSelectionStart( 0 ), @@ -2120,7 +2122,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para LLUrlMatch match; std::string text = new_text; while ( LLUrlRegistry::instance().findUrl(text, match, - boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3),isContentTrusted())) + boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3),isContentTrusted() || mAlwaysShowIcons)) { start = match.getStart(); end = match.getEnd()+1; @@ -2145,7 +2147,7 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para } // add icon before url if need - LLTextUtil::processUrlMatch(&match, this, isContentTrusted() || match.isTrusted()); + LLTextUtil::processUrlMatch(&match, this, isContentTrusted() || match.isTrusted() || mAlwaysShowIcons); if ((isContentTrusted() || match.isTrusted()) && !match.getIcon().empty() ) { setLastSegmentToolTip(LLTrans::getString("TooltipSLIcon")); diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index bff839f6c3..3d7eecdceb 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -319,7 +319,8 @@ public: parse_highlights, clip, clip_partial, - trusted_content; + trusted_content, + always_show_icons; Optional v_pad, h_pad; @@ -692,6 +693,7 @@ protected: bool mPlainText; // didn't use Image or Icon segments bool mAutoIndent; S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes + bool mAlwaysShowIcons; // support widgets LLHandle mPopupMenuHandle; diff --git a/indra/newview/skins/default/xui/en/panel_profile_pick.xml b/indra/newview/skins/default/xui/en/panel_profile_pick.xml index 47d6e9ebbd..0417df43c9 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_pick.xml @@ -37,6 +37,7 @@ Date: Mon, 6 Jun 2022 21:27:13 +0300 Subject: SL-15312 Fixed group names not having padding Plus some focus and interactibility fixes --- indra/llui/lliconctrl.cpp | 13 +++++++++++++ indra/llui/lliconctrl.h | 7 ++++++- indra/newview/llfloaterprofiletexture.cpp | 20 +++++++++++--------- indra/newview/llfloaterprofiletexture.h | 13 ++++++++----- indra/newview/llgrouplist.cpp | 21 +++++++++++---------- indra/newview/llgrouplist.h | 2 +- indra/newview/llpanelprofile.cpp | 22 +++++++++++++++++++--- indra/newview/llpanelprofile.h | 16 ++++++++-------- .../default/xui/en/panel_profile_secondlife.xml | 7 +++++++ 9 files changed, 84 insertions(+), 37 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index 82b01e705d..e01aba402e 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -35,6 +35,7 @@ #include "llui.h" #include "lluictrlfactory.h" #include "lluiimage.h" +#include "llwindow.h" static LLDefaultChildRegistry::Register r("icon"); @@ -42,6 +43,7 @@ LLIconCtrl::Params::Params() : image("image_name"), color("color"), use_draw_context_alpha("use_draw_context_alpha", true), + interactable("interactable", false), scale_image("scale_image"), min_width("min_width", 0), min_height("min_height", 0) @@ -52,6 +54,7 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) mColor(p.color()), mImagep(p.image), mUseDrawContextAlpha(p.use_draw_context_alpha), + mInteractable(p.interactable), mPriority(0), mMinWidth(p.min_width), mMinHeight(p.min_height), @@ -81,6 +84,16 @@ void LLIconCtrl::draw() LLUICtrl::draw(); } +BOOL LLIconCtrl::handleHover(S32 x, S32 y, MASK mask) +{ + if (mInteractable && getEnabled()) + { + getWindow()->setCursor(UI_CURSOR_HAND); + return TRUE; + } + return LLUICtrl::handleHover(x, y, mask); +} + // virtual // value might be a string or a UUID void LLIconCtrl::setValue(const LLSD& value) diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index dd83e78fd3..9c3b517bca 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -48,7 +48,8 @@ public: { Optional image; Optional color; - Optional use_draw_context_alpha; + Optional use_draw_context_alpha, + interactable; Optional min_width, min_height; Ignored scale_image; @@ -67,6 +68,9 @@ public: // llview overrides virtual void draw(); + // llview overrides + virtual BOOL handleHover(S32 x, S32 y, MASK mask); + // lluictrl overrides virtual void setValue(const LLSD& value ); @@ -88,6 +92,7 @@ protected: // If set to true (default), use the draw context transparency. // If false, will use transparency returned by getCurrentTransparency(). See STORM-698. bool mUseDrawContextAlpha; + bool mInteractable; private: LLUIColor mColor; diff --git a/indra/newview/llfloaterprofiletexture.cpp b/indra/newview/llfloaterprofiletexture.cpp index 4ddd7dfc6b..743685e7d1 100644 --- a/indra/newview/llfloaterprofiletexture.cpp +++ b/indra/newview/llfloaterprofiletexture.cpp @@ -38,10 +38,6 @@ #include "llviewertexturelist.h" -const S32 CLIENT_RECT_VPAD = 4; -const F32 PREVIEW_TEXTURE_MAX_ASPECT = 20.f; -const F32 PREVIEW_TEXTURE_MIN_ASPECT = 0.5f; - LLFloaterProfileTexture::LLFloaterProfileTexture(LLView* owner) : LLFloater(LLSD()) @@ -67,9 +63,10 @@ LLFloaterProfileTexture::~LLFloaterProfileTexture() // virtual BOOL LLFloaterProfileTexture::postBuild() { - pProfileIcon = getChild("profile_pic"); + mProfileIcon = getChild("profile_pic"); - getChild("close_btn")->setCommitCallback([this](LLUICtrl*, void*) { closeFloater(); }, nullptr); + mCloseButton = getChild("close_btn"); + mCloseButton->setCommitCallback([this](LLUICtrl*, void*) { closeFloater(); }, nullptr); return TRUE; } @@ -114,7 +111,7 @@ void LLFloaterProfileTexture::updateDimensions() mUpdateDimensions = FALSE; LLRect old_floater_rect = getRect(); - LLRect old_image_rect = pProfileIcon->getRect(); + LLRect old_image_rect = mProfileIcon->getRect(); S32 width = old_floater_rect.getWidth() - old_image_rect.getWidth() + mLastWidth; S32 height = old_floater_rect.getHeight() - old_image_rect.getHeight() + mLastHeight; @@ -135,9 +132,14 @@ void LLFloaterProfileTexture::draw() LLFloater::draw(); } +void LLFloaterProfileTexture::onOpen(const LLSD& key) +{ + mCloseButton->setFocus(true); +} + void LLFloaterProfileTexture::resetAsset() { - pProfileIcon->setValue("Generic_Person_Large"); + mProfileIcon->setValue("Generic_Person_Large"); mImageID = LLUUID::null; if (mImage.notNull()) { @@ -160,7 +162,7 @@ void LLFloaterProfileTexture::loadAsset(const LLUUID &image_id) return; } - pProfileIcon->setValue(image_id); + mProfileIcon->setValue(image_id); mImageID = image_id; mImage = LLViewerTextureManager::getFetchedTexture(mImageID, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); mImageOldBoostLevel = mImage->getBoostLevel(); diff --git a/indra/newview/llfloaterprofiletexture.h b/indra/newview/llfloaterprofiletexture.h index 84ff4ecb16..66a61213dd 100644 --- a/indra/newview/llfloaterprofiletexture.h +++ b/indra/newview/llfloaterprofiletexture.h @@ -30,6 +30,7 @@ #include "llfloater.h" #include "llviewertexture.h" +class LLButton; class LLImageRaw; class LLIconCtrl; @@ -39,7 +40,8 @@ public: LLFloaterProfileTexture(LLView* owner); ~LLFloaterProfileTexture(); - virtual void draw(); + void draw() override; + void onOpen(const LLSD& key) override; void resetAsset(); void loadAsset(const LLUUID &image_id); @@ -54,12 +56,12 @@ public: BOOL final, void* userdata); - virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; protected: - /* virtual */ BOOL postBuild(); + BOOL postBuild() override; private: - void updateDimensions(); + void updateDimensions(); LLUUID mImageID; LLPointer mImage; @@ -71,7 +73,8 @@ private: BOOL mUpdateDimensions; LLHandle mOwnerHandle; - LLIconCtrl* pProfileIcon; + LLIconCtrl* mProfileIcon; + LLButton* mCloseButton; LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList; }; diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 38c0b64e0a..32af2592d3 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -45,7 +45,6 @@ #include "llvoiceclient.h" static LLDefaultChildRegistry::Register r("group_list"); -S32 LLGroupListItem::sIconWidth = 0; class LLGroupComparator : public LLFlatListView::ItemComparator { @@ -305,7 +304,10 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL item->getChildView("info_btn")->setVisible( false); item->getChildView("profile_btn")->setVisible( false); item->setGroupIconVisible(mShowIcons); - item->setVisibleInProfile(visible_in_profile); + if (!mShowIcons) + { + item->setVisibleInProfile(visible_in_profile); + } addItem(item, id, pos); // setCommentVisible(false); @@ -414,13 +416,6 @@ mForAgent(for_agent) { buildFromFile( "panel_group_list_item_short.xml"); } - - // Remember group icon width including its padding from the name text box, - // so that we can hide and show the icon again later. - if (!sIconWidth && mGroupNameBox) - { - sIconWidth = mGroupNameBox->getRect().mLeft - mGroupIcon->getRect().mLeft; - } } LLGroupListItem::~LLGroupListItem() @@ -451,6 +446,12 @@ BOOL LLGroupListItem::postBuild() mVisibilityShowBtn->setClickedCallback([this](LLUICtrl *, const LLSD &) { onVisibilityBtnClick(true); }); } + // Remember group icon width including its padding from the name text box, + // so that we can hide and show the icon again later. + // Also note that panel_group_list_item and panel_group_list_item_short + // have icons of different sizes so we need to figure it per file. + mIconWidth = mGroupNameBox->getRect().mLeft - mGroupIcon->getRect().mLeft; + return TRUE; } @@ -541,7 +542,7 @@ void LLGroupListItem::setGroupIconVisible(bool visible) // Move the group name horizontally by icon size + its distance from the group name. LLRect name_rect = mGroupNameBox->getRect(); - name_rect.mLeft += visible ? sIconWidth : -sIconWidth; + name_rect.mLeft += visible ? mIconWidth : -mIconWidth; mGroupNameBox->setRect(name_rect); } diff --git a/indra/newview/llgrouplist.h b/indra/newview/llgrouplist.h index bab9127e10..5cbabb712f 100644 --- a/indra/newview/llgrouplist.h +++ b/indra/newview/llgrouplist.h @@ -137,6 +137,6 @@ private: bool mForAgent; LLStyle::Params mGroupNameStyle; - static S32 sIconWidth; // icon width + padding + S32 mIconWidth; }; #endif // LL_LLGROUPLIST_H diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 441a69bc5d..69e36a2df7 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -669,6 +669,8 @@ void LLFloaterProfilePermissions::onOpen(const LLSD& key) fillRightsData(); } + mCancelBtn->setFocus(true); + mAvatarNameCacheConnection = LLAvatarNameCache::get(mAvatarID, boost::bind(&LLFloaterProfilePermissions::onAvatarNameCache, this, _1, _2)); } @@ -986,6 +988,13 @@ void LLPanelProfileSecondLife::resetData() mCanEditObjectsIcon->setVisible(false); mCantEditObjectsIcon->setVisible(!own_profile); + mCanSeeOnlineIcon->setEnabled(false); + mCantSeeOnlineIcon->setEnabled(false); + mCanSeeOnMapIcon->setEnabled(false); + mCantSeeOnMapIcon->setEnabled(false); + mCanEditObjectsIcon->setEnabled(false); + mCantEditObjectsIcon->setEnabled(false); + childSetVisible("partner_layout", FALSE); childSetVisible("partner_spacer_layout", TRUE); } @@ -1222,15 +1231,22 @@ void LLPanelProfileSecondLife::fillRightsData() mCantSeeOnMapIcon->setVisible(!can_see_on_map); mCanEditObjectsIcon->setVisible(can_edit_objects); mCantEditObjectsIcon->setVisible(!can_edit_objects); + + mCanSeeOnlineIcon->setEnabled(true); + mCantSeeOnlineIcon->setEnabled(true); + mCanSeeOnMapIcon->setEnabled(true); + mCantSeeOnMapIcon->setEnabled(true); + mCanEditObjectsIcon->setEnabled(true); + mCantEditObjectsIcon->setEnabled(true); } else { mCanSeeOnlineIcon->setVisible(false); - mCantSeeOnlineIcon->setVisible(true); + mCantSeeOnlineIcon->setVisible(false); mCanSeeOnMapIcon->setVisible(false); - mCantSeeOnMapIcon->setVisible(true); + mCantSeeOnMapIcon->setVisible(false); mCanEditObjectsIcon->setVisible(false); - mCantEditObjectsIcon->setVisible(true); + mCantEditObjectsIcon->setVisible(false); } } diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index 4de5f274d8..943048843f 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -90,7 +90,7 @@ public: BOOL postBuild() override; - void resetData(); + void resetData() override; /** * Sends update data request to server. @@ -228,18 +228,18 @@ public: LLPanelProfileWeb(); /*virtual*/ ~LLPanelProfileWeb(); - /*virtual*/ void onOpen(const LLSD& key); + void onOpen(const LLSD& key) override; - /*virtual*/ BOOL postBuild(); + BOOL postBuild() override; - void resetData(); + void resetData() override; /** * Loads web profile. */ - /*virtual*/ void updateData(); + void updateData() override; - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name); @@ -275,7 +275,7 @@ public: void processProperties(const LLAvatarData* avatar_data); - void resetData(); + void resetData() override; void setProfileImageUploading(bool loading); void setProfileImageUploaded(const LLUUID &image_asset_id); @@ -324,7 +324,7 @@ public: void processProperties(LLAvatarNotes* avatar_notes); - void resetData(); + void resetData() override; void updateData() override; diff --git a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml index 0a74d934ac..53bd9666c1 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_secondlife.xml @@ -49,6 +49,7 @@ Account: [ACCTTYPE] image_name="Generic_Person_Large" layout="topleft" follows="all" + interactable="true" top="0" left="2" bottom="-1" @@ -350,6 +351,7 @@ Account: [ACCTTYPE] image_name="Profile_Perm_Online_Enabled" layout="topleft" follows="right|top" + interactable="true" top="0" right="-61" height="24" @@ -363,6 +365,7 @@ Account: [ACCTTYPE] image_name="Profile_Perm_Online_Disabled" layout="topleft" follows="right|top" + interactable="true" top="0" right="-61" height="24" @@ -376,6 +379,7 @@ Account: [ACCTTYPE] image_name="Profile_Perm_Find_Enabled" layout="topleft" follows="right|top" + interactable="true" top="0" right="-30" height="24" @@ -389,6 +393,7 @@ Account: [ACCTTYPE] image_name="Profile_Perm_Find_Disabled" layout="topleft" follows="right|top" + interactable="true" top="0" right="-30" height="24" @@ -402,6 +407,7 @@ Account: [ACCTTYPE] image_name="Profile_Perm_Objects_Enabled" layout="topleft" follows="right|top" + interactable="true" top="0" right="-1" height="24" @@ -415,6 +421,7 @@ Account: [ACCTTYPE] image_name="Profile_Perm_Objects_Disabled" layout="topleft" follows="right|top" + interactable="true" top="0" right="-1" height="24" -- cgit v1.3