Files
Upsilon/escher/include/escher/scroll_view_indicator.h
Émilie Feral 8eefe8e490 [escher] Improve scroll indicator render
Change-Id: I22fa1035ba33d2cadfc68fa6727fbaecdadd4efe
2017-01-27 11:52:02 +01:00

35 lines
864 B
C++

#ifndef ESCHER_SCROLL_VIEW_INDICATOR_H
#define ESCHER_SCROLL_VIEW_INDICATOR_H
#include <escher/view.h>
class ScrollViewIndicator : public View {
public:
enum class Direction {
Horizontal,
Vertical
};
ScrollViewIndicator(Direction direction, KDColor indicatorColor, KDColor backgroundColor, KDCoordinate margin);
void drawRect(KDContext * ctx, KDRect rect) const override;
float start() const;
void setStart(float start);
float end() const;
void setEnd(float end);
protected:
#if ESCHER_VIEW_LOGGING
virtual const char * className() const override;
virtual void logAttributes(std::ostream &os) const override;
#endif
private:
constexpr static KDCoordinate k_indicatorThickness = 4;
Direction m_direction;
float m_start;
float m_end;
KDColor m_indicatorColor;
KDColor m_backgroundColor;
KDCoordinate m_margin;
};
#endif