summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-12-13 10:08:34 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-12-13 15:45:54 +0100
commite4e8f246452da4a81ffd92664c9731e0e195b032 (patch)
treeec81e4ec3e5a12e1534ddc2f8ba69ee6b406b5f5 /sfx2
parentf82b7a2aea7bcbc6dca13fc251b11685d62b8380 (diff)
Revert "Template Manager: better show the folder overlay."
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/templateabstractview.hxx4
-rw-r--r--sfx2/inc/sfx2/thumbnailview.hxx4
-rw-r--r--sfx2/inc/sfx2/thumbnailviewitem.hxx1
-rw-r--r--sfx2/source/control/templateabstractview.cxx18
-rw-r--r--sfx2/source/control/templatelocalview.cxx3
-rw-r--r--sfx2/source/control/templatelocalviewitem.cxx6
-rw-r--r--sfx2/source/control/templateview.cxx18
-rw-r--r--sfx2/source/control/templateviewitem.cxx6
-rw-r--r--sfx2/source/control/thumbnailview.cxx20
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 613f0da18536..02c61b0e6eb4 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -274,11 +274,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 )