forked from RedGl0w/atomic
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathatomic_cell.h
More file actions
34 lines (27 loc) · 833 Bytes
/
atomic_cell.h
File metadata and controls
34 lines (27 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef ATOMIC_CELL_H
#define ATOMIC_CELL_H
#include <escher.h>
#include "atoms.h"
namespace Atomic {
class AtomicCell : public HighlightCell {
public:
AtomicCell();
void drawRect(KDContext * ctx, KDRect rect) const override;
int numberOfSubviews() const override;
View * subviewAtIndex(int index) override;
void layoutSubviews(bool force = false) override;
void setVisible(bool visible);
void setAtom(AtomDef atom);
void reloadCell() override;
private:
static constexpr KDCoordinate k_iconMargin = 22;
static constexpr KDCoordinate k_iconWidth = 55;
static constexpr KDCoordinate k_iconHeight = 56;
static constexpr KDCoordinate k_nameWidthMargin = 4;
static constexpr KDCoordinate k_nameHeightMargin = 1;
bool m_visible;
AtomDef m_atom;
KDColor colorForType(AtomType type) const;
};
}
#endif