summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-03 12:37:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-03 12:48:21 +0100
commit491bb212fae98c93197401cbd10aff8e24dc541f (patch)
tree65eb3483327fcde068f4543140af1c648dd0d8db
parentc98e1b127be779cbe9b388afa043f8d3c8798183 (diff)
allow changing the fill color user for tab previews
Change-Id: Ie20e900fe9e1f9bfdcd5784b380aa4574d52c001
-rw-r--r--cui/source/tabpages/tabstpge.cxx8
-rw-r--r--include/svtools/ruler.hxx2
-rw-r--r--svtools/source/control/ruler.cxx7
-rw-r--r--svx/source/dialog/svxruler.cxx3
4 files changed, 11 insertions, 9 deletions
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 0426c3b8a62f..b620af14f0f6 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -45,7 +45,9 @@ private:
public:
TabWin_Impl( Window* pParent, WinBits nBits) :
- Window( pParent, nBits ){}
+ Window( pParent, nBits )
+ {
+ }
virtual void Paint( const Rectangle& rRect );
@@ -55,7 +57,7 @@ public:
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeTabWin_Impl(Window *pParent, VclBuilder::stringmap &)
{
- return new TabWin_Impl(pParent, WB_BORDER);
+ return new TabWin_Impl(pParent, 0);
}
// static ----------------------------------------------------------------
@@ -87,7 +89,7 @@ void TabWin_Impl::Paint( const Rectangle& )
Size aSize = GetOutputSizePixel();
aPnt.X() = aSize.Width() / 2;
aPnt.Y() = aSize.Height() / 2;
- Ruler::DrawTab( this, aPnt, nTabStyle );
+ Ruler::DrawTab( this, GetSettings().GetStyleSettings().GetFontColor(), aPnt, nTabStyle );
}
// class SvxTabulatorTabPage ---------------------------------------------
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index 5a457103cea0..bee6f05d91b5 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -767,7 +767,7 @@ public:
sal_uInt16 GetTabCount() const;
const RulerTab* GetTabs() const;
- static void DrawTab( OutputDevice* pDevice,
+ static void DrawTab( OutputDevice* pDevice, const Color &rFillColor,
const Point& rPos, sal_uInt16 nStyle );
void SetStyle( WinBits nStyle );
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 7e5e2f17585d..0a683692be2a 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -2746,15 +2746,14 @@ void Ruler::SetStyle( WinBits nStyle )
// -----------------------------------------------------------------------
-void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, sal_uInt16 nStyle )
+void Ruler::DrawTab( OutputDevice* pDevice, const Color &rFillColor, const Point& rPos, sal_uInt16 nStyle )
{
- /*const StyleSettings& rStyleSettings =*/ pDevice->GetSettings().GetStyleSettings();
Point aPos( rPos );
- sal_uInt16 nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL);
+ sal_uInt16 nTabStyle = nStyle & (RULER_TAB_STYLE | RULER_TAB_RTL);
pDevice->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
pDevice->SetLineColor();
- pDevice->SetFillColor( pDevice->GetSettings().GetStyleSettings().GetShadowColor() );
+ pDevice->SetFillColor(rFillColor);
ImplCenterTabPos( aPos, nTabStyle );
ImplDrawRulerTab( pDevice, aPos, nTabStyle, nStyle );
pDevice->Pop();
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index e8fd30c46d88..b878b3b7ed51 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -3571,13 +3571,14 @@ void SvxRuler::Command( const CommandEvent& rCEvt )
const Size aSz(RULER_TAB_WIDTH+2, RULER_TAB_HEIGHT+2);
aDev.SetOutputSize(aSz);
aDev.SetBackground(Wallpaper(Color(COL_WHITE)));
+ Color aFillColor(aDev.GetSettings().GetStyleSettings().GetShadowColor());
const Point aPt(aSz.Width() / 2, aSz.Height() / 2);
for ( sal_uInt16 i = RULER_TAB_LEFT; i < RULER_TAB_DEFAULT; ++i )
{
sal_uInt16 nStyle = bRTL ? i|RULER_TAB_RTL : i;
nStyle |= (sal_uInt16)(bHorz ? WB_HORZ : WB_VERT);
- DrawTab(&aDev, aPt, nStyle);
+ DrawTab(&aDev, aFillColor, aPt, nStyle);
aMenu.InsertItem(i+1,
String(ResId(RID_SVXSTR_RULER_START+i, DIALOG_MGR())),
Image(aDev.GetBitmap(Point(), aSz), Color(COL_WHITE)));