Kaydet (Commit) 571e597b authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

refactor LineWidthControl to use RenderContext

Change-Id: I5ca1a367c4eba0a2f39c2aa9702e3d3bd5b2477f
üst 6e434941
......@@ -83,27 +83,25 @@ void LineWidthControl::Paint(vcl::RenderContext& rRenderContext, const Rectangle
{
svx::sidebar::PopupControl::Paint(rRenderContext, rect);
Color aOldLineColor = GetLineColor();
Color aOldFillColor = GetFillColor();
rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
Point aPos( LogicToPixel( Point( CUSTOM_X, CUSTOM_Y), MAP_APPFONT ));
Size aSize( LogicToPixel( Size( CUSTOM_W, CUSTOM_H ), MAP_APPFONT ));
Rectangle aRect( aPos, aSize );
Point aPos(rRenderContext.LogicToPixel(Point(CUSTOM_X, CUSTOM_Y), MAP_APPFONT));
Size aSize(rRenderContext.LogicToPixel(Size(CUSTOM_W, CUSTOM_H), MAP_APPFONT));
Rectangle aRect(aPos, aSize);
aRect.Left() -= 1;
aRect.Top() -= 1;
aRect.Right() += 1;
aRect.Bottom() += 1;
Color aLineColor(189,201,219);
if(!GetSettings().GetStyleSettings().GetHighContrastMode())
SetLineColor(aLineColor);
Color aLineColor(189, 201, 219);
if (!GetSettings().GetStyleSettings().GetHighContrastMode())
rRenderContext.SetLineColor(aLineColor);
else
SetLineColor(GetSettings().GetStyleSettings().GetShadowColor());
SetFillColor(COL_TRANSPARENT);
DrawRect(aRect);
rRenderContext.SetLineColor(GetSettings().GetStyleSettings().GetShadowColor());
rRenderContext.SetFillColor(COL_TRANSPARENT);
rRenderContext.DrawRect(aRect);
SetLineColor(aOldLineColor);
SetFillColor(aOldFillColor);
rRenderContext.Pop();
}
......
......@@ -32,8 +32,7 @@ namespace svx { namespace sidebar {
class LinePropertyPanel;
class LineWidthControl
: public svx::sidebar::PopupControl
class LineWidthControl : public svx::sidebar::PopupControl
{
public:
LineWidthControl (vcl::Window* pParent, LinePropertyPanel& rPanel);
......@@ -41,30 +40,36 @@ public:
virtual void dispose() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rect) SAL_OVERRIDE;
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& aRect) SAL_OVERRIDE;
void SetWidthSelect( long lValue, bool bValuable, SfxMapUnit eMapUnit);
bool IsCloseByEdit() { return mbCloseByEdit;}
long GetTmpCustomWidth() { return mnTmpCustomWidth;}
bool IsCloseByEdit()
{
return mbCloseByEdit;
}
long GetTmpCustomWidth()
{
return mnTmpCustomWidth;
}
private:
LinePropertyPanel& mrLinePropertyPanel;
SfxBindings* mpBindings;
VclPtr<LineWidthValueSet> maVSWidth;
VclPtr<FixedText> maFTCus;
VclPtr<FixedText> maFTWidth;
VclPtr<MetricField> maMFWidth;
SfxMapUnit meMapUnit;
OUString* rStr;
OUString mstrPT;
long mnCustomWidth;
bool mbCustom;
bool mbCloseByEdit;
long mnTmpCustomWidth;
bool mbVSFocus;
LinePropertyPanel& mrLinePropertyPanel;
SfxBindings* mpBindings;
VclPtr<LineWidthValueSet> maVSWidth;
VclPtr<FixedText> maFTCus;
VclPtr<FixedText> maFTWidth;
VclPtr<MetricField> maMFWidth;
SfxMapUnit meMapUnit;
OUString* rStr;
OUString mstrPT;
long mnCustomWidth;
bool mbCustom;
bool mbCloseByEdit;
long mnTmpCustomWidth;
bool mbVSFocus;
Image maIMGCus;
Image maIMGCusGray;
Image maIMGCus;
Image maIMGCusGray;
void Initialize();
DECL_LINK(VSSelectHdl, void *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment