summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelclassified.cpp
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2010-02-19 12:17:35 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2010-02-19 12:17:35 +0200
commit5cc02625fb15203cec8584aa19dd8d2240ab8eca (patch)
tree71edf994f3de2ee78549f25752740a1ae1098e46 /indra/newview/llpanelclassified.cpp
parent22676e6d38fe938f394a9764b226793b5862768c (diff)
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
Diffstat (limited to 'indra/newview/llpanelclassified.cpp')
-rw-r--r--indra/newview/llpanelclassified.cpp27
1 files changed, 27 insertions, 0 deletions
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<LLPanel>("scroll_content_panel");
+ mScrollContainer = getChild<LLScrollContainer>("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<LLButton>("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<S32> 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"];