summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-16 10:14:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-16 11:33:20 +0100
commit363446eb61de141deb1364805e0d7cd0e1f6d7fe (patch)
treeee1d0e11a8c3b99fe3ebf3b9ec2e85c6be1a6d6e /svx
parent6eb840cc540bb6f2efcebc0349a8e6e7ba074cd8 (diff)
Resolves: fdo#69236 route size request to layout widget, not hard-coded value
a) For the sidebar the sidebars automatically handle scrolling, but for the older panel the widgets has to do the scrolling so add scrolling parents to the .ui b) Fold the DialogListBox scrolling widget implementation into VclScrolledWindow and remove the duplication. Change-Id: Ife9ccd8c501e5dee7bf3102a92c8261d979cd834
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/rubydialog.cxx1
-rw-r--r--svx/source/sidebar/PanelLayout.cxx25
2 files changed, 22 insertions, 4 deletions
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index b6ad3f16b8e1..cb6db3cdb09f 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -213,6 +213,7 @@ SvxRubyDialog::SvxRubyDialog(SfxBindings *pBind, SfxChildWindow *pCW,
get(m_pPreviewWin, "preview");
m_pPreviewWin->setRubyDialog(this);
get(m_pScrolledWindow, "scrolledwindow");
+ m_pScrolledWindow->setUserManagedScrolling(true);
m_pScrollSB = &m_pScrolledWindow->getVertScrollBar();
get(m_pLeft1ED, "Left1ED");
get(m_pRight1ED, "Right1ED");
diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx
index 2c5a5bbe563f..9712b260867a 100644
--- a/svx/source/sidebar/PanelLayout.cxx
+++ b/svx/source/sidebar/PanelLayout.cxx
@@ -27,14 +27,31 @@ Size PanelLayout::GetOptimalSize() const
void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
{
+ bool bCanHandleSmallerWidth = false;
+ bool bCanHandleSmallerHeight = false;
+
+ bool bIsLayoutEnabled = isLayoutEnabled(this);
+ Window *pChild = GetWindow(WINDOW_FIRSTCHILD);
+
+ if (bIsLayoutEnabled && pChild->GetType() == WINDOW_SCROLLWINDOW)
+ {
+ WinBits nStyle = pChild->GetStyle();
+ if (nStyle && (WB_AUTOHSCROLL | WB_HSCROLL))
+ bCanHandleSmallerWidth = true;
+ if (nStyle && (WB_AUTOVSCROLL | WB_VSCROLL))
+ bCanHandleSmallerHeight = true;
+ }
+
Size aSize(GetOptimalSize());
- nWidth = std::max(nWidth,aSize.Width());
- nHeight = std::max(nHeight,aSize.Height());
+ if (!bCanHandleSmallerWidth)
+ nWidth = std::max(nWidth,aSize.Width());
+ if (!bCanHandleSmallerHeight)
+ nHeight = std::max(nHeight,aSize.Height());
Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
- if (isLayoutEnabled(this) && (nFlags & WINDOW_POSSIZE_SIZE))
- VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD), Point(0, 0), Size(nWidth, nHeight));
+ if (bIsLayoutEnabled && (nFlags & WINDOW_POSSIZE_SIZE))
+ VclContainer::setLayoutAllocation(*pChild, Point(0, 0), Size(nWidth, nHeight));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */