bump product version to 5.0.4.1
[LibreOffice.git] / sfx2 / source / control / templatedefaultview.cxx
blob39ee41552f68dc9591fcada11b4db50d91b7d5ef
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <sfx2/templatedefaultview.hxx>
11 #include <sfx2/thumbnailview.hxx>
12 #include <vcl/builderfactory.hxx>
13 #include <sfx2/app.hxx>
15 #include <officecfg/Office/Common.hxx>
17 VCL_BUILDER_FACTORY(TemplateDefaultView)
19 TemplateDefaultView::TemplateDefaultView( Window* pParent)
20 : TemplateLocalView(pParent)
21 , mnTextHeight(30)
22 , mnItemPadding(5)
23 , mnLastMouseDownItem( THUMBNAILVIEW_ITEM_NOTFOUND )
25 Rectangle aScreen = Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
26 mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192;
27 ThumbnailView::setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding );
29 // startcenter specific settings
30 maFillColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsBackgroundColor::get());
31 maTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsTextColor::get());
32 maHighlightColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightColor::get());
33 maHighlightTextColor = Color(officecfg::Office::Common::Help::StartCenter::StartCenterThumbnailsHighlightTextColor::get());
34 mfHighlightTransparence = 0.25;
37 maAllButton->SetControlForeground(maTextColor);
38 maFTName->SetControlForeground(maTextColor);
40 // TODO - convert the TemplateAbstractView to .ui (instead of fixed layout
41 // of the button and the fixed text), and do the following:
42 // const float fMultiplier = 1.4;
43 // vcl::Font aFont(maAllButton->GetSettings().GetStyleSettings().GetPushButtonFont());
44 // aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
45 // maAllButton->SetControlFont(aFont);
46 // maFTName->SetControlFont(aFont);
49 void TemplateDefaultView::reload()
51 TemplateLocalView::reload();
52 // Set preferred width
53 set_width_request(mnTextHeight + mnItemMaxSize + 2*mnItemPadding);
56 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */