mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps/shared] Re-implement Sequence cursor
This commit is contained in:
committed by
LeaNumworks
parent
7525ee3ffc
commit
ea97775f06
@@ -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 \
|
||||
|
||||
16
apps/shared/cursor_view.cpp
Normal file
16
apps/shared/cursor_view.cpp
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user