diff --git a/apps/shared/Makefile b/apps/shared/Makefile index c2acae4d3..70ca29a36 100644 --- a/apps/shared/Makefile +++ b/apps/shared/Makefile @@ -19,6 +19,7 @@ app_shared_src = $(addprefix apps/shared/,\ buffer_function_title_cell.cpp \ buffer_text_view_with_text_field.cpp \ button_with_separator.cpp \ + cursor_view.cpp \ curve_view.cpp \ curve_view_cursor.cpp \ editable_cell_table_view_controller.cpp \ diff --git a/apps/shared/cursor_view.cpp b/apps/shared/cursor_view.cpp new file mode 100644 index 000000000..792606be7 --- /dev/null +++ b/apps/shared/cursor_view.cpp @@ -0,0 +1,16 @@ +#include "cursor_view.h" + +namespace Shared { + +void CursorView::drawRect(KDContext * ctx, KDRect rect) const { + KDCoordinate width = bounds().width(); + KDCoordinate height = bounds().height(); + ctx->fillRect(KDRect((width-1)/2, 0, 1, height), KDColorBlack); + ctx->fillRect(KDRect(0, (height-1)/2, width, 1), KDColorBlack); +} + +KDSize CursorView::minimalSizeForOptimalDisplay() const { + return KDSize(k_size, k_size); +} + +} diff --git a/apps/shared/cursor_view.h b/apps/shared/cursor_view.h index 600ae8ca1..f0b662954 100644 --- a/apps/shared/cursor_view.h +++ b/apps/shared/cursor_view.h @@ -8,6 +8,10 @@ namespace Shared { class CursorView : public View { public: virtual void setCursorFrame(KDRect frame) { View::setFrame(frame); } + void drawRect(KDContext * ctx, KDRect rect) const override; + KDSize minimalSizeForOptimalDisplay() const override; +private: + constexpr static KDCoordinate k_size = 19; }; }