[Libreoffice-commits] .: Branch 'libreoffice-4-0' - 7 commits - sfx2/inc sfx2/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Dec 12 01:20:30 PST 2012
sfx2/inc/sfx2/templateabstractview.hxx | 10 -
sfx2/inc/sfx2/templatelocalview.hxx | 2
sfx2/inc/sfx2/templatelocalviewitem.hxx | 2
sfx2/inc/sfx2/templateremoteviewitem.hxx | 2
sfx2/inc/sfx2/templateview.hxx | 6
sfx2/inc/sfx2/templateviewitem.hxx | 2
sfx2/inc/sfx2/thumbnailview.hxx | 15 --
sfx2/inc/sfx2/thumbnailviewitem.hxx | 19 ---
sfx2/inc/templatedlg.hxx | 7 -
sfx2/source/appl/appopen.cxx | 2
sfx2/source/control/templateabstractview.cxx | 56 +--------
sfx2/source/control/templatelocalview.cxx | 36 +++--
sfx2/source/control/templatelocalviewitem.cxx | 75 ++++++------
sfx2/source/control/templateremoteview.cxx | 6
sfx2/source/control/templateremoteviewitem.cxx | 4
sfx2/source/control/templatesearchview.cxx | 2
sfx2/source/control/templateview.cxx | 24 ++-
sfx2/source/control/templateviewitem.cxx | 50 ++++----
sfx2/source/control/thumbnailview.cxx | 154 ++++++-------------------
sfx2/source/control/thumbnailviewitem.cxx | 77 ++----------
sfx2/source/doc/objserv.cxx | 2
sfx2/source/doc/templatedlg.cxx | 45 -------
sfx2/source/doc/templatedlg.src | 14 --
sfx2/source/inc/templatesearchviewitem.hxx | 4
24 files changed, 206 insertions(+), 410 deletions(-)
New commits:
commit ea5589dc61f12f949a2fe1a8dae02e6290bf4294
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Wed Dec 12 10:07:24 2012 +0100
Template manager: dialog has no parent to show 'X' button
Change-Id: I1d7806a125fb34000f588f0936b48dd7ce411356
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index c0d1284..ae2cb16 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -37,7 +37,7 @@ class SfxTemplateManagerDlg : public ModelessDialog
{
public:
- SfxTemplateManagerDlg (Window *parent = NULL);
+ SfxTemplateManagerDlg (Window *parent = DIALOG_NO_PARENT);
~SfxTemplateManagerDlg ();
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index afddf87..9a295b7 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -566,7 +566,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
sal_Bool bNewWin = sal_False;
Window* pTopWin = GetTopWindow();
- SfxTemplateManagerDlg aTemplDlg(NULL);
+ SfxTemplateManagerDlg aTemplDlg;
int nRet = aTemplDlg.Execute();
if ( nRet == RET_OK )
{
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 722c00f..7d313e7 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -863,7 +863,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case SID_DOCTEMPLATE:
{
// save as document templates
- SfxTemplateManagerDlg aDlg(NULL);
+ SfxTemplateManagerDlg aDlg;
aDlg.setDocumentModel(GetModel());
aDlg.setSaveMode(true);
aDlg.Execute();
commit 95b42b099474c1f2b527c417a15a6b1bc08f7a9a
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Dec 11 17:19:11 2012 +0100
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
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
index 4eb7e6f..9194b8e 100644
--- a/sfx2/inc/sfx2/templateabstractview.hxx
+++ b/sfx2/inc/sfx2/templateabstractview.hxx
@@ -118,10 +118,6 @@ 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 6ebe23f..935624b 100644
--- a/sfx2/inc/sfx2/thumbnailview.hxx
+++ b/sfx2/inc/sfx2/thumbnailview.hxx
@@ -225,6 +225,8 @@ 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,
@@ -304,6 +306,7 @@ protected:
ScrollBar* mpScrBar;
Rectangle maItemListRect;
long mnHeaderHeight;
+ long mnFooterHeight;
long mnItemWidth;
long mnItemHeight;
long mnItemPadding;
@@ -321,6 +324,7 @@ 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 9609667..e454599 100644
--- a/sfx2/inc/sfx2/thumbnailviewitem.hxx
+++ b/sfx2/inc/sfx2/thumbnailviewitem.hxx
@@ -53,6 +53,7 @@ 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 3d7dc07..a485fc2 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -275,19 +275,11 @@ BitmapEx TemplateAbstractView::fetchThumbnail (const OUString &msURL, long width
void TemplateAbstractView::Resize()
{
- 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);
+ Size aSize = GetSizePixel();
+ aSize.setHeight(aSize.getHeight() * 0.5);
+ aSize.setWidth(aSize.getWidth() - 20);
+ Point aPos(10, 10);
+ mpItemView->SetPosSizePixel(aPos, aSize);
}
IMPL_LINK(TemplateAbstractView, OverlayItemStateHdl, const ThumbnailViewItem*, pItem)
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 557b8ff..5147014 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -230,7 +230,10 @@ 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 54ba379..025cf5f 100644
--- a/sfx2/source/control/templatelocalviewitem.cxx
+++ b/sfx2/source/control/templatelocalviewitem.cxx
@@ -17,6 +17,7 @@
#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>
@@ -140,7 +141,10 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
com::sun::star::lang::Locale(),
Color(COL_BLACK).getBColor() ) );
- pProcessor->process(aSeq);
+ Primitive2DSequence aTranspSeq(1);
+ aTranspSeq[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D(aSeq, pAttrs->nFillTransparence));
+
+ pProcessor->process(aTranspSeq);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx
index 0892a15..ff0e906 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);
}
diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx
index 51a2862..1cb3d23 100644
--- a/sfx2/source/control/templateviewitem.cxx
+++ b/sfx2/source/control/templateviewitem.cxx
@@ -17,6 +17,7 @@
#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>
@@ -138,7 +139,10 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
Color(COL_BLACK).getBColor() ) );
}
- pProcessor->process(aSeq);
+ Primitive2DSequence aTranspSeq(1);
+ aTranspSeq[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D(aSeq, pAttrs->nFillTransparence));
+
+ pProcessor->process(aTranspSeq);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index db8d626..0c0cec8 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -24,6 +24,7 @@
#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>
@@ -85,6 +86,7 @@ void ThumbnailView::ImplInit()
{
mpScrBar = NULL;
mnHeaderHeight = 0;
+ mnFooterHeight = 0;
mnItemWidth = 0;
mnItemHeight = 0;
mnItemPadding = 0;
@@ -100,6 +102,7 @@ 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;
@@ -162,6 +165,7 @@ 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;
@@ -373,7 +377,7 @@ void ThumbnailView::CalculateItemPositions ()
long nLines = (nCurCount+mnCols-1)/mnCols;
Point aPos( aWinSize.Width() - nScrBarWidth - mnScrBarOffset, mnHeaderHeight );
- Size aSize( nScrBarWidth - mnScrBarOffset, aWinSize.Height() - mnHeaderHeight );
+ Size aSize( nScrBarWidth - mnScrBarOffset, aWinSize.Height() - mnHeaderHeight - mnFooterHeight );
mpScrBar->SetPosSizePixel( aPos, aSize );
mpScrBar->SetRangeMax( (nCurCount+mnCols-1)/mnCols);
@@ -558,7 +562,10 @@ void ThumbnailView::Paint( const Rectangle &aRect)
B2DPolyPolygon(Polygon(aRect,5,5).getB2DPolygon()),
maColor.getBColor()));
- mpProcessor->process(aSeq);
+ Primitive2DSequence aTranspSeq(1);
+ aTranspSeq[0] = Primitive2DReference( new UnifiedTransparencePrimitive2D(aSeq, mnTransparence));
+
+ mpProcessor->process(aTranspSeq);
// draw items
for ( size_t i = 0; i < nItemCount; i++ )
@@ -909,6 +916,15 @@ 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 )
commit d4b9831b5d2d93ed4bf42b2ac8ff0c0b7d0daaec
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Thu Dec 6 18:53:01 2012 +0100
Template manager: paint white background under thumbnails
Change-Id: I55bbda1a7d04e462737b8cf24aba755b8ce96e8a
diff --git a/sfx2/inc/sfx2/thumbnailviewitem.hxx b/sfx2/inc/sfx2/thumbnailviewitem.hxx
index 0a7f08a..9609667 100644
--- a/sfx2/inc/sfx2/thumbnailviewitem.hxx
+++ b/sfx2/inc/sfx2/thumbnailviewitem.hxx
@@ -36,7 +36,7 @@ class Window;
class ThumbnailView;
namespace basegfx {
- class B2DPoint;
+ class B2DPolygon;
}
namespace drawinglayer {
@@ -45,7 +45,7 @@ namespace drawinglayer {
}
namespace primitive2d {
- class BorderLinePrimitive2D;
+ class PolygonHairlinePrimitive2D;
}
}
@@ -107,8 +107,8 @@ public:
virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
const ThumbnailItemAttributes *pAttrs);
- static drawinglayer::primitive2d::BorderLinePrimitive2D*
- createBorderLine (const basegfx::B2DPoint &rStart, const basegfx::B2DPoint &rEnd);
+ static drawinglayer::primitive2d::PolygonHairlinePrimitive2D*
+ createBorderLine (const basegfx::B2DPolygon &rPolygon);
protected:
diff --git a/sfx2/source/control/templatelocalviewitem.cxx b/sfx2/source/control/templatelocalviewitem.cxx
index 544b86a..54ba379 100644
--- a/sfx2/source/control/templatelocalviewitem.cxx
+++ b/sfx2/source/control/templatelocalviewitem.cxx
@@ -12,8 +12,8 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
-#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
@@ -42,10 +42,10 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
int nSeqSize = 2;
if (!maPreview1.IsEmpty())
- nSeqSize += 5;
+ nSeqSize += 3;
if (!maPreview2.IsEmpty())
- nSeqSize += 5;
+ nSeqSize += 3;
BColor aFillColor = pAttrs->aFillColor;
Primitive2DSequence aSeq(nSeqSize);
@@ -70,6 +70,20 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
fScaleX = 0.8f;
fScaleY = 0.8f;
+ float fWidth = aImageSize.Width()*fScaleX;
+ float fHeight = aImageSize.Height()*fScaleY;
+ float fPosX = aPos.getX()+35*fScaleX;
+ float fPosY = aPos.getY()+20*fScaleY;
+
+ B2DPolygon aBounds;
+ aBounds.append(B2DPoint(fPosX,fPosY));
+ aBounds.append(B2DPoint(fPosX+fWidth,fPosY));
+ aBounds.append(B2DPoint(fPosX+fWidth,fPosY+fHeight));
+ aBounds.append(B2DPoint(fPosX,fPosY+fHeight));
+ aBounds.setClosed(true);
+
+ aSeq[nCount++] = Primitive2DReference( new PolyPolygonColorPrimitive2D(
+ B2DPolyPolygon(aBounds), Color(COL_WHITE).getBColor()));
aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D(
createScaleTranslateB2DHomMatrix(fScaleX,fScaleY,aPos.X(),aPos.Y()),
FillBitmapAttribute(maPreview2,
@@ -79,23 +93,26 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
));
// draw thumbnail borders
- float fWidth = aImageSize.Width()*fScaleX;
- float fHeight = aImageSize.Height()*fScaleY;
- float fPosX = aPos.getX()+35*fScaleX;
- float fPosY = aPos.getY()+20*fScaleY;
-
- aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY),
- B2DPoint(fPosX+fWidth,fPosY)));
- aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY),
- B2DPoint(fPosX+fWidth,fPosY+fHeight)));
- aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY+fHeight),
- B2DPoint(fPosX,fPosY+fHeight)));
- aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY+fHeight),
- B2DPoint(fPosX,fPosY)));
+ aSeq[nCount++] = Primitive2DReference(createBorderLine(aBounds));
}
if (!maPreview1.IsEmpty())
{
+ // draw thumbnail borders
+ float fWidth = aImageSize.Width()*fScaleX;
+ float fHeight = aImageSize.Height()*fScaleY;
+ float fPosX = aPos.getX();
+ float fPosY = aPos.getY();
+
+ B2DPolygon aBounds;
+ aBounds.append(B2DPoint(fPosX,fPosY));
+ aBounds.append(B2DPoint(fPosX+fWidth,fPosY));
+ aBounds.append(B2DPoint(fPosX+fWidth,fPosY+fHeight));
+ aBounds.append(B2DPoint(fPosX,fPosY+fHeight));
+ aBounds.setClosed(true);
+
+ aSeq[nCount++] = Primitive2DReference( new PolyPolygonColorPrimitive2D(
+ B2DPolyPolygon(aBounds), Color(COL_WHITE).getBColor()));
aSeq[nCount++] = Primitive2DReference( new FillBitmapPrimitive2D(
createScaleTranslateB2DHomMatrix(fScaleX,fScaleY,aPos.X(),aPos.Y()),
FillBitmapAttribute(maPreview1,
@@ -104,20 +121,7 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
false)
));
- // draw thumbnail borders
- float fWidth = aImageSize.Width()*fScaleX;
- float fHeight = aImageSize.Height()*fScaleY;
- float fPosX = aPos.getX();
- float fPosY = aPos.getY();
-
- aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY),
- B2DPoint(fPosX+fWidth,fPosY)));
- aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY),
- B2DPoint(fPosX+fWidth,fPosY+fHeight)));
- aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY+fHeight),
- B2DPoint(fPosX,fPosY+fHeight)));
- aSeq[nCount++] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY+fHeight),
- B2DPoint(fPosX,fPosY)));
+ aSeq[nCount++] = Primitive2DReference(createBorderLine(aBounds));
}
// Draw centered text below thumbnail
diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx
index e2abf71..51a2862 100644
--- a/sfx2/source/control/templateviewitem.cxx
+++ b/sfx2/source/control/templateviewitem.cxx
@@ -12,8 +12,8 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
-#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
@@ -68,7 +68,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
{
BColor aFillColor = pAttrs->aFillColor;
- int nCount = maSubTitle.isEmpty() ? 7 : 8;
+ int nCount = maSubTitle.isEmpty() ? 5 : 6;
Primitive2DSequence aSeq(nCount);
// Draw background
@@ -82,7 +82,22 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
// Draw thumbnail
Size aImageSize = maPreview1.GetSizePixel();
- aSeq[1] = Primitive2DReference( new FillBitmapPrimitive2D(
+ float fWidth = aImageSize.Width();
+ float fHeight = aImageSize.Height();
+ float fPosX = maPrev1Pos.getX();
+ float fPosY = maPrev1Pos.getY();
+
+ B2DPolygon aBounds;
+ aBounds.append(B2DPoint(fPosX,fPosY));
+ aBounds.append(B2DPoint(fPosX+fWidth,fPosY));
+ aBounds.append(B2DPoint(fPosX+fWidth,fPosY+fHeight));
+ aBounds.append(B2DPoint(fPosX,fPosY+fHeight));
+ aBounds.setClosed(true);
+
+ aSeq[1] = Primitive2DReference( new PolyPolygonColorPrimitive2D(
+ B2DPolyPolygon(aBounds), Color(COL_WHITE).getBColor()));
+
+ aSeq[2] = Primitive2DReference( new FillBitmapPrimitive2D(
createTranslateB2DHomMatrix(maPrev1Pos.X(),maPrev1Pos.Y()),
FillBitmapAttribute(maPreview1,
B2DPoint(0,0),
@@ -91,19 +106,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
));
// draw thumbnail borders
- float fWidth = aImageSize.Width();
- float fHeight = aImageSize.Height();
- float fPosX = maPrev1Pos.getX();
- float fPosY = maPrev1Pos.getY();
-
- aSeq[2] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY),
- B2DPoint(fPosX+fWidth,fPosY)));
- aSeq[3] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY),
- B2DPoint(fPosX+fWidth,fPosY+fHeight)));
- aSeq[4] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY+fHeight),
- B2DPoint(fPosX,fPosY+fHeight)));
- aSeq[5] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY+fHeight),
- B2DPoint(fPosX,fPosY)));
+ aSeq[3] = Primitive2DReference(createBorderLine(aBounds));
// Draw centered text below thumbnail
@@ -112,7 +115,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(),
double( maTextPos.X() ), double( maTextPos.Y() ) ) );
- aSeq[6] = Primitive2DReference(
+ aSeq[4] = Primitive2DReference(
new TextSimplePortionPrimitive2D(aTitleMatrix,
maTitle,0,pAttrs->nMaxTextLenght,
std::vector< double >( ),
@@ -126,7 +129,7 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
pAttrs->aFontSize.getX()*SUBTITLE_SCALE_FACTOR, pAttrs->aFontSize.getY()*SUBTITLE_SCALE_FACTOR,
double( maSubTitlePos.X() ), double( maSubTitlePos.Y() ) ) );
- aSeq[7] = Primitive2DReference(
+ aSeq[5] = Primitive2DReference(
new TextSimplePortionPrimitive2D(aSubTitleMatrix,
maSubTitle,0,pAttrs->nMaxTextLenght,
std::vector< double >( ),
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 2410922..3f1077e 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -26,8 +26,8 @@
#include <basegfx/vector/b2dsize.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
-#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textprimitive2d.hxx>
@@ -122,7 +122,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
const ThumbnailItemAttributes *pAttrs)
{
BColor aFillColor = pAttrs->aFillColor;
- Primitive2DSequence aSeq(7);
+ Primitive2DSequence aSeq(4);
// Draw background
if ( mbSelected || mbHover )
@@ -150,14 +150,14 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
float fPosX = maPrev1Pos.getX();
float fPosY = maPrev1Pos.getY();
- aSeq[2] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY),
- B2DPoint(fPosX+fWidth,fPosY)));
- aSeq[3] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY),
- B2DPoint(fPosX+fWidth,fPosY+fHeight)));
- aSeq[4] = Primitive2DReference(createBorderLine(B2DPoint(fPosX+fWidth,fPosY+fHeight),
- B2DPoint(fPosX,fPosY+fHeight)));
- aSeq[5] = Primitive2DReference(createBorderLine(B2DPoint(fPosX,fPosY+fHeight),
- B2DPoint(fPosX,fPosY)));
+ B2DPolygon aBounds;
+ aBounds.append(B2DPoint(fPosX,fPosY));
+ aBounds.append(B2DPoint(fPosX+fWidth,fPosY));
+ aBounds.append(B2DPoint(fPosX+fWidth,fPosY+fHeight));
+ aBounds.append(B2DPoint(fPosX,fPosY+fHeight));
+ aBounds.setClosed(true);
+
+ aSeq[2] = Primitive2DReference(createBorderLine(aBounds));
// Draw centered text below thumbnail
aPos = maTextPos;
@@ -167,7 +167,7 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(),
double( aPos.X() ), double( aPos.Y() ) ) );
- aSeq[6] = Primitive2DReference(
+ aSeq[3] = Primitive2DReference(
new TextSimplePortionPrimitive2D(aTextMatrix,
maTitle,0,pAttrs->nMaxTextLenght,
std::vector< double >( ),
@@ -178,12 +178,10 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
pProcessor->process(aSeq);
}
-drawinglayer::primitive2d::BorderLinePrimitive2D*
-ThumbnailViewItem::createBorderLine (const basegfx::B2DPoint &rStart, const basegfx::B2DPoint &rEnd)
+drawinglayer::primitive2d::PolygonHairlinePrimitive2D*
+ThumbnailViewItem::createBorderLine (const basegfx::B2DPolygon& rPolygon)
{
- return new BorderLinePrimitive2D(rStart,rEnd,0.5,0,0,0,0,0,0,
- BColor(),Color(COL_BLACK).getBColor(),BColor(),
- false,STYLE_SOLID);
+ return new PolygonHairlinePrimitive2D(rPolygon, Color(186,186,186).getBColor());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 04843039b55a9789d5aa993a88a0b4a4e716f885
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Thu Dec 6 15:50:07 2012 +0100
Template manager: toolbars height was too small
Change-Id: Ie2cb1f4947baf99d90bfaaf62834482c8f7e6a05
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index c0687fd..7a61186 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -178,7 +178,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
Control TOOLBARS
{
Pos = MAP_APPFONT( 0 , 22 );
- Size = MAP_APPFONT( 290 , 15 );
+ Size = MAP_APPFONT( 290 , 20 );
TabStop = False;
};
commit a074533219ba633905cc2dd7b3a84558283ebe45
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Thu Dec 6 15:35:58 2012 +0100
Template manager: fix preview for folders after using filters
Change-Id: Iadd38ee0bee7634c0924f48e204baa05566b7586
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index b261e34..557b8ff 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -59,12 +59,18 @@ public:
if (isValid(rTemplates[i].aType))
{
++nVisCount;
-
- // Update the thumbnails
- if (nVisCount == 1)
- pFolderItem->maPreview1 = rTemplates[i].aThumbnail;
- else if (nVisCount == 2)
- pFolderItem->maPreview2 = rTemplates[i].aThumbnail;
+ if ( pFolderItem->maPreview1.IsEmpty( ) )
+ {
+ pFolderItem->maPreview1 = TemplateAbstractView::scaleImg(rTemplates[i].aThumbnail,
+ TEMPLATE_THUMBNAIL_MAX_WIDTH*0.75,
+ TEMPLATE_THUMBNAIL_MAX_HEIGHT*0.75);
+ }
+ else if ( pFolderItem->maPreview2.IsEmpty() )
+ {
+ pFolderItem->maPreview2 = TemplateAbstractView::scaleImg(rTemplates[i].aThumbnail,
+ TEMPLATE_THUMBNAIL_MAX_WIDTH*0.75,
+ TEMPLATE_THUMBNAIL_MAX_HEIGHT*0.75);
+ }
}
}
commit fbb0db533283f9bf99d6f3c13ae6bcfe6d2b1cd3
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Thu Dec 6 13:30:53 2012 +0100
Revert "Template Manager: ban double-click"
This reverts commit 5487769838570ba5f1b35529689321e1842bae31.
Come back to a more consistant UI:
- single click for selection. CTRL modifier for multi-selection
- double click for action
- removed item's checkbox
- get rid of the selection mode
- no hover on items
Change-Id: I82863c77ed6a45410242a244545505a5b898ba56
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
index 0ab599e..4eb7e6f 100644
--- a/sfx2/inc/sfx2/templateabstractview.hxx
+++ b/sfx2/inc/sfx2/templateabstractview.hxx
@@ -106,7 +106,7 @@ public:
void setOverlayItemStateHdl (const Link &aLink) { maOverlayItemStateHdl = aLink; }
- void setOverlayClickHdl (const Link &rLink);
+ void setOverlayDblClickHdl (const Link &rLink);
void setOverlayCloseHdl (const Link &rLink);
@@ -122,15 +122,11 @@ protected:
virtual void DrawItem (ThumbnailViewItem *pItem);
- virtual void OnSelectionMode (bool bMode);
-
DECL_LINK(OverlayItemStateHdl, const ThumbnailViewItem*);
- DECL_LINK(OverlaySelectionModeHdl, bool*);
protected:
TemplateView *mpItemView;
- bool mbInSelectionModeHdl;
Link maOverlayItemStateHdl;
};
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx
index 58debca..9a101f2 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -75,7 +75,7 @@ public:
private:
- virtual void OnItemClicked (ThumbnailViewItem *pRegionItem);
+ virtual void OnItemDblClicked (ThumbnailViewItem *pRegionItem);
DECL_LINK(ChangeNameHdl, TemplateView*);
diff --git a/sfx2/inc/sfx2/templatelocalviewitem.hxx b/sfx2/inc/sfx2/templatelocalviewitem.hxx
index 80330b2..739f70e 100644
--- a/sfx2/inc/sfx2/templatelocalviewitem.hxx
+++ b/sfx2/inc/sfx2/templatelocalviewitem.hxx
@@ -22,7 +22,7 @@ public:
BitmapEx maPreview2;
std::vector<TemplateItemProperties> maTemplates;
- TemplateLocalViewItem (ThumbnailView &rView, Window *pParent);
+ TemplateLocalViewItem (ThumbnailView &rView);
virtual ~TemplateLocalViewItem ();
diff --git a/sfx2/inc/sfx2/templateremoteviewitem.hxx b/sfx2/inc/sfx2/templateremoteviewitem.hxx
index 396b965..63f2c7d 100644
--- a/sfx2/inc/sfx2/templateremoteviewitem.hxx
+++ b/sfx2/inc/sfx2/templateremoteviewitem.hxx
@@ -17,7 +17,7 @@ class TemplateRemoteViewItem : public ThumbnailViewItem
{
public:
- TemplateRemoteViewItem (ThumbnailView &rView, Window *pParent);
+ TemplateRemoteViewItem (ThumbnailView &rView);
virtual ~TemplateRemoteViewItem ();
diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index fee955b..881c68d 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -37,7 +37,7 @@ public:
void InsertItems (const std::vector<TemplateItemProperties> &rTemplates);
- void setClickHdl (const Link &rLink) { maClickHdl = rLink; }
+ void setDblClickHdl (const Link &rLink) { maDblClickHdl = rLink; }
void setChangeNameHdl (const Link &rLink) { maChangeNameHdl = rLink; }
@@ -49,7 +49,7 @@ protected:
virtual void MouseButtonDown (const MouseEvent &rMEvt);
- virtual void OnItemClicked (ThumbnailViewItem *pItem);
+ virtual void OnItemDblClicked (ThumbnailViewItem *pItem);
DECL_LINK (ChangeNameHdl, void*);
@@ -59,7 +59,7 @@ private:
bool mbRenderTitle;
sal_uInt16 mnId;
OUString maName;
- Link maClickHdl;
+ Link maDblClickHdl;
Link maChangeNameHdl;
Link maCloseHdl;
diff --git a/sfx2/inc/sfx2/templateviewitem.hxx b/sfx2/inc/sfx2/templateviewitem.hxx
index 992af40..9a7d358 100644
--- a/sfx2/inc/sfx2/templateviewitem.hxx
+++ b/sfx2/inc/sfx2/templateviewitem.hxx
@@ -16,7 +16,7 @@ class TemplateViewItem : public ThumbnailViewItem
{
public:
- TemplateViewItem (ThumbnailView &rView, Window *pParent);
+ TemplateViewItem (ThumbnailView &rView);
virtual ~TemplateViewItem ();
diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx
index 023c569..6ebe23f 100644
--- a/sfx2/inc/sfx2/thumbnailview.hxx
+++ b/sfx2/inc/sfx2/thumbnailview.hxx
@@ -233,15 +233,12 @@ public:
long GetScrollWidth() const;
- void setSelectionMode (bool mode);
-
void filterItems (const boost::function<bool (const ThumbnailViewItem*) > &func);
void sortItems (const boost::function<bool (const ThumbnailViewItem*,
const ThumbnailViewItem*) > &func);
void setItemStateHdl (const Link &aLink) { maItemStateHdl = aLink; }
- void setSelectionModeHdl (const Link &aLink) { maSelectionModeHdl = aLink; }
protected:
@@ -249,8 +246,6 @@ protected:
virtual void MouseButtonUp( const MouseEvent& rMEvt );
- virtual void MouseMove( const MouseEvent& rMEvt );
-
virtual void Command( const CommandEvent& rCEvt );
virtual void Paint( const Rectangle& rRect );
@@ -275,9 +270,7 @@ protected:
virtual void DrawItem (ThumbnailViewItem *pItem);
- virtual void OnSelectionMode (bool bMode);
-
- virtual void OnItemClicked (ThumbnailViewItem *pItem);
+ virtual void OnItemDblClicked (ThumbnailViewItem *pItem);
protected:
@@ -327,11 +320,9 @@ protected:
bool mbScroll : 1;
bool mbIsTransientChildrenDisabled : 1;
bool mbHasVisibleItems : 1;
- bool mbSelectionMode;
Color maColor;
Link maItemStateHdl;
- Link maSelectionModeHdl;
ThumbnailItemAttributes *mpItemAttrs;
drawinglayer::processor2d::BaseProcessor2D *mpProcessor;
boost::function<bool (const ThumbnailViewItem*) > maFilterFunc;
diff --git a/sfx2/inc/sfx2/thumbnailviewitem.hxx b/sfx2/inc/sfx2/thumbnailviewitem.hxx
index 96cdc5c..0a7f08a 100644
--- a/sfx2/inc/sfx2/thumbnailviewitem.hxx
+++ b/sfx2/inc/sfx2/thumbnailviewitem.hxx
@@ -71,7 +71,7 @@ public:
rtl::OUString maTitle;
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >* mpxAcc;
- ThumbnailViewItem (ThumbnailView &rView, Window *pParent);
+ ThumbnailViewItem (ThumbnailView &rView);
virtual ~ThumbnailViewItem ();
@@ -102,8 +102,6 @@ public:
const Point& getPrev1Pos () const { return maPrev1Pos; }
- void setSelectionMode (bool mode);
-
void setSelectClickHdl (const Link &link);
virtual void Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor,
@@ -112,18 +110,12 @@ public:
static drawinglayer::primitive2d::BorderLinePrimitive2D*
createBorderLine (const basegfx::B2DPoint &rStart, const basegfx::B2DPoint &rEnd);
-private:
-
- DECL_LINK (OnClick, CheckBox *);
-
protected:
- bool mbMode;
Point maTextPos;
Point maPrev1Pos;
Rectangle maDrawArea;
Link maClickHdl;
- CheckBox *mpSelectBox;
};
#endif // THUMBNAILVIEWITEM_HXX
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 8e70039..c0d1284 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -57,9 +57,6 @@ private:
DECL_LINK(CloseOverlayHdl, void*);
- DECL_LINK(OnClickSelectionMode, ImageButton*);
- DECL_LINK(SelectionModeHdl, bool*);
-
DECL_LINK(TBXViewHdl, void*);
DECL_LINK(TBXActionHdl, void*);
DECL_LINK(TBXTemplateHdl, void*);
@@ -124,7 +121,6 @@ private:
PushButton aButtonPresents;
PushButton aButtonSheets;
PushButton aButtonDraws;
- ImageButton maButtonSelMode;
Control *mpToolbars;
Edit *mpSearchEdit;
@@ -143,7 +139,6 @@ private:
std::set<const ThumbnailViewItem*> maSelFolders;
bool mbIsSaveMode; ///< Flag that indicates if we are in save mode or not.
- bool mbInSelectionModeHdl; ///< Flag avoiding selection mode handler loop
com::sun::star::uno::Reference< com::sun::star::frame::XModel > m_xModel;
com::sun::star::uno::Reference< com::sun::star::frame::XComponentLoader > mxDesktop;
};
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index 0baed64..3d7dc07 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -58,20 +58,16 @@ bool ViewFilter_Keyword::operator ()(const ThumbnailViewItem *pItem)
TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
- mpItemView(new TemplateView(this)),
- mbInSelectionModeHdl(false)
+ mpItemView(new TemplateView(this))
{
mpItemView->setItemStateHdl(LINK(this,TemplateAbstractView,OverlayItemStateHdl));
- mpItemView->setSelectionModeHdl(LINK(this,TemplateAbstractView,OverlaySelectionModeHdl));
}
TemplateAbstractView::TemplateAbstractView(Window *pParent, const ResId &rResId, bool bDisableTransientChildren)
: ThumbnailView(pParent,rResId,bDisableTransientChildren),
- mpItemView(new TemplateView(this)),
- mbInSelectionModeHdl(false)
+ mpItemView(new TemplateView(this))
{
mpItemView->setItemStateHdl(LINK(this,TemplateAbstractView,OverlayItemStateHdl));
- mpItemView->setSelectionModeHdl(LINK(this,TemplateAbstractView,OverlaySelectionModeHdl));
}
TemplateAbstractView::~TemplateAbstractView ()
@@ -123,9 +119,9 @@ void TemplateAbstractView::filterTemplatesByKeyword(const OUString &rKeyword)
mpItemView->filterItems(ViewFilter_Keyword(rKeyword));
}
-void TemplateAbstractView::setOverlayClickHdl(const Link &rLink)
+void TemplateAbstractView::setOverlayDblClickHdl(const Link &rLink)
{
- mpItemView->setClickHdl(rLink);
+ mpItemView->setDblClickHdl(rLink);
}
void TemplateAbstractView::setOverlayCloseHdl(const Link &rLink)
@@ -294,36 +290,10 @@ void TemplateAbstractView::DrawItem(ThumbnailViewItem *pItem)
ThumbnailView::DrawItem(pItem);
}
-void TemplateAbstractView::OnSelectionMode (bool bMode)
-{
- if (!mbInSelectionModeHdl)
- {
- if (mpItemView->IsVisible())
- {
- mbSelectionMode = bMode;
- mpItemView->setSelectionMode(bMode);
- }
- else
- ThumbnailView::OnSelectionMode(bMode);
- }
-}
-
IMPL_LINK(TemplateAbstractView, OverlayItemStateHdl, const ThumbnailViewItem*, pItem)
{
maOverlayItemStateHdl.Call((void*)pItem);
return 0;
}
-IMPL_LINK(TemplateAbstractView, OverlaySelectionModeHdl, bool*, pMode)
-{
- mbInSelectionModeHdl = true;
- setSelectionMode(*pMode);
- if (!*pMode)
- {
- deselectOverlayItems();
- }
- mbInSelectionModeHdl = false;
- return 0;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 15e3b8d..b261e34 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -128,7 +128,7 @@ void TemplateLocalView::Populate ()
aRegionName += "...";
}
- TemplateLocalViewItem* pItem = new TemplateLocalViewItem( *this, this );
+ TemplateLocalViewItem* pItem = new TemplateLocalViewItem( *this );
pItem->mnId = i+1;
pItem->maTitle = aRegionName;
pItem->setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected));
@@ -224,8 +224,6 @@ void TemplateLocalView::showOverlay (bool bVisible)
}
mpItemView->Clear();
-
- setSelectionMode(mbSelectionMode);
}
}
@@ -278,7 +276,7 @@ sal_uInt16 TemplateLocalView::createRegion(const OUString &rName)
aRegionName += "...";
}
- TemplateLocalViewItem* pItem = new TemplateLocalViewItem( *this, this );
+ TemplateLocalViewItem* pItem = new TemplateLocalViewItem( *this );
pItem->mnId = nRegionId+1;
pItem->maTitle = aRegionName;
pItem->setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected));
@@ -702,7 +700,7 @@ bool TemplateLocalView::isTemplateNameUnique(const sal_uInt16 nRegionItemId, con
return true;
}
-void TemplateLocalView::OnItemClicked (ThumbnailViewItem *pRegionItem)
+void TemplateLocalView::OnItemDblClicked (ThumbnailViewItem *pRegionItem)
{
// Fill templates
sal_uInt16 nRegionId = pRegionItem->mnId-1;
@@ -711,9 +709,6 @@ void TemplateLocalView::OnItemClicked (ThumbnailViewItem *pRegionItem)
mpItemView->setName(mpDocTemplates->GetRegionName(nRegionId));
mpItemView->InsertItems(static_cast<TemplateLocalViewItem*>(pRegionItem)->maTemplates);
- if (mbSelectionMode)
- mpItemView->setSelectionMode(true);
-
mpItemView->filterItems(ViewFilter_Application(meFilterOption));
showOverlay(true);
diff --git a/sfx2/source/control/templatelocalviewitem.cxx b/sfx2/source/control/templatelocalviewitem.cxx
index 7ba1183..544b86a 100644
--- a/sfx2/source/control/templatelocalviewitem.cxx
+++ b/sfx2/source/control/templatelocalviewitem.cxx
@@ -26,8 +26,8 @@ using namespace basegfx::tools;
using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
-TemplateLocalViewItem::TemplateLocalViewItem (ThumbnailView &rView, Window *pParent)
- : ThumbnailViewItem(rView,pParent)
+TemplateLocalViewItem::TemplateLocalViewItem (ThumbnailView &rView)
+ : ThumbnailViewItem(rView)
{
}
@@ -137,9 +137,6 @@ void TemplateLocalViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *p
Color(COL_BLACK).getBColor() ) );
pProcessor->process(aSeq);
-
- if (mbMode || mbHover || mbSelected)
- mpSelectBox->Paint(maDrawArea);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templateremoteview.cxx b/sfx2/source/control/templateremoteview.cxx
index 776bab1..24ee41d 100644
--- a/sfx2/source/control/templateremoteview.cxx
+++ b/sfx2/source/control/templateremoteview.cxx
@@ -78,7 +78,7 @@ void TemplateRemoteView::Populate()
for (sal_Int32 i = 0; i < aUrls.getLength() && i < aNames.getLength(); ++i)
{
- TemplateRemoteViewItem *pItem = new TemplateRemoteViewItem(*this,this);
+ TemplateRemoteViewItem *pItem = new TemplateRemoteViewItem(*this);
pItem->mnId = i+1;
pItem->maTitle = aNames[i];
@@ -107,8 +107,6 @@ void TemplateRemoteView::showOverlay (bool bVisible)
if (!bVisible)
{
mpItemView->Clear();
-
- setSelectionMode(mbSelectionMode);
}
}
@@ -261,7 +259,7 @@ bool TemplateRemoteView::insertRepository(const OUString &rName, const OUString
return false;
}
- TemplateRemoteViewItem *pItem = new TemplateRemoteViewItem(*this,this);
+ TemplateRemoteViewItem *pItem = new TemplateRemoteViewItem(*this);
pItem->mnId = maRepositories.size()+1;
pItem->maTitle = rName;
diff --git a/sfx2/source/control/templateremoteviewitem.cxx b/sfx2/source/control/templateremoteviewitem.cxx
index cb6de5e..626786f 100644
--- a/sfx2/source/control/templateremoteviewitem.cxx
+++ b/sfx2/source/control/templateremoteviewitem.cxx
@@ -9,8 +9,8 @@
#include <sfx2/templateremoteviewitem.hxx>
-TemplateRemoteViewItem::TemplateRemoteViewItem (ThumbnailView &rView, Window *pParent)
- : ThumbnailViewItem(rView,pParent)
+TemplateRemoteViewItem::TemplateRemoteViewItem (ThumbnailView &rView)
+ : ThumbnailViewItem(rView)
{
}
diff --git a/sfx2/source/control/templatesearchview.cxx b/sfx2/source/control/templatesearchview.cxx
index 24554fb..775abbc 100644
--- a/sfx2/source/control/templatesearchview.cxx
+++ b/sfx2/source/control/templatesearchview.cxx
@@ -25,7 +25,7 @@ void TemplateSearchView::AppendItem(sal_uInt16 nItemId, sal_uInt16 nRegionId, sa
const OUString &rPath,
const BitmapEx &rImage)
{
- TemplateSearchViewItem *pItem = new TemplateSearchViewItem(*this,this);
+ TemplateSearchViewItem *pItem = new TemplateSearchViewItem(*this);
pItem->mnId = nItemId;
pItem->mnIdx = nIdx;
pItem->mnRegionId = nRegionId;
diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx
index 1156fa8..0892a15 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -108,7 +108,7 @@ void TemplateView::InsertItems (const std::vector<TemplateItemProperties> &rTemp
{
for (size_t i = 0, n = rTemplates.size(); i < n; ++i )
{
- TemplateViewItem *pItem = new TemplateViewItem(*this,this);
+ TemplateViewItem *pItem = new TemplateViewItem(*this);
const TemplateItemProperties *pCur = &rTemplates[i];
pItem->mnId = pCur->nId;
@@ -208,9 +208,9 @@ void TemplateView::MouseButtonDown (const MouseEvent &rMEvt)
ThumbnailView::MouseButtonDown(rMEvt);
}
-void TemplateView::OnItemClicked(ThumbnailViewItem *pItem)
+void TemplateView::OnItemDblClicked(ThumbnailViewItem *pItem)
{
- maClickHdl.Call(pItem);
+ maDblClickHdl.Call(pItem);
}
IMPL_LINK_NOARG(TemplateView, ChangeNameHdl)
diff --git a/sfx2/source/control/templateviewitem.cxx b/sfx2/source/control/templateviewitem.cxx
index 2c27e5f..e2abf71 100644
--- a/sfx2/source/control/templateviewitem.cxx
+++ b/sfx2/source/control/templateviewitem.cxx
@@ -27,8 +27,8 @@ using namespace basegfx::tools;
using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
-TemplateViewItem::TemplateViewItem (ThumbnailView &rView, Window *pParent)
- : ThumbnailViewItem(rView,pParent)
+TemplateViewItem::TemplateViewItem (ThumbnailView &rView)
+ : ThumbnailViewItem(rView)
{
}
@@ -136,9 +136,6 @@ void TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
}
pProcessor->process(aSeq);
-
- if (mbMode || mbHover || mbSelected)
- mpSelectBox->Paint(maDrawArea);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 32571b7..db8d626 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -98,7 +98,6 @@ void ThumbnailView::ImplInit()
mnSpacing = 0;
mbScroll = false;
mbHasVisibleItems = false;
- mbSelectionMode = false;
maFilterFunc = ViewFilterAll();
maColor = GetSettings().GetStyleSettings().GetFieldColor();
@@ -197,21 +196,7 @@ void ThumbnailView::DrawItem (ThumbnailViewItem *pItem)
}
}
-void ThumbnailView::OnSelectionMode (bool bMode)
-{
- if ( !bMode )
- deselectItems();
-
- for (size_t i = 0, n = mItemList.size(); i < n; ++i)
- {
- mItemList[i]->setSelectionMode(bMode);
-
- if (mItemList[i]->isVisible())
- DrawItem(mItemList[i]);
- }
-}
-
-void ThumbnailView::OnItemClicked (ThumbnailViewItem*)
+void ThumbnailView::OnItemDblClicked (ThumbnailViewItem*)
{
}
@@ -508,51 +493,40 @@ IMPL_LINK (ThumbnailView, OnItemSelected, ThumbnailViewItem*, pItem)
void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt )
{
- bool bProcessClick = rMEvt.IsLeft();
-
- if ( rMEvt.IsRight( ) )
- {
- // Set selection mode with right click
- if (!mbSelectionMode)
- {
- setSelectionMode( true );
- bProcessClick = true;
- }
- }
-
- if ( bProcessClick )
+ if ( rMEvt.IsLeft() )
{
ThumbnailViewItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
if (pItem && pItem->isVisible())
{
- if ( !rMEvt.IsMod2() )
+ if ( rMEvt.GetClicks() == 1 )
{
- if ( rMEvt.GetClicks() == 1 )
- {
- if (mbSelectionMode)
- {
- pItem->setSelection(!pItem->isSelected());
+ if (!pItem->isSelected() && !rMEvt.IsMod1())
+ deselectItems( );
+ pItem->setSelection(!pItem->isSelected());
- if (!pItem->isHighlighted())
- DrawItem(pItem);
+ if (!pItem->isHighlighted())
+ DrawItem(pItem);
- maItemStateHdl.Call(pItem);
- }
- else
- {
- Rectangle aRect(pItem->getDrawArea());
- aRect.SetSize(Size(mnItemWidth,mnThumbnailHeight));
+ maItemStateHdl.Call(pItem);
+ }
+ else if ( rMEvt.GetClicks() == 2 )
+ {
+ // The mouse button down event 1 click right before is pointless
+ pItem->setSelection(!pItem->isSelected());
+ maItemStateHdl.Call(pItem);
- if (!mbSelectionMode && aRect.IsInside(rMEvt.GetPosPixel()))
- OnItemClicked(pItem);
- }
- }
+ Rectangle aRect(pItem->getDrawArea());
+ aRect.SetSize(Size(mnItemWidth,mnThumbnailHeight));
+
+ if (aRect.IsInside(rMEvt.GetPosPixel()))
+ OnItemDblClicked(pItem);
}
return;
}
}
+
Control::MouseButtonDown( rMEvt );
}
@@ -561,56 +535,6 @@ void ThumbnailView::MouseButtonUp( const MouseEvent& rMEvt )
Control::MouseButtonUp( rMEvt );
}
-void ThumbnailView::MouseMove( const MouseEvent& rMEvt )
-{
- ThumbnailViewItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
-
- if (pItem)
- {
- if (mnHighItemId != pItem->mnId && pItem->isVisible())
- {
- size_t nPos = GetItemPos(mnHighItemId);
-
- if (nPos != THUMBNAILVIEW_ITEM_NOTFOUND)
- {
- ThumbnailViewItem *pOld = mItemList[nPos];
-
- pOld->setHighlight(false);
-
- if (!pOld->isSelected())
- DrawItem(pOld);
- }
-
- mnHighItemId = pItem->mnId;
- pItem->setHighlight(true);
-
- if (!pItem->isSelected())
- DrawItem(pItem);
- }
- }
- else
- {
- if (mnHighItemId)
- {
- size_t nPos = GetItemPos(mnHighItemId);
-
- if (nPos != THUMBNAILVIEW_ITEM_NOTFOUND)
- {
- ThumbnailViewItem *pOld = mItemList[nPos];
-
- pOld->setHighlight(false);
-
- if (!pOld->isSelected())
- DrawItem(pOld);
- }
-
- mnHighItemId = 0;
- }
- }
-
- Control::MouseMove( rMEvt );
-}
-
void ThumbnailView::Command( const CommandEvent& rCEvt )
{
if ( (rCEvt.GetCommand() == COMMAND_WHEEL) ||
@@ -1049,13 +973,6 @@ long ThumbnailView::GetScrollWidth() const
return 0;
}
-void ThumbnailView::setSelectionMode (bool mode)
-{
- mbSelectionMode = mode;
- OnSelectionMode(mode);
- maSelectionModeHdl.Call(&mode);
-}
-
void ThumbnailView::filterItems (const boost::function<bool (const ThumbnailViewItem*) > &func)
{
mnFirstLine = 0; // start at the top of the list instead of the current position
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 57041ce..2410922 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -41,18 +41,14 @@ using namespace ::com::sun::star;
using namespace drawinglayer::attribute;
using namespace drawinglayer::primitive2d;
-ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView, Window *pParent)
+ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView)
: mrParent(rView)
, mnId(0)
, mbVisible(true)
, mbSelected(false)
, mbHover(false)
, mpxAcc(NULL)
- , mbMode(false)
- , mpSelectBox(new CheckBox(pParent,WB_HIDE | WB_NOPOINTERFOCUS))
{
- mpSelectBox->SetSizePixel(Size(20,20));
- mpSelectBox->SetClickHdl(LINK(this,ThumbnailViewItem,OnClick));
}
ThumbnailViewItem::~ThumbnailViewItem()
@@ -62,37 +58,21 @@ ThumbnailViewItem::~ThumbnailViewItem()
static_cast< ThumbnailViewItemAcc* >( mpxAcc->get() )->ParentDestroyed();
delete mpxAcc;
}
-
- delete mpSelectBox;
}
void ThumbnailViewItem::show (bool bVisible)
{
mbVisible = bVisible;
-
- if (mbMode)
- mpSelectBox->Show(bVisible);
- else if (!bVisible)
- mpSelectBox->Show(bVisible);
- else if (mbSelected)
- mpSelectBox->Show(bVisible);
}
void ThumbnailViewItem::setSelection (bool state)
{
mbSelected = state;
- mpSelectBox->SetState(state ? STATE_CHECK : STATE_NOCHECK);
-
- if (!isHighlighted())
- mpSelectBox->Show(state);
}
void ThumbnailViewItem::setHighlight (bool state)
{
mbHover = state;
-
- if (!isSelected())
- mpSelectBox->Show(state);
}
uno::Reference< accessibility::XAccessible > ThumbnailViewItem::GetAccessible( bool bIsTransientChildrenDisabled )
@@ -131,20 +111,6 @@ void ThumbnailViewItem::calculateItemsPosition (const long nThumbnailHeight, con
aPos.Y() = aPos.Y() + aTextDev.getTextHeight() + (nDisplayHeight - aTextDev.getTextHeight())/2;
aPos.X() = maDrawArea.Left() + (aRectSize.Width() - aTextDev.getTextWidth(maTitle,0,nMaxTextLenght))/2;
maTextPos = aPos;
-
- // Calculate checkbox position
- aPos.Y() -= aTextDev.getTextHeight();
- aPos.X() = maDrawArea.Left() + 15;
-
- mpSelectBox->SetPosPixel(aPos);
-}
-
-void ThumbnailViewItem::setSelectionMode (bool mode)
-{
- mbMode = mode;
-
- if (!mbHover && !mbSelected && mbVisible)
- mpSelectBox->Show(mode);
}
void ThumbnailViewItem::setSelectClickHdl (const Link &link)
@@ -210,9 +176,6 @@ void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProc
Color(COL_BLACK).getBColor() ) );
pProcessor->process(aSeq);
-
- if (mbMode || mbHover || mbSelected)
- mpSelectBox->Paint(maDrawArea);
}
drawinglayer::primitive2d::BorderLinePrimitive2D*
@@ -223,14 +186,6 @@ ThumbnailViewItem::createBorderLine (const basegfx::B2DPoint &rStart, const base
false,STYLE_SOLID);
}
-IMPL_LINK (ThumbnailViewItem, OnClick, CheckBox*, )
-{
- mbSelected = mpSelectBox->GetState() == STATE_CHECK;
- mpSelectBox->Invalidate();
- maClickHdl.Call(this);
- return 0;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 2990440..e0ea98c 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -104,7 +104,6 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
aButtonPresents(this,SfxResId(BTN_SELECT_PRESENTATIONS)),
aButtonSheets(this,SfxResId(BTN_SELECT_SHEETS)),
aButtonDraws(this,SfxResId(BTN_SELECT_DRAWS)),
- maButtonSelMode(this,SfxResId(BTN_SELECTION_MODE)),
mpToolbars( new Control(this,SfxResId(TOOLBARS))),
mpSearchEdit(new Edit(this,WB_HIDE | WB_BORDER)),
mpViewBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_VIEW))),
@@ -114,11 +113,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
maView(new TemplateLocalView(this,SfxResId(TEMPLATE_VIEW))),
mpOnlineView(new TemplateRemoteView(this, WB_VSCROLL,false)),
mbIsSaveMode(false),
- mbInSelectionModeHdl(false),
mxDesktop(comphelper::getProcessServiceFactory()->createInstance( "com.sun.star.frame.Desktop" ),uno::UNO_QUERY )
{
- maButtonSelMode.SetStyle(maButtonSelMode.GetStyle() | WB_TOGGLE);
-
// Create popup menus
mpActionMenu = new PopupMenu;
mpActionMenu->InsertItem(MNI_ACTION_SORT_NAME,SfxResId(STR_ACTION_SORT_NAME).toString(),SfxResId(IMG_ACTION_SORT));
@@ -197,9 +193,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
maView->setItemStateHdl(LINK(this,SfxTemplateManagerDlg,TVFolderStateHdl));
maView->setOverlayItemStateHdl(LINK(this,SfxTemplateManagerDlg,TVTemplateStateHdl));
- maView->setOverlayClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl));
+ maView->setOverlayDblClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl));
maView->setOverlayCloseHdl(LINK(this,SfxTemplateManagerDlg,CloseOverlayHdl));
- maView->setSelectionModeHdl(LINK(this,SfxTemplateManagerDlg,SelectionModeHdl));
// Set online view position and dimensions
mpOnlineView->SetPosSizePixel(aViewPos,aThumbSize);
@@ -210,10 +205,9 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
TEMPLATE_ITEM_PADDING);
mpOnlineView->setOverlayItemStateHdl(LINK(this,SfxTemplateManagerDlg,TVTemplateStateHdl));
- mpOnlineView->setOverlayClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl));
+ mpOnlineView->setOverlayDblClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl));
mpOnlineView->setOverlayCloseHdl(LINK(this,SfxTemplateManagerDlg,CloseOverlayHdl));
mpOnlineView->setOverlayChangeNameHdl(LINK(this,SfxTemplateManagerDlg,RepositoryChangeNameHdl));
- mpOnlineView->setSelectionModeHdl(LINK(this,SfxTemplateManagerDlg,SelectionModeHdl));
mpSearchView->SetSizePixel(aThumbSize);
mpSearchView->setItemMaxTextLength(TEMPLATE_ITEM_MAX_TEXT_LENGTH);
@@ -223,14 +217,12 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
TEMPLATE_ITEM_PADDING);
mpSearchView->setItemStateHdl(LINK(this,SfxTemplateManagerDlg,TVTemplateStateHdl));
- mpSearchView->setSelectionModeHdl(LINK(this,SfxTemplateManagerDlg,SelectionModeHdl));
aButtonAll.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewAllHdl));
aButtonDocs.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewDocsHdl));
aButtonPresents.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewPresentsHdl));
aButtonSheets.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewSheetsHdl));
aButtonDraws.SetClickHdl(LINK(this,SfxTemplateManagerDlg,ViewDrawsHdl));
- maButtonSelMode.SetClickHdl(LINK(this,SfxTemplateManagerDlg,OnClickSelectionMode));
// Set dialog to correct dimensions
SetSizePixel(aWinSize);
@@ -350,21 +342,6 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, CloseOverlayHdl)
return 0;
}
-IMPL_LINK (SfxTemplateManagerDlg, OnClickSelectionMode, ImageButton*, pButton)
-{
- if (!mbInSelectionModeHdl)
- maView->setSelectionMode(pButton->GetState() == STATE_CHECK);
- return 0;
-}
-
-IMPL_LINK (SfxTemplateManagerDlg, SelectionModeHdl, bool*, pMode)
-{
- mbInSelectionModeHdl = true;
- maButtonSelMode.SetState( *pMode ? STATE_CHECK : STATE_NOCHECK );
- mbInSelectionModeHdl = false;
- return 0;
-}
-
IMPL_LINK_NOARG(SfxTemplateManagerDlg,TBXViewHdl)
{
switch(mpViewBar->GetCurItemId())
@@ -1221,11 +1198,10 @@ void SfxTemplateManagerDlg::centerTopButtons()
{
Point aFirstBtnPos = aButtonAll.GetPosPixel();
- Size aSelBtnSize = maButtonSelMode.GetOutputSize(); // Last button in the list
Size aBtnSize = aButtonAll.GetOutputSize();
Size aWinSize = GetOutputSize();
- long nTotalWidth = aSelBtnSize.getWidth() + aBtnSize.getWidth()*5;
+ long nTotalWidth = aBtnSize.getWidth()*5;
long nSpace = (aWinSize.getWidth() - nTotalWidth)/2;
Point aBtnPos(nSpace,aFirstBtnPos.getY());
@@ -1242,9 +1218,6 @@ void SfxTemplateManagerDlg::centerTopButtons()
aBtnPos.setX(aBtnPos.getX() + aBtnSize.getWidth());
aButtonDraws.SetPosPixel(aBtnPos);
-
- aBtnPos.setX(aBtnPos.getX() + aBtnSize.getWidth());
- maButtonSelMode.SetPosPixel(aBtnPos);
}
void SfxTemplateManagerDlg::createRepositoryMenu()
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index 61fe2b8..c0687fd 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -152,20 +152,6 @@ ModelessDialog DLG_TEMPLATE_MANAGER
Text [en-US] = "Drawings";
};
- ImageButton BTN_SELECTION_MODE
- {
- Pos = MAP_APPFONT(260,5);
- Size = MAP_APPFONT(20,14);
- TabStop = TRUE;
-
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "select.png" ; };
- };
-
- QuickHelpText [en-US] = "Enables selecting items by just clicking in the thumbnail or title.";
- };
-
Control TEMPLATE_VIEW
{
Pos = MAP_APPFONT(5,30);
diff --git a/sfx2/source/inc/templatesearchviewitem.hxx b/sfx2/source/inc/templatesearchviewitem.hxx
index 185560a..27e393d 100644
--- a/sfx2/source/inc/templatesearchviewitem.hxx
+++ b/sfx2/source/inc/templatesearchviewitem.hxx
@@ -14,8 +14,8 @@
struct TemplateSearchViewItem : public TemplateViewItem
{
- TemplateSearchViewItem (ThumbnailView &rView, Window *pParent)
- : TemplateViewItem(rView,pParent)
+ TemplateSearchViewItem (ThumbnailView &rView)
+ : TemplateViewItem(rView)
{}
virtual ~TemplateSearchViewItem ()
commit c2cd870601442520ac05b67ad59e8634fca778ef
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Thu Dec 6 13:30:12 2012 +0100
Template manager: white background for the thumbnail view
Change-Id: Ie5497713b83da23801f58f4c6d990e28042a3df9
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 582e508..15e3b8d 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -106,7 +106,7 @@ TemplateLocalView::TemplateLocalView ( Window* pParent, const ResId& rResId, boo
meFilterOption(FILTER_APP_NONE),
mpDocTemplates(new SfxDocumentTemplates)
{
- mpItemView->SetColor(Color(COL_WHITE));
+ mpItemView->SetColor(GetSettings().GetStyleSettings().GetFieldColor());
mpItemView->setChangeNameHdl(LINK(this,TemplateLocalView,ChangeNameHdl));
}
@@ -716,7 +716,7 @@ void TemplateLocalView::OnItemClicked (ThumbnailViewItem *pRegionItem)
mpItemView->filterItems(ViewFilter_Application(meFilterOption));
- mpItemView->Show();
+ showOverlay(true);
}
IMPL_LINK(TemplateLocalView, ChangeNameHdl, TemplateView*, pView)
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index e51385a..32571b7 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -100,7 +100,7 @@ void ThumbnailView::ImplInit()
mbHasVisibleItems = false;
mbSelectionMode = false;
maFilterFunc = ViewFilterAll();
- maColor = GetSettings().GetStyleSettings().GetDialogColor();
+ maColor = GetSettings().GetStyleSettings().GetFieldColor();
// Create the processor and process the primitives
const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
@@ -156,14 +156,11 @@ void ThumbnailView::ImplInitSettings( bool bFont, bool bForeground, bool bBackgr
if ( bBackground )
{
- Color aColor;
- if ( IsControlBackground() )
- aColor = GetControlBackground();
- else
- aColor = rStyleSettings.GetFaceColor();
+ Color aColor = rStyleSettings.GetFieldColor();
SetBackground( aColor );
}
+
mpItemAttrs = new ThumbnailItemAttributes;
mpItemAttrs->aFillColor = maColor.getBColor();
mpItemAttrs->aHighlightColor = rStyleSettings.GetHighlightColor().getBColor();
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index b4fb512..2990440 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -135,13 +135,6 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
Size aWinSize = GetOutputSize();
- // Calculate thumbnail view minimum size
- Size aThumbSize = maView->CalcWindowSizePixel(INIT_FOLDER_COLS,INIT_FOLDER_LINES,
- TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_MAX_HEIGHT,TEMPLATE_ITEM_SPACE);
-
- if (aWinSize.getWidth() < aThumbSize.getWidth() + 2*PADDING_DLG_BORDER)
- aWinSize.setWidth(aThumbSize.getWidth() + 2*PADDING_DLG_BORDER);
-
// Calculate toolboxs size and positions
Size aViewSize = mpViewBar->CalcMinimumWindowSizePixel();
Size aActionSize = mpActionBar->CalcMinimumWindowSizePixel();
@@ -178,8 +171,9 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
// Set view position below toolbox
Point aViewPos = maView->GetPosPixel();
aViewPos.setY(mpToolbars->GetPosPixel().Y() + mpToolbars->GetSizePixel().getHeight());
- aViewPos.setX((aWinSize.getWidth() - aThumbSize.getWidth())/2); // Center the view
- maView->SetPosPixel(aViewPos);
+ aViewPos.setX(0);
+ Size aThumbSize(aWinSize.getWidth(), aWinSize.getHeight() - aViewPos.getY());
+ maView->SetPosSizePixel(aViewPos, aThumbSize);
if (aWinSize.getHeight() < aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER)
aWinSize.setHeight(aViewPos.getY() + aThumbSize.getHeight() + PADDING_DLG_BORDER);
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index 184b216..61fe2b8 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -192,7 +192,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER
Control TOOLBARS
{
Pos = MAP_APPFONT( 0 , 22 );
- Size = MAP_APPFONT( 290 , 20 );
+ Size = MAP_APPFONT( 290 , 15 );
TabStop = False;
};
More information about the Libreoffice-commits
mailing list