[Libreoffice-commits] core.git: include/sfx2 sfx2/source
Akshay Deep
akshaydeepiitr at gmail.com
Mon Apr 11 09:25:19 UTC 2016
include/sfx2/templateabstractview.hxx | 8 ++++++++
sfx2/source/control/templateabstractview.cxx | 9 +++++++++
sfx2/source/control/templatedefaultview.cxx | 1 +
sfx2/source/control/templatelocalview.cxx | 4 ++--
4 files changed, 20 insertions(+), 2 deletions(-)
New commits:
commit 2e6ed7e0a0f7395d548cbbff71cb72ba32d10309
Author: Akshay Deep <akshaydeepiitr at gmail.com>
Date: Tue Apr 5 00:36:09 2016 +0530
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 at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx
index 2ff5a26..81d0a96 100644
--- a/include/sfx2/templateabstractview.hxx
+++ b/include/sfx2/templateabstractview.hxx
@@ -104,6 +104,11 @@ public:
void setOpenTemplateHdl(const Link<ThumbnailViewItem*,void> &rLink);
+ void updateThumbnailDimensions(long itemMaxSize);
+
+ long getThumbnailWidth() const { return mnThumbnailWidth;}
+ long getThumbnailHeight() const {return mnThumbnailHeight;}
+
static BitmapEx scaleImg (const BitmapEx &rImg, long width, long height);
static BitmapEx getDefaultThumbnail( const OUString& rPath );
@@ -123,6 +128,9 @@ protected:
sal_uInt16 mnCurRegionId;
OUString maCurRegionName;
+ long mnThumbnailWidth;
+ long mnThumbnailHeight;
+
VclPtr<PushButton> maAllButton;
VclPtr<FixedText> maFTName;
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index d0e6ccd..25374e4 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 5c17536..aad2187 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 070bb0a..7c82737 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);
}
More information about the Libreoffice-commits
mailing list