diff --git a/apps/shared/Makefile b/apps/shared/Makefile index 1187839ce..a07fccbc5 100644 --- a/apps/shared/Makefile +++ b/apps/shared/Makefile @@ -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\ diff --git a/apps/shared/hideable_even_odd_cell.cpp b/apps/shared/hideable_even_odd_cell.cpp new file mode 100644 index 000000000..7561bd4bf --- /dev/null +++ b/apps/shared/hideable_even_odd_cell.cpp @@ -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(); + } +} + +} diff --git a/apps/shared/hideable_even_odd_cell.h b/apps/shared/hideable_even_odd_cell.h new file mode 100644 index 000000000..ccb6b6e33 --- /dev/null +++ b/apps/shared/hideable_even_odd_cell.h @@ -0,0 +1,21 @@ +#ifndef APPS_SHARED_HIDEABLE_EVEN_ODD_CELL_H +#define APPS_SHARED_HIDEABLE_EVEN_ODD_CELL_H + +#include +#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