Numworks Epsilon
1.4.1
Graphing Calculator Operating System
function_title_cell.cpp
Go to the documentation of this file.
1
#include "
function_title_cell.h
"
2
#include <
assert.h
>
3
4
namespace
Shared
{
5
6
FunctionTitleCell::FunctionTitleCell
(
Orientation
orientation) :
7
EvenOddCell
(),
8
m_orientation(orientation)
9
{
10
}
11
12
void
FunctionTitleCell::setColor
(
KDColor
color) {
13
m_functionColor = color;
14
reloadCell
();
15
}
16
17
void
FunctionTitleCell::drawRect
(
KDContext
* ctx,
KDRect
rect)
const
{
18
if
(
m_orientation
==
Orientation::VerticalIndicator
){
19
ctx->
fillRect
(
KDRect
(0, 0,
k_colorIndicatorThickness
,
bounds
().height()), m_functionColor);
20
}
else
{
21
ctx->
fillRect
(
KDRect
(0, 0,
bounds
().width(),
k_colorIndicatorThickness
), m_functionColor);
22
}
23
KDColor
separatorColor =
m_even
?
Palette::WallScreen
:
KDColorWhite
;
24
// Color the horizontal separator
25
ctx->
fillRect
(
KDRect
(
k_colorIndicatorThickness
,
bounds
().height()-
k_separatorThickness
,
bounds
().width()-
k_colorIndicatorThickness
,
k_separatorThickness
), separatorColor);
26
}
27
28
}
Shared
Definition:
banner_view.cpp:5
Shared::FunctionTitleCell::Orientation
Orientation
Definition:
function_title_cell.h:10
Shared::FunctionTitleCell::setColor
virtual void setColor(KDColor color)
Definition:
function_title_cell.cpp:12
Shared::FunctionTitleCell::Orientation::VerticalIndicator
Shared::FunctionTitleCell::k_colorIndicatorThickness
static constexpr KDCoordinate k_colorIndicatorThickness
Definition:
function_title_cell.h:19
Shared::FunctionTitleCell::FunctionTitleCell
FunctionTitleCell(Orientation orientation)
Definition:
function_title_cell.cpp:6
assert.h
Shared::FunctionTitleCell::drawRect
void drawRect(KDContext *ctx, KDRect rect) const override
Definition:
function_title_cell.cpp:17
KDColorWhite
constexpr KDColor KDColorWhite
Definition:
color.h:42
KDContext
Definition:
context.h:8
function_title_cell.h
Shared::FunctionTitleCell::k_separatorThickness
static constexpr KDCoordinate k_separatorThickness
Definition:
function_title_cell.h:18
Palette::WallScreen
static constexpr KDColor WallScreen
Definition:
palette.h:19
Shared::FunctionTitleCell::m_orientation
Orientation m_orientation
Definition:
function_title_cell.h:20
KDRect
Definition:
rect.h:26
KDContext::fillRect
void fillRect(KDRect rect, KDColor color)
Definition:
context_rect.cpp:8
KDColor
Definition:
color.h:6
EvenOddCell::m_even
bool m_even
Definition:
even_odd_cell.h:13
EvenOddCell
Definition:
even_odd_cell.h:6
HighlightCell::reloadCell
virtual void reloadCell()
Definition:
highlight_cell.cpp:16
View::bounds
KDRect bounds() const
Definition:
view.cpp:157
epsilon
apps
shared
function_title_cell.cpp
Generated by
1.8.14