[apps/reg] Add separators in Stats

This commit is contained in:
Léa Saviot
2018-05-31 14:03:38 +02:00
parent 4470a9c51e
commit 6f71ff8a2c
16 changed files with 186 additions and 171 deletions

View File

@@ -8,6 +8,7 @@ app_objs += $(addprefix apps/shared/,\
curve_view_range.o\
editable_cell_table_view_controller.o\
expression_field_delegate_app.o\
expression_layout_field_delegate.o\
float_pair_store.o\
float_parameter_controller.o\
function.o\
@@ -32,6 +33,7 @@ app_objs += $(addprefix apps/shared/,\
language_controller.o\
list_controller.o\
list_parameter_controller.o\
margin_even_odd_message_text_cell.o\
memoized_curve_view_range.o\
message_view.o\
new_function_cell.o\
@@ -40,8 +42,8 @@ app_objs += $(addprefix apps/shared/,\
range_parameter_controller.o\
regular_table_view_data_source.o\
round_cursor_view.o\
separator_even_odd_buffer_text_cell.o\
simple_interactive_curve_view_controller.o\
expression_layout_field_delegate.o\
store_cell.o\
store_controller.o\
store_parameter_controller.o\

View File

@@ -0,0 +1,10 @@
#include "margin_even_odd_message_text_cell.h"
namespace Shared {
void MarginEvenOddMessageTextCell::layoutSubviews() {
m_messageTextView.setFrame(KDRect(bounds().topLeft(), bounds().width() - k_rightMargin, bounds().height()));
}
}

View File

@@ -0,0 +1,20 @@
#ifndef APPS_SHARED_MARGIN_EVEN_ODD_MESSAGE_TEXT_CELL_H
#define APPS_SHARED_MARGIN_EVEN_ODD_MESSAGE_TEXT_CELL_H
#include <escher/even_odd_message_text_cell.h>
namespace Shared {
class MarginEvenOddMessageTextCell : public EvenOddMessageTextCell {
public:
MarginEvenOddMessageTextCell(KDText::FontSize size = KDText::FontSize::Small) :
EvenOddMessageTextCell(size)
{}
void layoutSubviews() override;
private:
constexpr static KDCoordinate k_rightMargin = 2;
};
}
#endif

View File

@@ -0,0 +1,20 @@
#include "separator_even_odd_buffer_text_cell.h"
#include "hideable_even_odd_editable_text_cell.h"
#include <escher/metric.h>
namespace Shared {
void SeparatorEvenOddBufferTextCell::drawRect(KDContext * ctx, KDRect rect) const {
EvenOddBufferTextCell::drawRect(ctx, rect);
// Draw the separator
KDRect separatorRect(0, 0, Metric::TableSeparatorThickness, bounds().height());
ctx->fillRect(separatorRect, Shared::HideableEvenOddEditableTextCell::hideColor());
}
void SeparatorEvenOddBufferTextCell::layoutSubviews() {
KDRect boundsThis = bounds();
m_bufferTextView.setFrame(KDRect(boundsThis.left() + Metric::TableSeparatorThickness, boundsThis.top(), boundsThis.width() - Metric::TableSeparatorThickness - k_rightMargin, boundsThis.height()));
}
}

View File

@@ -0,0 +1,19 @@
#ifndef APPS_SHARED_SEPARATOR_EVEN_ODD_CELL_H
#define APPS_SHARED_SEPARATOR_EVEN_ODD_CELL_H
#include <escher/even_odd_buffer_text_cell.h>
namespace Shared {
class SeparatorEvenOddBufferTextCell : public EvenOddBufferTextCell {
public:
using EvenOddBufferTextCell::EvenOddBufferTextCell;
void drawRect(KDContext * ctx, KDRect rect) const override;
void layoutSubviews() override;
private:
constexpr static KDCoordinate k_rightMargin = 2;
};
}
#endif