summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-04-05 00:36:09 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-04-11 09:24:54 +0000
commit2e6ed7e0a0f7395d548cbbff71cb72ba32d10309 (patch)
tree6b5331cae25cc9854930ac80e9a417890deccec2 /sfx2
parentb8cd2221bc0376c63b5d9d09fd1fa232b765e229 (diff)
tdf#89095 Start Center: bigger thumbnails for templates
ThumbnailDefaultView is now able to dynamically update the size of the thumbnail in its item. Removed padding for thumbnails. Change-Id: Ibc267c848a844098a59525c76e234f4f9c4d0ed1 Reviewed-on: https://gerrit.libreoffice.org/23816 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/templateabstractview.cxx9
-rw-r--r--sfx2/source/control/templatedefaultview.cxx1
-rw-r--r--sfx2/source/control/templatelocalview.cxx4
3 files changed, 12 insertions, 2 deletions
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index d0e6ccd61e73..25374e44a1e3 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -122,6 +122,8 @@ bool ViewFilter_Application::operator () (const ThumbnailViewItem *pItem)
TemplateAbstractView::TemplateAbstractView (vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
mnCurRegionId(0),
+ mnThumbnailWidth(TEMPLATE_THUMBNAIL_MAX_WIDTH),
+ mnThumbnailHeight(TEMPLATE_THUMBNAIL_MAX_HEIGHT),
maAllButton(VclPtr<PushButton>::Create(this, SfxResId(BTN_ALL_TEMPLATES))),
maFTName(VclPtr<FixedText>::Create(this, SfxResId(FT_NAME)))
{
@@ -134,6 +136,8 @@ TemplateAbstractView::TemplateAbstractView (vcl::Window *pParent, WinBits nWinSt
TemplateAbstractView::TemplateAbstractView(vcl::Window *pParent)
: ThumbnailView(pParent),
mnCurRegionId(0),
+ mnThumbnailWidth(TEMPLATE_THUMBNAIL_MAX_WIDTH),
+ mnThumbnailHeight(TEMPLATE_THUMBNAIL_MAX_HEIGHT),
maAllButton(VclPtr<PushButton>::Create(this, SfxResId(BTN_ALL_TEMPLATES))),
maFTName(VclPtr<FixedText>::Create(this, SfxResId(FT_NAME)))
{
@@ -205,6 +209,11 @@ void TemplateAbstractView::insertItems(const std::vector<TemplateItemProperties>
updateItems(aItems);
}
+void TemplateAbstractView::updateThumbnailDimensions(long itemMaxSize)
+{
+ mnThumbnailWidth = itemMaxSize;
+ mnThumbnailHeight = itemMaxSize;
+}
void TemplateAbstractView::setOpenRegionHdl(const Link<void*,void> &rLink)
{
diff --git a/sfx2/source/control/templatedefaultview.cxx b/sfx2/source/control/templatedefaultview.cxx
index 5c1753605785..aad2187e7401 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -24,6 +24,7 @@ TemplateDefaultView::TemplateDefaultView( Window* pParent)
Rectangle aScreen = Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192;
ThumbnailView::setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding );
+ updateThumbnailDimensions(mnItemMaxSize);
// startcenter specific settings
maFillColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsBackgroundColor::get());
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 070bb0acde7a..7c82737e2b18 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -87,8 +87,8 @@ void TemplateLocalView::Populate ()
aProperties.aName = aName;
aProperties.aPath = aURL;
aProperties.aThumbnail = TemplateAbstractView::fetchThumbnail(aURL,
- TEMPLATE_THUMBNAIL_MAX_WIDTH,
- TEMPLATE_THUMBNAIL_MAX_HEIGHT);
+ getThumbnailWidth(),
+ getThumbnailHeight());
pItem->maTemplates.push_back(aProperties);
}