summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-06-30 17:53:49 +0200
committerJan Holesovsky <kendy@collabora.com>2015-06-30 17:57:39 +0200
commit1cf7e272f7731978695f4bcd8fbdf85766d4f14e (patch)
treed237e0fa85087b415fb28d328d354480e3d841dd /sfx2
parent7387cdbc41924a85cc48e6b68563c91e35b3915c (diff)
tdf#90452: Templates should adhere to the recent docs colors too.
Change-Id: I5df89581796eca4e48e0a305d4319e4674f8dd87
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/recentdocsview.cxx1
-rw-r--r--sfx2/source/control/templateabstractview.cxx2
-rw-r--r--sfx2/source/control/templatecontaineritem.cxx12
-rw-r--r--sfx2/source/control/templatedefaultview.cxx21
-rw-r--r--sfx2/source/control/templateviewitem.cxx8
-rw-r--r--sfx2/source/control/thumbnailview.cxx6
-rw-r--r--sfx2/source/control/thumbnailviewitem.cxx6
7 files changed, 36 insertions, 20 deletions
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index b6afefa2bdec..a4745f087384 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -74,6 +74,7 @@ RecentDocsView::RecentDocsView( vcl::Window* pParent )
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;
}
VCL_BUILDER_FACTORY(RecentDocsView)
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index dbd237920a14..11b985dd5e15 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -312,7 +312,7 @@ void TemplateAbstractView::Paint(vcl::RenderContext& rRenderContext, const Recta
drawinglayer::primitive2d::Primitive2DSequence aSeq(1);
aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
new PolyPolygonColorPrimitive2D(B2DPolyPolygon(Polygon(aRect).getB2DPolygon()),
- BColor(1.0, 1.0, 1.0)));
+ maFillColor.getBColor()));
const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> mpProcessor(
diff --git a/sfx2/source/control/templatecontaineritem.cxx b/sfx2/source/control/templatecontaineritem.cxx
index 16e05d124651..b4f2f6322e0e 100644
--- a/sfx2/source/control/templatecontaineritem.cxx
+++ b/sfx2/source/control/templatecontaineritem.cxx
@@ -22,7 +22,6 @@
#include <sfx2/templateviewitem.hxx>
#include <vcl/button.hxx>
#include <vcl/graph.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
using namespace basegfx;
using namespace basegfx::tools;
@@ -75,10 +74,7 @@ void TemplateContainerItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
aFillColor = pAttrs->aHighlightColor;
if (mbHover)
- {
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- fTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
- }
+ fTransparence = pAttrs->fHighlightTransparence;
aSeq[nCount++] = drawinglayer::primitive2d::Primitive2DReference( new PolyPolygonSelectionPrimitive2D(
B2DPolyPolygon(Polygon(maDrawArea,5,5).getB2DPolygon()),
@@ -88,9 +84,9 @@ void TemplateContainerItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
true));
// Create rounded rectangle border
- aSeq[nCount++] = drawinglayer::primitive2d::Primitive2DReference( new PolygonStrokePrimitive2D(
- Polygon(maThumbnailArea,5,5).getB2DPolygon(),
- LineAttribute(BColor(0.8, 0.8, 0.8), 2.0)));
+ aSeq[nCount++] = drawinglayer::primitive2d::Primitive2DReference(new PolygonStrokePrimitive2D(
+ Polygon(maThumbnailArea, 5, 5).getB2DPolygon(),
+ LineAttribute(BColor(0.5, 0.5, 0.5), 2.0)));
// Paint the thumbnails side by side on a 2x2 grid
long nThumbPadding = 4;
diff --git a/sfx2/source/control/templatedefaultview.cxx b/sfx2/source/control/templatedefaultview.cxx
index 61c3f2c07fa0..39ee41552f68 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -12,6 +12,8 @@
#include <vcl/builderfactory.hxx>
#include <sfx2/app.hxx>
+#include <officecfg/Office/Common.hxx>
+
VCL_BUILDER_FACTORY(TemplateDefaultView)
TemplateDefaultView::TemplateDefaultView( Window* pParent)
@@ -23,6 +25,25 @@ 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 );
+
+ // 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;
+
+
+ maAllButton->SetControlForeground(maTextColor);
+ maFTName->SetControlForeground(maTextColor);
+
+ // TODO - convert the TemplateAbstractView to .ui (instead of fixed layout
+ // of the button and the fixed text), and do the following:
+ // const float fMultiplier = 1.4;
+ // vcl::Font aFont(maAllButton->GetSettings().GetStyleSettings().GetPushButtonFont());
+ // aFont.SetSize(Size(0, aFont.GetSize().Height() * fMultiplier));
+ // maAllButton->SetControlFont(aFont);
+ // maFTName->SetControlFont(aFont);
}
void TemplateDefaultView::reload()
diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx
index c2ce8d224447..05b7ebb1f4fd 100644
--- a/sfx2/source/control/templateviewitem.cxx
+++ b/sfx2/source/control/templateviewitem.cxx
@@ -20,7 +20,6 @@
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <vcl/button.hxx>
#include <vcl/graph.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
#define SUBTITLE_SCALE_FACTOR 0.85
@@ -77,11 +76,8 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
if ( mbSelected || mbHover )
aFillColor = pAttrs->aHighlightColor;
- if(mbHover)
- {
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- fTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
- }
+ if (mbHover)
+ fTransparence = pAttrs->fHighlightTransparence;
aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new PolyPolygonSelectionPrimitive2D(
B2DPolyPolygon(Polygon(maDrawArea,5,5).getB2DPolygon()),
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index b9f50d96262e..ff050df4a699 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -29,6 +29,7 @@
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <rtl/ustring.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <vcl/decoview.hxx>
#include <vcl/svapp.hxx>
#include <vcl/scrbar.hxx>
@@ -151,6 +152,10 @@ void ThumbnailView::ImplInit()
maTextColor = GetSettings().GetStyleSettings().GetWindowTextColor();
maHighlightColor = GetSettings().GetStyleSettings().GetHighlightColor();
maHighlightTextColor = GetSettings().GetStyleSettings().GetWindowTextColor();
+
+ const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
+ mfHighlightTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
+
mpStartSelRange = mFilteredItemList.end();
ApplySettings(*this);
@@ -203,6 +208,7 @@ void ThumbnailView::ApplySettings(vcl::RenderContext& rRenderContext)
mpItemAttrs->aTextColor = maTextColor.getBColor();
mpItemAttrs->aHighlightColor = maHighlightColor.getBColor();
mpItemAttrs->aHighlightTextColor = maHighlightTextColor.getBColor();
+ mpItemAttrs->fHighlightTransparence = mfHighlightTransparence;
mpItemAttrs->aFontAttr = getFontAttributeFromVclFont(mpItemAttrs->aFontSize,GetFont(),false,true);
mpItemAttrs->nMaxTextLength = 0;
}
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 7a0390c911cb..68586ba42f37 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -37,7 +37,6 @@
#include <vcl/graph.hxx>
#include <vcl/svapp.hxx>
#include <vcl/texteng.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
using namespace basegfx;
using namespace basegfx::tools;
@@ -277,10 +276,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
aFillColor = pAttrs->aHighlightColor;
if (mbHover)
- {
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- fTransparence = 0.25;
- }
+ fTransparence = pAttrs->fHighlightTransparence;
sal_uInt32 nPrimitive = 0;
aSeq[nPrimitive++] = drawinglayer::primitive2d::Primitive2DReference( new PolyPolygonSelectionPrimitive2D(