Files
Upsilon/apps/shared/scrollable_exact_approximate_expressions_view.h
Ruben Dashyan 0943406263 Fix HistoryViewCell and ScrollableExactApproximateExxpressionsCell margins issue
Remove all margins from those cells.
Rather add margins to their respective subviews:
 - ScrollableExpressionView
 - ScrollableExactApproximateExpressionsView.

As a notable consequence, the distance in HistoryViewCell between its
subviews becomes 10 instead of 5.

In passing, replace
 - Metric::HistoryHorizontalMargin = 10
 - ScrollableExactApproximateExpressionsView::k_digitHorizontalMargin = 10
 - HistoryViewCell::k_digitVerticalMargin = 5
 - ScrollableExactApproximateExpressionsCell::k_margin = 5
by
 - Metric::CommonSmallMargin = 5
 - Metric::CommonLargeMargin = 10.
2019-02-18 16:49:58 +01:00

68 lines
2.1 KiB
C++

#ifndef SHARED_SCROLLABLE_EXACT_APPROXIMATE_EXPRESSIONS_VIEW_H
#define SHARED_SCROLLABLE_EXACT_APPROXIMATE_EXPRESSIONS_VIEW_H
#include <escher.h>
namespace Shared {
class ScrollableExactApproximateExpressionsView : public ScrollableView, public ScrollViewDataSource {
public:
enum class SubviewPosition {
Left,
Right
};
ScrollableExactApproximateExpressionsView(Responder * parentResponder);
::EvenOddCell * evenOddCell() {
return &m_contentCell;
}
void setLayouts(Poincare::Layout rightlayout, Poincare::Layout leftLayout);
void setEqualMessage(I18n::Message equalSignMessage);
SubviewPosition selectedSubviewPosition() {
return m_contentCell.selectedSubviewPosition();
}
void setSelectedSubviewPosition(SubviewPosition subviewPosition) {
m_contentCell.setSelectedSubviewPosition(subviewPosition);
}
void didBecomeFirstResponder() override;
bool handleEvent(Ion::Events::Event event) override;
Poincare::Layout layout() const {
return m_contentCell.layout();
}
private:
class ContentCell : public ::EvenOddCell {
public:
ContentCell();
KDColor backgroundColor() const override;
void setHighlighted(bool highlight) override;
void reloadCell() override;
KDSize minimalSizeForOptimalDisplay() const override;
ExpressionView * rightExpressionView() {
return &m_rightExpressionView;
}
ExpressionView * leftExpressionView() {
return &m_leftExpressionView;
}
MessageTextView * approximateSign() {
return &m_approximateSign;
}
SubviewPosition selectedSubviewPosition() {
return m_selectedSubviewPosition;
}
void setSelectedSubviewPosition(SubviewPosition subviewPosition);
void layoutSubviews() override;
int numberOfSubviews() const override;
Poincare::Layout layout() const override;
private:
View * subviewAtIndex(int index) override;
ExpressionView m_rightExpressionView;
MessageTextView m_approximateSign;
ExpressionView m_leftExpressionView;
SubviewPosition m_selectedSubviewPosition;
};
ContentCell m_contentCell;
};
}
#endif