2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #include "LineStyleValueSet.hxx"
20 #include <i18nlangtag/mslangid.hxx>
23 namespace svx
{ namespace sidebar
{
25 LineStyleValueSet::LineStyleValueSet (
28 : ValueSet( pParent
, rResId
),
38 LineStyleValueSet::~LineStyleValueSet (void)
46 void LineStyleValueSet::SetFirstString(XubString str
)
54 void LineStyleValueSet::UserDraw( const UserDrawEvent
& rUDEvt
)
56 Rectangle aRect
= rUDEvt
.GetRect();
57 OutputDevice
* pDev
= rUDEvt
.GetDevice();
58 sal_uInt16 nItemId
= rUDEvt
.GetItemId();
60 long nRectHeight
= aRect
.GetHeight();
61 //Point aBLPos = aRect.TopLeft();
64 Color aOldFillColor
= pDev
->GetFillColor();
69 Color
aBackColor(50,107,197);
70 Rectangle aBackRect
= aRect
;
72 aBackRect
.Bottom() -= 2;
73 pDev
->SetFillColor(aBackColor
);
74 pDev
->DrawRect(aBackRect
);
78 pDev
->SetFillColor( COL_TRANSPARENT
);
79 pDev
->DrawRect(aRect
);
81 pDev
->SetFillColor(aOldFillColor
);
84 Font aOldFont
= pDev
->GetFont();
85 Color aOldColor
= pDev
->GetLineColor();
86 Font
aFont(OutputDevice::GetDefaultFont(
87 DEFAULTFONT_UI_SANS
, MsLangId::getSystemLanguage(), DEFAULTFONT_FLAGS_ONLYONE
));
88 Size aSize
= aFont
.GetSize();
89 aSize
.Height() = nRectHeight
*3/5;
91 aFont
.SetColor(COL_WHITE
);
93 //aFont.SetColor(COL_BLACK);
94 aFont
.SetColor(GetSettings().GetStyleSettings().GetFieldTextColor()); //high contrast
95 aFont
.SetFillColor(COL_BLUE
);
96 aFont
.SetSize( aSize
);
98 // String sText("None", 9, RTL_TEXTENCODING_ASCII_US);
100 // Point aStart(aBLPos.X() + 8 , aBLPos.Y() + nRectHeight/6);
101 Rectangle aStrRect
= aRect
;
102 aStrRect
.Top() += nRectHeight
/6;
103 aStrRect
.Bottom() -= nRectHeight
/6;
104 aStrRect
.Left() += 8;
105 pDev
->DrawText(aStrRect
, strNone
, TEXT_DRAW_ENDELLIPSIS
);
107 pDev
->SetFont(aOldFont
);
108 pDev
->SetLineColor(aOldColor
);
118 void LineStyleValueSet::SetFirstSelect(bool bSel
)
120 mbSelectFirst
= bSel
;
125 } } // end of namespace svx::sidebar