[apps/shared] Re-implement Sequence cursor

This commit is contained in:
Émilie Feral
2019-09-20 12:00:51 +02:00
committed by LeaNumworks
parent 7525ee3ffc
commit ea97775f06
3 changed files with 21 additions and 0 deletions

View File

@@ -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 \

View File

@@ -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);
}
}

View File

@@ -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;
};
}