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

Further cleanup style in infobar, remove basegfx namespace in code

Change-Id: I0201d87d631413fc75230535e25c8eac189ede10
üst 274f497b
...@@ -27,22 +27,23 @@ using namespace drawinglayer::processor2d; ...@@ -27,22 +27,23 @@ using namespace drawinglayer::processor2d;
using namespace drawinglayer::primitive2d; using namespace drawinglayer::primitive2d;
using namespace drawinglayer::attribute; using namespace drawinglayer::attribute;
using namespace drawinglayer::geometry; using namespace drawinglayer::geometry;
using namespace basegfx;
namespace namespace
{ {
class SfxCloseButton : public PushButton class SfxCloseButton : public PushButton
{ {
public: public:
SfxCloseButton( vcl::Window* pParent ) : PushButton( pParent, 0 ) SfxCloseButton(vcl::Window* pParent) : PushButton(pParent, 0)
{ {
} }
virtual ~SfxCloseButton( ) { } virtual ~SfxCloseButton() {}
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE; virtual void Paint(const Rectangle& rRect) SAL_OVERRIDE;
}; };
void SfxCloseButton::Paint( const Rectangle& ) void SfxCloseButton::Paint(const Rectangle&)
{ {
const ViewInformation2D aNewViewInfos; const ViewInformation2D aNewViewInfos;
const unique_ptr<BaseProcessor2D> pProcessor( const unique_ptr<BaseProcessor2D> pProcessor(
...@@ -52,42 +53,44 @@ namespace ...@@ -52,42 +53,44 @@ namespace
Primitive2DSequence aSeq(2); Primitive2DSequence aSeq(2);
basegfx::BColor aLightColor(1.0, 1.0, 191.0 / 255.0); BColor aLightColor(1.0, 1.0, 191.0 / 255.0);
basegfx::BColor aDarkColor(217.0 / 255.0, 217.0 / 255.0, 78.0 / 255.0); BColor aDarkColor(217.0 / 255.0, 217.0 / 255.0, 78.0 / 255.0);
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
if ( rSettings.GetHighContrastMode() ) if (rSettings.GetHighContrastMode())
{ {
aLightColor = rSettings.GetLightColor( ).getBColor( ); aLightColor = rSettings.GetLightColor().getBColor();
aDarkColor = rSettings.GetDialogTextColor( ).getBColor( ); aDarkColor = rSettings.GetDialogTextColor().getBColor();
} }
// Light background // Light background
basegfx::B2DPolygon aPolygon; B2DPolygon aPolygon;
aPolygon.append( basegfx::B2DPoint( aRect.Left( ), aRect.Top( ) ) ); aPolygon.append(B2DPoint(aRect.Left(), aRect.Top()));
aPolygon.append( basegfx::B2DPoint( aRect.Right( ), aRect.Top( ) ) ); aPolygon.append(B2DPoint(aRect.Right(), aRect.Top()));
aPolygon.append( basegfx::B2DPoint( aRect.Right( ), aRect.Bottom( ) ) ); aPolygon.append(B2DPoint(aRect.Right(), aRect.Bottom()));
aPolygon.append( basegfx::B2DPoint( aRect.Left( ), aRect.Bottom( ) ) ); aPolygon.append(B2DPoint(aRect.Left(), aRect.Bottom()));
aPolygon.setClosed( true ); aPolygon.setClosed(true);
PolyPolygonColorPrimitive2D* pBack = new PolyPolygonColorPrimitive2D(
basegfx::B2DPolyPolygon( aPolygon ), aLightColor ); PolyPolygonColorPrimitive2D* pBack =
new PolyPolygonColorPrimitive2D(B2DPolyPolygon(aPolygon), aLightColor);
aSeq[0] = pBack; aSeq[0] = pBack;
LineAttribute aLineAttribute(aDarkColor, 2.0); LineAttribute aLineAttribute(aDarkColor, 2.0);
// Cross // Cross
basegfx::B2DPolyPolygon aCross; B2DPolyPolygon aCross;
basegfx::B2DPolygon aLine1;
aLine1.append( basegfx::B2DPoint( aRect.Left(), aRect.Top( ) ) ); B2DPolygon aLine1;
aLine1.append( basegfx::B2DPoint( aRect.Right(), aRect.Bottom( ) ) ); aLine1.append(B2DPoint(aRect.Left(), aRect.Top()));
aCross.append( aLine1 ); aLine1.append(B2DPoint(aRect.Right(), aRect.Bottom()));
basegfx::B2DPolygon aLine2; aCross.append(aLine1);
aLine2.append( basegfx::B2DPoint( aRect.Right(), aRect.Top( ) ) );
aLine2.append( basegfx::B2DPoint( aRect.Left(), aRect.Bottom( ) ) ); B2DPolygon aLine2;
aCross.append( aLine2 ); aLine2.append(B2DPoint(aRect.Right(), aRect.Top()));
aLine2.append(B2DPoint(aRect.Left(), aRect.Bottom()));
PolyPolygonStrokePrimitive2D * pCross = aCross.append(aLine2);
PolyPolygonStrokePrimitive2D* pCross =
new PolyPolygonStrokePrimitive2D(aCross, aLineAttribute, StrokeAttribute()); new PolyPolygonStrokePrimitive2D(aCross, aLineAttribute, StrokeAttribute());
aSeq[1] = pCross; aSeq[1] = pCross;
...@@ -96,8 +99,8 @@ namespace ...@@ -96,8 +99,8 @@ namespace
} }
} }
SfxInfoBarWindow::SfxInfoBarWindow( vcl::Window* pParent, const OUString& sId, SfxInfoBarWindow::SfxInfoBarWindow(vcl::Window* pParent, const OUString& sId,
const OUString& sMessage, vector<PushButton*> aButtons ) : const OUString& sMessage, vector<PushButton*> aButtons) :
Window(pParent, 0), Window(pParent, 0),
m_sId(sId), m_sId(sId),
m_pMessage(new FixedText(this, 0)), m_pMessage(new FixedText(this, 0)),
...@@ -140,8 +143,8 @@ void SfxInfoBarWindow::Paint(const Rectangle& rPaintRect) ...@@ -140,8 +143,8 @@ void SfxInfoBarWindow::Paint(const Rectangle& rPaintRect)
Primitive2DSequence aSeq(2); Primitive2DSequence aSeq(2);
basegfx::BColor aLightColor(1.0, 1.0, 191.0 / 255.0); BColor aLightColor(1.0, 1.0, 191.0 / 255.0);
basegfx::BColor aDarkColor(217.0 / 255.0, 217.0 / 255.0, 78.0 / 255.0); BColor aDarkColor(217.0 / 255.0, 217.0 / 255.0, 78.0 / 255.0);
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
if (rSettings.GetHighContrastMode()) if (rSettings.GetHighContrastMode())
...@@ -154,25 +157,25 @@ void SfxInfoBarWindow::Paint(const Rectangle& rPaintRect) ...@@ -154,25 +157,25 @@ void SfxInfoBarWindow::Paint(const Rectangle& rPaintRect)
m_pMessage->SetBackground(Wallpaper(Color(aLightColor))); m_pMessage->SetBackground(Wallpaper(Color(aLightColor)));
// Light background // Light background
basegfx::B2DPolygon aPolygon; B2DPolygon aPolygon;
aPolygon.append( basegfx::B2DPoint( aRect.Left( ), aRect.Top( ) ) ); aPolygon.append(B2DPoint(aRect.Left(), aRect.Top()));
aPolygon.append( basegfx::B2DPoint( aRect.Right( ), aRect.Top( ) ) ); aPolygon.append(B2DPoint(aRect.Right(), aRect.Top()));
aPolygon.append( basegfx::B2DPoint( aRect.Right( ), aRect.Bottom( ) ) ); aPolygon.append(B2DPoint(aRect.Right(), aRect.Bottom()));
aPolygon.append( basegfx::B2DPoint( aRect.Left( ), aRect.Bottom( ) ) ); aPolygon.append(B2DPoint(aRect.Left(), aRect.Bottom()));
aPolygon.setClosed(true); aPolygon.setClosed(true);
PolyPolygonColorPrimitive2D* pBack = PolyPolygonColorPrimitive2D* pBack =
new PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), aLightColor); new PolyPolygonColorPrimitive2D(B2DPolyPolygon(aPolygon), aLightColor);
aSeq[0] = pBack; aSeq[0] = pBack;
LineAttribute aLineAttribute(aDarkColor, 1.0); LineAttribute aLineAttribute(aDarkColor, 1.0);
// Bottom dark line // Bottom dark line
basegfx::B2DPolygon aPolygonBottom; B2DPolygon aPolygonBottom;
aPolygonBottom.append( basegfx::B2DPoint( aRect.Left(), aRect.Bottom( ) ) ); aPolygonBottom.append(B2DPoint(aRect.Left(), aRect.Bottom()));
aPolygonBottom.append( basegfx::B2DPoint( aRect.Right(), aRect.Bottom( ) ) ); aPolygonBottom.append(B2DPoint(aRect.Right(), aRect.Bottom()));
PolygonStrokePrimitive2D * pLineBottom = PolygonStrokePrimitive2D* pLineBottom =
new PolygonStrokePrimitive2D (aPolygonBottom, aLineAttribute); new PolygonStrokePrimitive2D (aPolygonBottom, aLineAttribute);
aSeq[1] = pLineBottom; aSeq[1] = pLineBottom;
...@@ -185,7 +188,7 @@ void SfxInfoBarWindow::Paint(const Rectangle& rPaintRect) ...@@ -185,7 +188,7 @@ void SfxInfoBarWindow::Paint(const Rectangle& rPaintRect)
void SfxInfoBarWindow::Resize() void SfxInfoBarWindow::Resize()
{ {
long nWidth = GetSizePixel().getWidth(); long nWidth = GetSizePixel().getWidth();
m_pCloseBtn->SetPosSizePixel(Point( nWidth - 25, 15), Size(10, 10)); m_pCloseBtn->SetPosSizePixel(Point(nWidth - 25, 15), Size(10, 10));
// Reparent the buttons and place them on the right of the bar // Reparent the buttons and place them on the right of the bar
long nX = m_pCloseBtn->GetPosPixel().getX() - 15; long nX = m_pCloseBtn->GetPosPixel().getX() - 15;
...@@ -259,11 +262,11 @@ void SfxInfoBarContainerWindow::removeInfoBar(SfxInfoBarWindow* pInfoBar) ...@@ -259,11 +262,11 @@ void SfxInfoBarContainerWindow::removeInfoBar(SfxInfoBarWindow* pInfoBar)
long nY = 0; long nY = 0;
for (it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it) for (it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
{ {
it->SetPosPixel( Point( 0, nY ) ); it->SetPosPixel(Point(0, nY));
nY += it->GetSizePixel( ).getHeight( ); nY += it->GetSizePixel().getHeight();
} }
Size aSize = GetSizePixel( ); Size aSize = GetSizePixel();
aSize.setHeight(nY); aSize.setHeight(nY);
SetSizePixel(aSize); SetSizePixel(aSize);
......
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