Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfwl_comboboxtp.cpp
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "xfa/fwl/theme/cfwl_comboboxtp.h"
8
9#include "xfa/fgas/graphics/cfgas_gecolor.h"
10#include "xfa/fgas/graphics/cfgas_gepath.h"
11#include "xfa/fwl/cfwl_combobox.h"
12#include "xfa/fwl/cfwl_themebackground.h"
13#include "xfa/fwl/cfwl_widget.h"
14#include "xfa/fwl/ifwl_themeprovider.h"
15
16CFWL_ComboBoxTP::CFWL_ComboBoxTP() = default;
17
18CFWL_ComboBoxTP::~CFWL_ComboBoxTP() = default;
19
20void CFWL_ComboBoxTP::DrawBackground(const CFWL_ThemeBackground& pParams) {
21 switch (pParams.GetPart()) {
23 DrawBorder(pParams.GetGraphics(), pParams.m_PartRect, pParams.m_matrix);
24 break;
25 }
27 CFGAS_GEPath path;
28 const CFX_RectF& rect = pParams.m_PartRect;
29 path.AddRectangle(rect.left, rect.top, rect.width, rect.height);
30 FX_ARGB argb_color;
31 if (pParams.m_dwStates & CFWL_PartState::kSelected)
32 argb_color = FWLTHEME_COLOR_BKSelected;
33 else if (pParams.m_dwStates & CFWL_PartState::kDisabled)
34 argb_color = FWLTHEME_COLOR_EDGERB1;
35 else
36 argb_color = 0xFFFFFFFF;
37
42 break;
43 }
47 pParams.m_matrix);
48 break;
49 }
50 default:
51 break;
52 }
53}
CFWL_PartState
FWLTHEME_DIRECTION
Definition cfwl_utils.h:17
#define FWLTHEME_COLOR_BKSelected
Definition cfwl_utils.h:21
#define FWLTHEME_COLOR_EDGERB1
Definition cfwl_utils.h:19
CFGAS_GEColor(const FX_ARGB argb)
StateRestorer(CFGAS_GEGraphics *graphics)
void FillPath(const CFGAS_GEPath &path, CFX_FillRenderOptions::FillType fill_type, const CFX_Matrix &matrix)
void SetFillColor(const CFGAS_GEColor &color)
void AddRectangle(float left, float top, float width, float height)
void DrawBackground(const CFWL_ThemeBackground &pParams) override
~CFWL_ComboBoxTP() override
CFGAS_GEGraphics * GetGraphics() const
CFX_RectF m_PartRect
FWLTHEME_STATE GetThemeState() const
CFX_Matrix m_matrix
Part GetPart() const
void DrawBorder(CFGAS_GEGraphics *pGraphics, const CFX_RectF &rect, const CFX_Matrix &matrix)
void DrawArrowBtn(CFGAS_GEGraphics *pGraphics, const CFX_RectF &rect, FWLTHEME_DIRECTION eDict, FWLTHEME_STATE eState, const CFX_Matrix &matrix)