Files
Upsilon/apps/probability/cell.h
Émilie Feral 2e16365100 [escher] Reorganize all cells'name and factorize their layouts
Change-Id: I69900ee98ff6a6868f96d70a0e335a589ef16c3f
2017-02-20 10:54:02 +01:00

35 lines
956 B
C++

#ifndef APPS_PROBABILITY_CELL_H
#define APPS_PROBABILITY_CELL_H
#include <escher.h>
namespace Probability {
class Cell : public HighlightCell {
public:
Cell();
void reloadCell() override;
void setLabel(const char * text);
void setImage(const Image * image, const Image * focusedImage);
void drawRect(KDContext * ctx, KDRect rect) const override;
private:
constexpr static KDCoordinate k_iconWidth = 35;
constexpr static KDCoordinate k_iconHeight = 19;
constexpr static KDCoordinate k_iconMargin = 10;
constexpr static KDCoordinate k_chevronWidth = 20+8;
int numberOfSubviews() const override;
View * subviewAtIndex(int index) override;
void layoutSubviews() override;
PointerTextView m_labelView;
ImageView m_iconView;
/* TODO: One day, we would rather store a mask (8bits/pixel) instead of two
* images (16bits/pixels)*/
const Image * m_icon;
const Image * m_focusedIcon;
ChevronView m_chevronView;
};
}
#endif