Kaydet (Commit) 2e6ed7e0 authored tarafından Akshay Deep's avatar Akshay Deep Kaydeden (comit) Katarina Behrens

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/23816Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst b8cd2221
......@@ -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;
......
......@@ -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)
{
......
......@@ -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());
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment