summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/recentdocsview.cxx35
-rw-r--r--sfx2/source/dialog/backingcomp.cxx12
-rw-r--r--sfx2/source/dialog/backingwindow.cxx1
3 files changed, 40 insertions, 8 deletions
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 69b605954e2f..9ed9a96dda0c 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -54,14 +54,6 @@ RecentDocsView::RecentDocsView( Window* pParent )
SetStyle(GetStyle() | WB_VSCROLL);
setItemMaxTextLength( mnItemMaxTextLength );
setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding );
-
- // Set prefered width so text lines will not be cut off
- Font aOldFont(GetFont());
- Font aNewFont(aOldFont);
- aNewFont.SetHeight(20);
- SetFont(aNewFont);
- set_width_request(std::max(GetTextWidth(maWelcomeLine1),GetTextWidth(maWelcomeLine2)));
- SetFont(aOldFont);
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeRecentDocsView(Window *pParent, VclBuilder::stringmap &)
@@ -185,6 +177,21 @@ void RecentDocsView::loadRecentDocs()
CalculateItemPositions();
Invalidate();
+
+ // Set prefered width
+ if( mFilteredItemList.empty() )
+ {
+ Font aOldFont(GetFont());
+ Font aNewFont(aOldFont);
+ aNewFont.SetHeight(20);
+ SetFont(aNewFont);
+ set_width_request(std::max(GetTextWidth(maWelcomeLine1),GetTextWidth(maWelcomeLine2)));
+ SetFont(aOldFont);
+ }
+ else
+ {
+ set_width_request(mnItemMaxSize);
+ }
}
void RecentDocsView::MouseButtonDown( const MouseEvent& rMEvt )
@@ -304,6 +311,18 @@ long RecentDocsView::GetThumbnailSize() const
return mnItemMaxSize;
}
+void RecentDocsView::Clear()
+{
+ Font aOldFont(GetFont());
+ Font aNewFont(aOldFont);
+ aNewFont.SetHeight(20);
+ SetFont(aNewFont);
+ set_width_request(std::max(GetTextWidth(maWelcomeLine1),GetTextWidth(maWelcomeLine2)));
+ SetFont(aOldFont);
+
+ ThumbnailView::Clear();
+}
+
IMPL_STATIC_LINK_NOINSTANCE( RecentDocsView, ExecuteHdl_Impl, LoadRecentFile*, pLoadRecentFile )
{
try
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index d79c545266bf..7d511517bd18 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -808,7 +808,19 @@ void SAL_CALL BackingComp::dispatch( const css::util::URL& aURL, const css::uno:
Window* pWindow = VCLUnoHelper::GetWindow(m_xWindow);
BackingWindow* pBack = dynamic_cast<BackingWindow*>(pWindow );
if( pBack )
+ {
pBack->clearRecentFileList();
+
+ // Recalculate minimum width
+ css::uno::Reference< css::awt::XWindow > xParentWindow = m_xFrame->getContainerWindow();
+ WorkWindow* pParent = (WorkWindow*)VCLUnoHelper::GetWindow(xParentWindow);
+ if( pParent )
+ {
+ pParent->SetMinOutputSizePixel( Size(
+ pBack->get_width_request(),
+ pParent->GetMinOutputSizePixel().Height()) );
+ }
+ }
}
}
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index bf128f0cd6fd..daa3d10964fa 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -557,5 +557,6 @@ Size BackingWindow::GetOptimalSize() const
void BackingWindow::clearRecentFileList()
{
mpAllRecentThumbnails->Clear();
+ set_width_request(mpAllRecentThumbnails->get_width_request() + mpAllButtonsBox->GetOptimalSize().Width());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab:*/