[escher] create a class chevron menu cell

Change-Id: Iab33c039527a4dac40cda1d657507d6656b40311
This commit is contained in:
Émilie Feral
2016-11-08 15:18:59 +01:00
parent 57228a074c
commit 3090b06956
4 changed files with 34 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ objs += $(addprefix escher/src/,\
app.o\
buffer_text_view.o\
button.o\
chevron_menu_list_cell.o\
chevron_view.o\
container.o\
even_odd_cell.o\

View File

@@ -4,6 +4,7 @@
#include <escher/app.h>
#include <escher/buffer_text_view.h>
#include <escher/button.h>
#include <escher/chevron_menu_list_cell.h>
#include <escher/chevron_view.h>
#include <escher/container.h>
#include <escher/even_odd_cell.h>

View File

@@ -0,0 +1,16 @@
#ifndef ESCHER_CHEVRON_MENU_LIST_CELL_H
#define ESCHER_CHEVRON_MENU_LIST_CELL_H
#include <escher/menu_list_cell.h>
#include <escher/chevron_view.h>
class ChevronMenuListCell : public MenuListCell {
public:
ChevronMenuListCell(char * label = nullptr);
View * contentView() const override;
void reloadCell() override;
private:
ChevronView m_contentView;
};
#endif

View File

@@ -0,0 +1,16 @@
#include <escher/chevron_menu_list_cell.h>
ChevronMenuListCell::ChevronMenuListCell(char * label) :
MenuListCell(label),
m_contentView(ChevronView())
{
}
View * ChevronMenuListCell::contentView() const {
return (View *)&m_contentView;
}
void ChevronMenuListCell::reloadCell() {
MenuListCell::reloadCell();
m_contentView.setHighlighted(isHighlighted());
}