2014-09-16 02:30:59 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sfx2/templatedefaultview.hxx>
|
|
|
|
#include <sfx2/thumbnailview.hxx>
|
2015-05-11 09:35:06 +01:00
|
|
|
#include <vcl/builderfactory.hxx>
|
2014-09-16 02:30:59 +03:00
|
|
|
#include <sfx2/app.hxx>
|
|
|
|
|
2015-06-30 17:53:49 +02:00
|
|
|
#include <officecfg/Office/Common.hxx>
|
|
|
|
|
2015-05-11 09:35:06 +01:00
|
|
|
VCL_BUILDER_FACTORY(TemplateDefaultView)
|
2014-09-16 02:30:59 +03:00
|
|
|
|
|
|
|
TemplateDefaultView::TemplateDefaultView( Window* pParent)
|
|
|
|
: TemplateLocalView(pParent)
|
|
|
|
, mnTextHeight(30)
|
2016-05-01 13:05:00 +05:30
|
|
|
, mnItemPadding(5)//TODO:: Change padding to 10. It looks really crowded and occupied.
|
2014-09-16 02:30:59 +03:00
|
|
|
{
|
|
|
|
Rectangle aScreen = Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
|
|
|
|
mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192;
|
|
|
|
ThumbnailView::setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding );
|
2016-04-05 00:36:09 +05:30
|
|
|
updateThumbnailDimensions(mnItemMaxSize);
|
2015-06-30 17:53:49 +02:00
|
|
|
|
|
|
|
// startcenter specific settings
|
|
|
|
maFillColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsBackgroundColor::get());
|
|
|
|
maTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsTextColor::get());
|
|
|
|
maHighlightColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightColor::get());
|
|
|
|
maHighlightTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightTextColor::get());
|
|
|
|
mfHighlightTransparence = 0.25;
|
2014-09-16 02:30:59 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void TemplateDefaultView::reload()
|
|
|
|
{
|
|
|
|
TemplateLocalView::reload();
|
|
|
|
// Set preferred width
|
|
|
|
set_width_request(mnTextHeight + mnItemMaxSize + 2*mnItemPadding);
|
|
|
|
|
|
|
|
}
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|