diff options
author | Akshay Deep <akshaydeepiitr@gmail.com> | 2016-04-05 00:36:09 +0530 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-04-12 08:51:28 +0000 |
commit | 8e65e1f91f23ff8ea34617c7fdacd933de0fad18 (patch) | |
tree | 58684617bab69541f16f82d2f592679b8c7a0617 /sfx2 | |
parent | 5b3b213ba00481375dcbeb0708066f625667e2ce (diff) |
tdf#89095 Start Center: bigger thumbnails for templates
TemplateDefaultView 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>
(cherry picked from commit 2e6ed7e0a0f7395d548cbbff71cb72ba32d10309)
Reviewed-on: https://gerrit.libreoffice.org/23997
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/control/templatedefaultview.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/control/templatelocalview.cxx | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index 38c0609624b1..2cc310230d4e 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -129,6 +129,8 @@ bool ViewFilter_Keyword::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))) { @@ -141,6 +143,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))) { @@ -214,6 +218,11 @@ void TemplateAbstractView::insertItems(const std::vector<TemplateItemProperties> +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); } |