[apps/shared] HideableEvenOddCell

This commit is contained in:
Léa Saviot
2018-05-28 11:44:10 +02:00
parent 452957caf6
commit fae5659bee
3 changed files with 41 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ app_objs += $(addprefix apps/shared/,\
function_expression_cell.o\
function_title_cell.o\
go_to_parameter_controller.o\
hideable_even_odd_cell.o\
hideable_even_odd_editable_text_cell.o\
initialisation_parameter_controller.o\
interactive_curve_view_controller.o\

View File

@@ -0,0 +1,19 @@
#include "hideable_even_odd_cell.h"
namespace Shared {
KDColor HideableEvenOddCell::backgroundColor() const {
if (hidden()) {
return hideColor();
}
return EvenOddCell::backgroundColor();
}
void HideableEvenOddCell::setHide(bool hide) {
if (hidden() != hide) {
Hideable::setHide(hide);
reloadCell();
}
}
}

View File

@@ -0,0 +1,21 @@
#ifndef APPS_SHARED_HIDEABLE_EVEN_ODD_CELL_H
#define APPS_SHARED_HIDEABLE_EVEN_ODD_CELL_H
#include <escher/even_odd_cell.h>
#include "hideable.h"
namespace Shared {
class HideableEvenOddCell : public EvenOddCell, public Hideable {
public:
HideableEvenOddCell() :
EvenOddCell(),
Hideable()
{}
KDColor backgroundColor() const override;
void setHide(bool hide) override;
};
}
#endif