diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-03-27 19:04:49 +0200 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-03-27 19:04:49 +0200 |
commit | 71e4e26ebe96a03b63e1dae99bd13ec9c3bd2dbb (patch) | |
tree | c1e32e6ea507c56b82b06decfb8e46fb4b79fc0b /indra/newview/llpanelprofileclassifieds.cpp | |
parent | f74071b19fcac12b92a5f3611a068be30ae3fbd2 (diff) |
SL-10806 [Legacy Profiles] Classified tab, classifieds contain two scrollbars
Diffstat (limited to 'indra/newview/llpanelprofileclassifieds.cpp')
-rw-r--r-- | indra/newview/llpanelprofileclassifieds.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 67fe17ed70..3a5347018d 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -62,6 +62,7 @@ const S32 MAX_AVATAR_CLASSIFIEDS = 100; const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ +const S32 DEFAULT_EDIT_CLASSIFIED_SCROLL_HEIGHT = 530; //static LLPanelProfileClassified::panel_list_t LLPanelProfileClassified::sAllPanels; @@ -433,7 +434,8 @@ LLPanelProfileClassified* LLPanelProfileClassified::create() BOOL LLPanelProfileClassified::postBuild() { mScrollContainer = getChild<LLScrollContainer>("profile_scroll"); - mInfoPanel = getChild<LLPanel>("info_panel"); + mInfoPanel = getChild<LLView>("info_panel"); + mInfoScroll = getChild<LLPanel>("info_scroll_content_panel"); mEditPanel = getChild<LLPanel>("edit_panel"); mSnapshotCtrl = getChild<LLTextureCtrl>("classified_snapshot"); @@ -441,7 +443,7 @@ BOOL LLPanelProfileClassified::postBuild() //info mClassifiedNameText = getChild<LLUICtrl>("classified_name"); - mClassifiedDescText = getChild<LLUICtrl>("classified_desc"); + mClassifiedDescText = getChild<LLTextEditor>("classified_desc"); mLocationText = getChild<LLUICtrl>("classified_location"); mCategoryText = getChild<LLUICtrl>("category"); mContentTypeText = getChild<LLUICtrl>("content_type"); @@ -684,6 +686,7 @@ void LLPanelProfileClassified::setEditMode(BOOL edit_mode) scrollToTop(); updateButtons(); + updateInfoRect(); } void LLPanelProfileClassified::updateButtons() @@ -697,6 +700,27 @@ void LLPanelProfileClassified::updateButtons() mEditButton->setVisible(!edit_mode && getSelfProfile()); } +void LLPanelProfileClassified::updateInfoRect() +{ + if (getEditMode()) + { + // info_scroll_content_panel contains both info and edit panel + // info panel can be very large and scroll bar will carry over. + // Resize info panel to prevent scroll carry over when in edit mode. + mInfoScroll->reshape(mInfoScroll->getRect().getWidth(), DEFAULT_EDIT_CLASSIFIED_SCROLL_HEIGHT, FALSE); + } + else + { + // Adjust text height to make description scrollable. + S32 new_height = mClassifiedDescText->getTextBoundingRect().getHeight(); + LLRect visible_rect = mClassifiedDescText->getVisibleDocumentRect(); + S32 delta_height = new_height - visible_rect.getHeight() + 5; + + LLRect rect = mInfoScroll->getRect(); + mInfoScroll->reshape(rect.getWidth(), rect.getHeight() + delta_height, FALSE); + } +} + void LLPanelProfileClassified::enableEditing(bool enable) { mEditButton->setEnabled(enable); @@ -851,6 +875,8 @@ void LLPanelProfileClassified::setDescription(const std::string& desc) { mClassifiedDescText->setValue(desc); mClassifiedDescEdit->setValue(desc); + + updateInfoRect(); } std::string LLPanelProfileClassified::getDescription() |