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 | |
parent | f74071b19fcac12b92a5f3611a068be30ae3fbd2 (diff) |
SL-10806 [Legacy Profiles] Classified tab, classifieds contain two scrollbars
-rw-r--r-- | indra/newview/llpanelprofileclassifieds.cpp | 30 | ||||
-rw-r--r-- | indra/newview/llpanelprofileclassifieds.h | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_profile_classified.xml | 599 |
3 files changed, 333 insertions, 302 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() diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h index 3766858f42..9bf9ff4a6b 100644 --- a/indra/newview/llpanelprofileclassifieds.h +++ b/indra/newview/llpanelprofileclassifieds.h @@ -210,6 +210,7 @@ protected: void resetControls(); /*virtual*/ void updateButtons(); + void updateInfoRect(); static std::string createLocationText( const std::string& original_name, @@ -303,7 +304,7 @@ private: LLTextureCtrl* mSnapshotCtrl; LLUICtrl* mEditIcon; LLUICtrl* mClassifiedNameText; - LLUICtrl* mClassifiedDescText; + LLTextEditor* mClassifiedDescText; LLLineEditor* mClassifiedNameEdit; LLTextEditor* mClassifiedDescEdit; LLUICtrl* mLocationText; @@ -334,7 +335,8 @@ private: LLPanel* mCancelBtnCnt; LLScrollContainer* mScrollContainer; - LLPanel* mInfoPanel; + LLView* mInfoPanel; + LLPanel* mInfoScroll; LLPanel* mEditPanel; diff --git a/indra/newview/skins/default/xui/en/panel_profile_classified.xml b/indra/newview/skins/default/xui/en/panel_profile_classified.xml index bbbb4e0f4a..6a0489ae97 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_classified.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_classified.xml @@ -8,7 +8,7 @@ follows="all" layout="topleft" help_topic="panel_profile_classified" - min_height="350" + min_height="250" > <panel.string name="type_mature" @@ -76,12 +76,12 @@ name="info_scroll_content_panel" top="0" left="0" - height="570" + height="562" width="290" follows="left|top" layout="topleft" background_visible="false" - min_height="300" + min_height="200" > <texture_picker name="classified_snapshot" @@ -103,327 +103,330 @@ height="197" width="272" layout="topleft" + follows="left|top|right" image_name="spacer24.tga" visible="false" /> - <panel + <layout_stack name="info_panel" top="180" left="0" - height="520" + height="375" width="320" follows="all" layout="topleft" visible="true" - > - <text_editor - name="classified_name" + animate="false" + orientation="vertical" + > + <layout_panel + name="main_info_panel" top="0" - left="10" - height="35" - width="280" - follows="left|top|right" - layout="topleft" - allow_scroll="false" - bg_visible="false" - font="SansSerifBig" - font.style="BOLD" - h_pad="0" - read_only="true" - text_color="white" - use_ellipses="true" - v_pad="0" - > - [name] - </text_editor> - <text - name="classified_location_label" - value="Location:" - top_pad="-2" - left="10" - height="10" - width="250" - follows="left|top" - layout="topleft" - font.style="BOLD" - text_color="white" - /> - <text_editor - name="classified_location" - value="[loading...]" - top_pad="5" - left="10" - height="30" + left="0" + height="160" width="290" - follows="left|top" - layout="topleft" - allow_scroll="false" - bg_visible="false" - h_pad="0" - read_only="true" - v_pad="0" - word_wrap="true" - /> - <text - name="content_type_label" - value="Content Type:" - top_pad="10" - left="10" - height="10" - width="140" - follows="left|top" - layout="topleft" - font.style="BOLD" - text_color="white" - /> - <icon - name="content_type_moderate" - top_pad="-11" - left_pad="0" - height="16" - width="18" - follows="top|left" - layout="topleft" - image_name="Parcel_M_Light" - /> - <icon - name="content_type_general" - top_delta="0" - left_delta="0" - height="16" - width="18" - follows="top|left" - layout="topleft" - image_name="Parcel_PG_Light" - /> - <text_editor - name="content_type" - value="[content type]" - top_delta="1" - left_pad="2" - height="18" - width="130" - follows="left|top|right" - layout="topleft" - allow_scroll="false" - bg_visible="false" - h_pad="0" - read_only="true" - v_pad="0" - /> - <text - name="category_label" - value="Category:" - top_pad="0" - left="10" - height="10" - width="140" - follows="left|top" - layout="topleft" - font.style="BOLD" - text_color="white" - /> - <text_editor - name="category" - value="[category]" - top_pad="-10" - left_pad="0" - height="18" - width="150" - follows="left|top|right" - layout="topleft" - allow_scroll="false" - bg_visible="false" - h_pad="0" - parse_urls="true" - read_only="true" - v_pad="0" - /> - <text - name="creation_date_label" - value="Creation date:" - top_pad="0" - left="10" - height="10" - width="140" - follows="left|top" + follows="all" layout="topleft" - font.style="BOLD" - text_color="white" - /> - <text_editor - name="creation_date" - value="[date]" - tool_tip="Creation date" - top_pad="-10" - left_pad="0" + auto_resize="false" + > + <text_editor + name="classified_name" + top="0" + left="10" + height="35" + width="280" + follows="left|top|right" + layout="topleft" + allow_scroll="false" + bg_visible="false" + font="SansSerifBig" + font.style="BOLD" + h_pad="0" + read_only="true" + text_color="white" + use_ellipses="true" + v_pad="0" + > + [name] + </text_editor> + <text + name="classified_location_label" + value="Location:" + top_pad="-2" + left="10" + height="10" + width="250" + follows="left|top" + layout="topleft" + font.style="BOLD" + text_color="white" + /> + <text_editor + name="classified_location" + value="[loading...]" + top_pad="5" + left="10" + height="30" + width="290" + follows="left|top" + layout="topleft" + allow_scroll="false" + bg_visible="false" + h_pad="0" + read_only="true" + v_pad="0" + word_wrap="true" + /> + <text + name="content_type_label" + value="Content Type:" + top_pad="10" + left="10" + height="10" + width="140" + follows="left|top" + layout="topleft" + font.style="BOLD" + text_color="white" + /> + <icon + name="content_type_moderate" + top_pad="-11" + left_pad="0" + height="16" + width="18" + follows="top|left" + layout="topleft" + image_name="Parcel_M_Light" + /> + <icon + name="content_type_general" + top_delta="0" + left_delta="0" + height="16" + width="18" + follows="top|left" + layout="topleft" + image_name="Parcel_PG_Light" + /> + <text_editor + name="content_type" + value="[content type]" + top_delta="1" + left_pad="2" + height="18" + width="130" + follows="left|top|right" + layout="topleft" + allow_scroll="false" + bg_visible="false" + h_pad="0" + read_only="true" + v_pad="0" + /> + <text + name="category_label" + value="Category:" + top_pad="0" + left="10" + height="10" + width="140" + follows="left|top" + layout="topleft" + font.style="BOLD" + text_color="white" + /> + <text_editor + name="category" + value="[category]" + top_pad="-10" + left_pad="0" + height="18" + width="150" + follows="left|top|right" + layout="topleft" + allow_scroll="false" + bg_visible="false" + h_pad="0" + parse_urls="true" + read_only="true" + v_pad="0" + /> + <text + name="creation_date_label" + value="Creation date:" + top_pad="0" + left="10" + height="10" + width="140" + follows="left|top" + layout="topleft" + font.style="BOLD" + text_color="white" + /> + <text_editor + name="creation_date" + value="[date]" + tool_tip="Creation date" + top_pad="-10" + left_pad="0" + height="16" + width="150" + follows="left|top" + layout="topleft" + allow_scroll="false" + bg_visible="false" + h_pad="0" + halign="left" + read_only="true" + v_pad="0" + /> + <text + name="price_for_listing_label" + value="Price for listing:" + top_pad="5" + left="10" + height="10" + width="140" + follows="left|top" + layout="topleft" + font.style="BOLD" + text_color="white" + /> + <text_editor + name="price_for_listing" + tool_tip="Price for listing." + top_pad="-10" + left_pad="0" + height="16" + width="105" + follows="left|top" + layout="topleft" + allow_scroll="false" + bg_visible="false" + h_pad="0" + halign="left" + read_only="true" + v_pad="0" + > + [PRICE] + </text_editor> + </layout_panel> + <layout_panel + name="clickthrough_layout_panel" + top="0" + left="0" height="16" - width="150" - follows="left|top" - layout="topleft" - allow_scroll="false" - bg_visible="false" - h_pad="0" - halign="left" - read_only="true" - v_pad="0" - /> - <text - name="price_for_listing_label" - value="Price for listing:" - top_pad="5" - left="10" - height="10" - width="140" - follows="left|top" + width="290" + follows="all" layout="topleft" - font.style="BOLD" - text_color="white" - /> - <text_editor - name="price_for_listing" - tool_tip="Price for listing." - top_pad="-10" - left_pad="0" + auto_resize="false" + > + <text + name="click_through_label" + value="Clicks:" + top_pad="0" + left="10" + height="10" + width="140" + follows="left|top" + layout="topleft" + font.style="BOLD" + text_color="white" + /> + <text_editor + name="click_through_text" + value="[clicks]" + tool_tip="Click through data" + top_pad="-10" + left_pad="0" + height="16" + width="150" + follows="left|top" + layout="topleft" + allow_scroll="false" + bg_visible="false" + h_pad="0" + halign="left" + read_only="true" + v_pad="0" + /> + </layout_panel> + <layout_panel + name="auto_renew_layout_panel" + top="0" + left="0" height="16" - width="105" - follows="left|top" - layout="topleft" - allow_scroll="false" - bg_visible="false" - h_pad="0" - halign="left" - read_only="true" - v_pad="0" - > - [PRICE] - </text_editor> - <layout_stack - name="descr_stack" - top_pad="5" - left="10" - height="215" width="290" follows="all" layout="topleft" - animate="false" - orientation="vertical" - > - <layout_panel - name="clickthrough_layout_panel" + auto_resize="false" + > + <text + name="auto_renew_label" + value="Auto renew:" top="0" - left="0" - height="16" - width="290" - follows="all" + left="10" + height="10" + width="140" + follows="left|top" layout="topleft" - auto_resize="false" - > - <text - name="click_through_label" - value="Clicks:" - top_pad="0" - left="0" - height="10" - width="140" - follows="left|top" - layout="topleft" - font.style="BOLD" - text_color="white" - /> - <text_editor - name="click_through_text" - value="[clicks]" - tool_tip="Click through data" - top_pad="-10" - left_pad="0" - height="16" - width="150" - follows="left|top" - layout="topleft" - allow_scroll="false" - bg_visible="false" - h_pad="0" - halign="left" - read_only="true" - v_pad="0" - /> - </layout_panel> - <layout_panel - name="auto_renew_layout_panel" - top="0" - left="0" + font.style="BOLD" + text_color="white" + /> + <text + name="auto_renew" + value="Enabled" + top_pad="-10" + left_pad="0" height="16" - width="290" - follows="all" + width="150" + follows="top|left" layout="topleft" - auto_resize="false" - > - <text - name="auto_renew_label" - value="Auto renew:" - top="0" - left="0" - height="10" - width="140" - follows="left|top" - layout="topleft" - font.style="BOLD" - text_color="white" - /> - <text - name="auto_renew" - value="Enabled" - top_pad="-10" - left_pad="0" - height="16" - width="150" - follows="top|left" - layout="topleft" - /> - </layout_panel> - <layout_panel - name="descr_layout_panel" + /> + </layout_panel> + <layout_panel + name="descr_layout_panel" + top="0" + left="0" + height="220" + width="290" + follows="all" + layout="topleft" + auto_resize="true" + > + <text + name="classified_desc_label" + value="Description:" top="0" - left="0" - height="220" - width="290" + left="10" + height="10" + width="250" + follows="left|top" + layout="topleft" + font.style="BOLD" + text_color="white" + /> + <text_editor + name="classified_desc" + value="[description]" + top_pad="7" + left="10" + height="200" + width="280" follows="all" layout="topleft" - > - <text - name="classified_desc_label" - value="Description:" - top="0" - left="0" - height="10" - width="250" - follows="left|top" - layout="topleft" - font.style="BOLD" - text_color="white" - /> - <text_editor - name="classified_desc" - value="[description]" - top_pad="7" - left="0" - height="200" - width="280" - follows="all" - layout="topleft" - allow_scroll="true" - bg_visible="false" - h_pad="0" - max_length="1023" - parse_urls="true" - read_only="true" - v_pad="0" - word_wrap="true" - /> - </layout_panel> - </layout_stack> - </panel> + allow_scroll="false" + bg_visible="false" + h_pad="0" + max_length="1023" + parse_urls="true" + read_only="true" + v_pad="0" + word_wrap="true" + /> + </layout_panel> + </layout_stack> <panel name="edit_panel" top="180" |