7#include "xfa/fwl/theme/cfwl_pushbuttontp.h"
9#include "xfa/fgas/graphics/cfgas_gecolor.h"
10#include "xfa/fgas/graphics/cfgas_gegraphics.h"
11#include "xfa/fgas/graphics/cfgas_gepath.h"
12#include "xfa/fwl/cfwl_pushbutton.h"
13#include "xfa/fwl/cfwl_themebackground.h"
14#include "xfa/fwl/cfwl_widget.h"
15#include "xfa/fwl/ifwl_themeprovider.h"
19constexpr float kPushbuttonSizeCorner = 2.0f;
23CFWL_PushButtonTP::CFWL_PushButtonTP() : m_pThemeData(
new PBThemeData) {
40 CFGAS_GEPath strokePath;
42 CFX_PointF(rect
.left + kPushbuttonSizeCorner, rect
.top)
);
43 strokePath
.LineTo(CFX_PointF(fRight - kPushbuttonSizeCorner, rect
.top)
);
44 strokePath
.LineTo(CFX_PointF(fRight, rect
.top + kPushbuttonSizeCorner)
);
45 strokePath
.LineTo(CFX_PointF(fRight, fBottom - kPushbuttonSizeCorner)
);
46 strokePath
.LineTo(CFX_PointF(fRight - kPushbuttonSizeCorner, fBottom)
);
47 strokePath
.LineTo(CFX_PointF(rect
.left + kPushbuttonSizeCorner, fBottom)
);
48 strokePath
.LineTo(CFX_PointF(rect
.left, fBottom - kPushbuttonSizeCorner)
);
50 CFX_PointF(rect
.left, rect
.top + kPushbuttonSizeCorner)
);
52 CFX_PointF(rect
.left + kPushbuttonSizeCorner, rect
.top)
);
54 CFGAS_GEPath fillPath;
60 rtInner
.Deflate(kPushbuttonSizeCorner + 1
, kPushbuttonSizeCorner + 1
,
61 kPushbuttonSizeCorner
, kPushbuttonSizeCorner
);
65 int32_t iColor = GetColorID(pParams.m_dwStates);
66 FillSolidRect(pGraphics, m_pThemeData->clrEnd[iColor], rect,
69 pGraphics->SetStrokeColor(CFGAS_GEColor(m_pThemeData->clrBorder[iColor]));
76 pGraphics->SetFillColor(CFGAS_GEColor(m_pThemeData->clrFill[iColor]));
90void CFWL_PushButtonTP::SetThemeData() {
91 m_pThemeData->clrBorder[0] = ArgbEncode(255, 0, 60, 116);
92 m_pThemeData->clrBorder[1] = ArgbEncode(255, 0, 60, 116);
93 m_pThemeData->clrBorder[2] = ArgbEncode(255, 0, 60, 116);
94 m_pThemeData->clrBorder[3] = ArgbEncode(255, 0, 60, 116);
95 m_pThemeData->clrBorder[4] = ArgbEncode(255, 201, 199, 186);
96 m_pThemeData->clrStart[0] = ArgbEncode(255, 255, 255, 255);
97 m_pThemeData->clrStart[1] = ArgbEncode(255, 209, 204, 193);
98 m_pThemeData->clrStart[2] = ArgbEncode(255, 255, 240, 207);
99 m_pThemeData->clrStart[3] = ArgbEncode(255, 206, 231, 255);
100 m_pThemeData->clrStart[4] = ArgbEncode(255, 245, 244, 234);
101 m_pThemeData->clrEnd[0] = ArgbEncode(255, 214, 208, 197);
102 m_pThemeData->clrEnd[1] = ArgbEncode(255, 242, 241, 238);
103 m_pThemeData->clrEnd[2] = ArgbEncode(255, 229, 151, 0);
104 m_pThemeData->clrEnd[3] = ArgbEncode(255, 105, 130, 238);
105 m_pThemeData->clrEnd[4] = ArgbEncode(255, 245, 244, 234);
106 m_pThemeData->clrFill[0] = ArgbEncode(255, 255, 255, 255);
107 m_pThemeData->clrFill[1] = ArgbEncode(255, 226, 225, 218);
108 m_pThemeData->clrFill[2] = ArgbEncode(255, 255, 255, 255);
109 m_pThemeData->clrFill[3] = ArgbEncode(255, 255, 255, 255);
110 m_pThemeData->clrFill[4] = ArgbEncode(255, 245, 244, 234);
StateRestorer(CFGAS_GEGraphics *graphics)
void FillPath(const CFGAS_GEPath &path, CFX_FillRenderOptions::FillType fill_type, const CFX_Matrix &matrix)
void StrokePath(const CFGAS_GEPath &path, const CFX_Matrix &matrix)
void MoveTo(const CFX_PointF &point)
void AddRectangle(float left, float top, float width, float height)
void LineTo(const CFX_PointF &point)
void AddSubpath(const CFGAS_GEPath &path)
CFGAS_GEGraphics * GetGraphics() const
CFX_RectF(const CFX_RectF &other)=default
void Inflate(float off_left, float off_top, float off_right, float off_bottom)
void Deflate(float off_left, float off_top, float off_right, float off_bottom)