diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-12-13 10:08:34 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-12-13 15:46:56 +0100 |
commit | 3f1797cb5d3140fbf1c27c506146af048dfa4b3f (patch) | |
tree | b1718dc248f344b2cb8fc17717b0815bf62fd2b3 /sfx2 | |
parent | 62cde8eded955de1164c6c9b347cab21c35963af (diff) |
Revert "Template Manager: better show the folder overlay."
This reverts commit 7bebd970852a34c8421b499d06d75444c08221bc.
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/templateabstractview.hxx | 4 | ||||
-rw-r--r-- | sfx2/inc/sfx2/thumbnailview.hxx | 4 | ||||
-rw-r--r-- | sfx2/inc/sfx2/thumbnailviewitem.hxx | 1 | ||||
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/control/templatelocalview.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/control/templatelocalviewitem.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/control/templateview.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/control/templateviewitem.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 20 |
9 files changed, 24 insertions, 56 deletions
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx index 276b38952cf6..8dd3c2833535 100644 --- a/sfx2/inc/sfx2/templateabstractview.hxx +++ b/sfx2/inc/sfx2/templateabstractview.hxx @@ -122,6 +122,10 @@ protected: virtual void Resize(); + virtual void Paint( const Rectangle& rRect ); + + virtual void DrawItem (ThumbnailViewItem *pItem); + DECL_LINK(OverlayItemStateHdl, const ThumbnailViewItem*); protected: diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx index 935624bbeb93..6ebe23f2ddec 100644 --- a/sfx2/inc/sfx2/thumbnailview.hxx +++ b/sfx2/inc/sfx2/thumbnailview.hxx @@ -225,8 +225,6 @@ public: Color GetColor() const { return maColor; } - void SetTransparence( double nTransparence ); - bool IsColor() const { return maColor.GetTransparency() == 0; } Size CalcWindowSizePixel(sal_uInt16 nCalcCols, sal_uInt16 nCalcLines, @@ -306,7 +304,6 @@ protected: ScrollBar* mpScrBar; Rectangle maItemListRect; long mnHeaderHeight; - long mnFooterHeight; long mnItemWidth; long mnItemHeight; long mnItemPadding; @@ -324,7 +321,6 @@ protected: bool mbIsTransientChildrenDisabled : 1; bool mbHasVisibleItems : 1; Color maColor; - double mnTransparence; Link maItemStateHdl; ThumbnailItemAttributes *mpItemAttrs; diff --git a/sfx2/inc/sfx2/thumbnailviewitem.hxx b/sfx2/inc/sfx2/thumbnailviewitem.hxx index e454599b70c7..96096670f36d 100644 --- a/sfx2/inc/sfx2/thumbnailviewitem.hxx +++ b/sfx2/inc/sfx2/thumbnailviewitem.hxx @@ -53,7 +53,6 @@ struct ThumbnailItemAttributes { sal_uInt32 nMaxTextLenght; basegfx::BColor aFillColor; - double nFillTransparence; basegfx::BColor aHighlightColor; basegfx::B2DVector aFontSize; drawinglayer::attribute::FontAttribute aFontAttr; diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index 22198f1adb08..ae9e9588a69b 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -281,11 +281,19 @@ BitmapEx TemplateAbstractView::fetchThumbnail (const OUString &msURL, long width void TemplateAbstractView::Resize() { - Size aSize = GetSizePixel(); - aSize.setHeight(aSize.getHeight() * 0.5); - aSize.setWidth(aSize.getWidth() - 20); - Point aPos(10, 10); - mpItemView->SetPosSizePixel(aPos, aSize); + mpItemView->SetSizePixel(GetSizePixel()); +} + +void TemplateAbstractView::Paint(const Rectangle &rRect) +{ + if (!mpItemView->IsVisible()) + ThumbnailView::Paint(rRect); +} + +void TemplateAbstractView::DrawItem(ThumbnailViewItem *pItem) +{ + if (!mpItemView->IsVisible()) + ThumbnailView::DrawItem(pItem); } IMPL_LINK(TemplateAbstractView, OverlayItemStateHdl, const ThumbnailViewItem*, pItem) diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index c5fb8a007760..ba0c1f232595 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -204,10 +204,7 @@ void TemplateLocalView::showOverlay (bool bVisible) } mpItemView->Clear(); - SetTransparence(0.0); } - else - SetTransparence(0.5); } void TemplateLocalView::filterTemplatesByApp (const FILTER_APPLICATION &eApp) diff --git a/sfx2/source/control/templatelocalviewitem.cxx b/sfx2/source/control/templatelocalviewitem.cxx index 025cf5f8860e..54ba37976453 100644 --- a/sfx2/source/control/templatelocalviewitem.cxx +++ b/sfx2/source/control/templatelocalviewitem.cxx @@ -17,7 +17,6 @@ #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> -#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <sfx2/templateviewitem.hxx> #include <vcl/button.hxx> @@ -141,10 +140,7 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p com::sun::star::lang::Locale(), Color(COL_BLACK).getBColor() ) ); - Primitive2DSequence aTranspSeq(1); - aTranspSeq[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D(aSeq, pAttrs->nFillTransparence)); - - pProcessor->process(aTranspSeq); + pProcessor->process(aSeq); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx index ce3100314b41..23f10956b912 100644 --- a/sfx2/source/control/templateview.cxx +++ b/sfx2/source/control/templateview.cxx @@ -11,8 +11,6 @@ #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> @@ -20,11 +18,9 @@ #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" @@ -43,7 +39,6 @@ TemplateView::TemplateView (Window *pParent) mpEditName(new Edit(this, WB_BORDER | WB_HIDE)) { mnHeaderHeight = 30; - mnFooterHeight = 5; } TemplateView::~TemplateView () @@ -62,7 +57,7 @@ void TemplateView::Paint (const Rectangle &rRect) ThumbnailView::Paint(rRect); int nCount = 0; - int nMaxCount = 2; + int nMaxCount = 1; if (mbRenderTitle) ++nMaxCount; @@ -83,14 +78,11 @@ 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 >( ), - aFontAttr, + mpItemAttrs->aFontAttr, com::sun::star::lang::Locale(), Color(COL_BLACK).getBColor() ) ); } @@ -101,7 +93,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), @@ -109,10 +101,6 @@ 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); } diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx index 1cb3d23b2c2d..51a28622e511 100644 --- a/sfx2/source/control/templateviewitem.cxx +++ b/sfx2/source/control/templateviewitem.cxx @@ -17,7 +17,6 @@ #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> -#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <vcl/button.hxx> @@ -139,10 +138,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces Color(COL_BLACK).getBColor() ) ); } - Primitive2DSequence aTranspSeq(1); - aTranspSeq[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D(aSeq, pAttrs->nFillTransparence)); - - pProcessor->process(aTranspSeq); + pProcessor->process(aSeq); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 0c0cec8851f5..db8d6261da8f 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -24,7 +24,6 @@ #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> -#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <drawinglayer/processor2d/processorfromoutputdevice.hxx> #include <rtl/ustring.hxx> @@ -86,7 +85,6 @@ void ThumbnailView::ImplInit() { mpScrBar = NULL; mnHeaderHeight = 0; - mnFooterHeight = 0; mnItemWidth = 0; mnItemHeight = 0; mnItemPadding = 0; @@ -102,7 +100,6 @@ void ThumbnailView::ImplInit() mbHasVisibleItems = false; maFilterFunc = ViewFilterAll(); maColor = GetSettings().GetStyleSettings().GetFieldColor(); - mnTransparence = 0.0; // Create the processor and process the primitives const drawinglayer::geometry::ViewInformation2D aNewViewInfos; @@ -165,7 +162,6 @@ void ThumbnailView::ImplInitSettings( bool bFont, bool bForeground, bool bBackgr mpItemAttrs = new ThumbnailItemAttributes; mpItemAttrs->aFillColor = maColor.getBColor(); - mpItemAttrs->nFillTransparence = mnTransparence; mpItemAttrs->aHighlightColor = rStyleSettings.GetHighlightColor().getBColor(); mpItemAttrs->aFontAttr = getFontAttributeFromVclFont(mpItemAttrs->aFontSize,GetFont(),false,true); mpItemAttrs->nMaxTextLenght = -1; @@ -377,7 +373,7 @@ void ThumbnailView::CalculateItemPositions () long nLines = (nCurCount+mnCols-1)/mnCols; Point aPos( aWinSize.Width() - nScrBarWidth - mnScrBarOffset, mnHeaderHeight ); - Size aSize( nScrBarWidth - mnScrBarOffset, aWinSize.Height() - mnHeaderHeight - mnFooterHeight ); + Size aSize( nScrBarWidth - mnScrBarOffset, aWinSize.Height() - mnHeaderHeight ); mpScrBar->SetPosSizePixel( aPos, aSize ); mpScrBar->SetRangeMax( (nCurCount+mnCols-1)/mnCols); @@ -562,10 +558,7 @@ void ThumbnailView::Paint( const Rectangle &aRect) B2DPolyPolygon(Polygon(aRect,5,5).getB2DPolygon()), maColor.getBColor())); - Primitive2DSequence aTranspSeq(1); - aTranspSeq[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D(aSeq, mnTransparence)); - - mpProcessor->process(aTranspSeq); + mpProcessor->process(aSeq); // draw items for ( size_t i = 0; i < nItemCount; i++ ) @@ -916,15 +909,6 @@ void ThumbnailView::SetColor( const Color& rColor ) Invalidate(); } -void ThumbnailView::SetTransparence( double nTransparence ) -{ - mnTransparence = nTransparence; - mpItemAttrs->nFillTransparence = nTransparence; - - if ( IsReallyVisible() && IsUpdateMode() ) - Invalidate(); -} - bool ThumbnailView::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) { if ( rCEvt.GetCommand() != COMMAND_STARTDRAG ) |