diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-12-11 17:19:11 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-12-12 10:16:36 +0100 |
commit | d4dc0293a839e615f302d27b92e008d5d0f7d511 (patch) | |
tree | ae9ce6619bfc5872eef8f8b4f235d145a90dedb4 /sfx2/source/control/templateview.cxx | |
parent | 31f1a12ca545a0cafcf855346c77752ee17d0efe (diff) |
Template Manager: better show the folder overlay.
Still to be improved:
- Add some shadow
- White background colors is may be not ideal
Change-Id: Id89320ebef8ee95ed24a844bbd98e3bd6bebc678
Diffstat (limited to 'sfx2/source/control/templateview.cxx')
-rw-r--r-- | sfx2/source/control/templateview.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx index 0892a158e0bc..ff0e906c4d0d 100644 --- a/sfx2/source/control/templateview.cxx +++ b/sfx2/source/control/templateview.cxx @@ -11,6 +11,8 @@ #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/point/b2dpoint.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/vector/b2dvector.hxx> #include <drawinglayer/attribute/fillbitmapattribute.hxx> @@ -18,9 +20,11 @@ #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> +#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <sfx2/sfxresid.hxx> #include <sfx2/templateviewitem.hxx> #include <vcl/edit.hxx> +#include <vcl/scrbar.hxx> #include "templateview.hrc" @@ -39,6 +43,7 @@ TemplateView::TemplateView (Window *pParent) mpEditName(new Edit(this, WB_BORDER | WB_HIDE)) { mnHeaderHeight = 30; + mnFooterHeight = 5; } TemplateView::~TemplateView () @@ -57,7 +62,7 @@ void TemplateView::Paint (const Rectangle &rRect) ThumbnailView::Paint(rRect); int nCount = 0; - int nMaxCount = 1; + int nMaxCount = 2; if (mbRenderTitle) ++nMaxCount; @@ -78,11 +83,14 @@ void TemplateView::Paint (const Rectangle &rRect) mpItemAttrs->aFontSize.getX(), mpItemAttrs->aFontSize.getY(), double( aPos.X() ), double( aPos.Y() ) ) ); + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + B2DVector aFontSize; + FontAttribute aFontAttr = getFontAttributeFromVclFont(aFontSize, rStyleSettings.GetTitleFont(), false, false); aSeq[nCount++] = Primitive2DReference( new TextSimplePortionPrimitive2D(aTextMatrix, maName,0,maName.getLength(), std::vector< double >( ), - mpItemAttrs->aFontAttr, + aFontAttr, com::sun::star::lang::Locale(), Color(COL_BLACK).getBColor() ) ); } @@ -93,7 +101,7 @@ void TemplateView::Paint (const Rectangle &rRect) aPos.Y() = (mnHeaderHeight - aImageSize.Height())/2; aPos.X() = aWinSize.Width() - aImageSize.Width() - aPos.Y(); - aSeq[nCount] = Primitive2DReference( new FillBitmapPrimitive2D( + aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D( createTranslateB2DHomMatrix(aPos.X(),aPos.Y()), FillBitmapAttribute(maCloseImg.GetBitmapEx(), B2DPoint(0,0), @@ -101,6 +109,10 @@ void TemplateView::Paint (const Rectangle &rRect) false) )); + // TODO Draw some shadow + Rectangle aBounds(Point(0, 0), Size(aWinSize.getWidth() - 1, aWinSize.getHeight() - 1)); + B2DPolygon aBoundsPolygon(Polygon(aBounds, 5, 5).getB2DPolygon()); + aSeq[nCount] = Primitive2DReference( new PolyPolygonHairlinePrimitive2D(B2DPolyPolygon(aBoundsPolygon), Color(0,0,0).getBColor())); mpProcessor->process(aSeq); } |