From 5cc02625fb15203cec8584aa19dd8d2240ab8eca Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Fri, 19 Feb 2010 12:17:35 +0200 Subject: Fixed low bug EXT-5523 - Bottom part of "Create classfield dialog"is overlapped by unnecessary scroller Copied reshape logic from Picks panel to reshape Classified panel. --HG-- branch : product-engine --- indra/newview/llpanelclassified.cpp | 27 ++++++++++++++++++++++ indra/newview/llpanelclassified.h | 9 ++++++++ .../skins/default/xui/en/panel_edit_classified.xml | 16 ++++++------- 3 files changed, 44 insertions(+), 8 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 8ca044f72b..2a794a06b5 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -72,6 +72,7 @@ #include "llviewerwindow.h" // for window width, height #include "llappviewer.h" // abortQuit() #include "lltrans.h" +#include "llscrollcontainer.h" #include "llstatusbar.h" const S32 MINIMUM_PRICE_FOR_LISTING = 50; // L$ @@ -1173,6 +1174,12 @@ BOOL LLPanelClassifiedInfo::postBuild() childSetAction("show_on_map_btn", boost::bind(&LLPanelClassifiedInfo::onMapClick, this)); childSetAction("teleport_btn", boost::bind(&LLPanelClassifiedInfo::onTeleportClick, this)); + mScrollingPanel = getChild("scroll_content_panel"); + mScrollContainer = getChild("profile_scroll"); + + mScrollingPanelMinHeight = mScrollContainer->getScrolledViewRect().getHeight(); + mScrollingPanelWidth = mScrollingPanel->getRect().getWidth(); + return TRUE; } @@ -1186,6 +1193,26 @@ void LLPanelClassifiedInfo::setEditClassifiedCallback(const commit_callback_t& c getChild("edit_btn")->setClickedCallback(cb); } +void LLPanelClassifiedInfo::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */) +{ + LLPanel::reshape(width, height, called_from_parent); + + if (!mScrollContainer || !mScrollingPanel) + return; + + static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); + + S32 scroll_height = mScrollContainer->getRect().getHeight(); + if (mScrollingPanelMinHeight >= scroll_height) + { + mScrollingPanel->reshape(mScrollingPanelWidth, mScrollingPanelMinHeight); + } + else + { + mScrollingPanel->reshape(mScrollingPanelWidth + scrollbar_size, scroll_height); + } +} + void LLPanelClassifiedInfo::onOpen(const LLSD& key) { LLUUID avatar_id = key["avatar_id"]; diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index e46806f576..9e33e55b88 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -55,6 +55,7 @@ class LLTextEditor; class LLTextureCtrl; class LLUICtrl; class LLMessageSystem; +class LLScrollContainer; // *TODO deprecated, should be removed. // New class implemented in ticket EXT-2095 @@ -253,6 +254,8 @@ public: void setEditClassifiedCallback(const commit_callback_t& cb); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + protected: LLPanelClassifiedInfo(); @@ -277,6 +280,12 @@ private: LLVector3d mPosGlobal; LLUUID mParcelId; bool mInfoLoaded; + + LLScrollContainer* mScrollContainer; + LLPanel* mScrollingPanel; + + S32 mScrollingPanelMinHeight; + S32 mScrollingPanelWidth; }; class LLPanelClassifiedEdit : public LLPanelClassifiedInfo diff --git a/indra/newview/skins/default/xui/en/panel_edit_classified.xml b/indra/newview/skins/default/xui/en/panel_edit_classified.xml index cc09835049..d31e7d2ed8 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_classified.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_classified.xml @@ -61,11 +61,11 @@ background_visible="false" height="600" left="0" - width="295"> + width="285"> + width="280"> Title: + width="273" /> + width="280"> Description: + width="280"> Location: loading... -- cgit v1.2.3