Files
Upsilon/apps/shared/function_title_cell.h
Léa Saviot ff33ad3ad1 [apps] In FunctionTitleCell, draw the equal separately
This way, we can better manage the margins around the equal
2019-01-10 11:42:02 +01:00

39 lines
1.0 KiB
C++

#ifndef SHARED_FUNCTION_TITLE_CELL_H
#define SHARED_FUNCTION_TITLE_CELL_H
#include <escher.h>
namespace Shared {
class FunctionTitleCell : public EvenOddCell {
public:
enum class Orientation {
HorizontalIndicator,
VerticalIndicator
};
FunctionTitleCell(Orientation orientation = Orientation::VerticalIndicator) :
EvenOddCell(),
m_orientation(orientation),
m_baseline(-1),
m_functionColor(KDColorBlack)
{}
virtual void setOrientation(Orientation orientation);
virtual void setColor(KDColor color);
void drawRect(KDContext * ctx, KDRect rect) const override;
void setBaseline(KDCoordinate baseline);
virtual const KDFont * font() const = 0;
protected:
constexpr static KDCoordinate k_separatorThickness = 1;
constexpr static KDCoordinate k_colorIndicatorThickness = 2;
KDRect subviewFrame() const;
Orientation m_orientation;
KDCoordinate m_baseline;
private:
constexpr static KDCoordinate k_equalWidthWithMargins = 10; // Ad hoc value
KDColor m_functionColor;
};
}
#endif