diff options
Diffstat (limited to 'src/displayapp/screens/InfiniPaint.cpp')
-rw-r--r-- | src/displayapp/screens/InfiniPaint.cpp | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/src/displayapp/screens/InfiniPaint.cpp b/src/displayapp/screens/InfiniPaint.cpp index 6d1f75b8..b2f0fdfe 100644 --- a/src/displayapp/screens/InfiniPaint.cpp +++ b/src/displayapp/screens/InfiniPaint.cpp @@ -6,7 +6,7 @@ using namespace Pinetime::Applications::Screens; InfiniPaint::InfiniPaint(Pinetime::Applications::DisplayApp* app, Pinetime::Components::LittleVgl& lvgl) : Screen(app), lvgl{lvgl} { app->SetTouchMode(DisplayApp::TouchModes::Polling); - std::fill(b, b + bufferSize, LV_COLOR_WHITE); + std::fill(b, b + bufferSize, selectColor); } InfiniPaint::~InfiniPaint() { @@ -19,12 +19,44 @@ bool InfiniPaint::Refresh() { return running; } -bool InfiniPaint::OnButtonPushed() { - running = false; - return true; -} - bool InfiniPaint::OnTouchEvent(Pinetime::Applications::TouchEvents event) { + switch(event) { + case Pinetime::Applications::TouchEvents::LongTap: + switch (color) { + case 0: + selectColor = LV_COLOR_MAGENTA; + break; + case 1: + selectColor = LV_COLOR_GREEN; + break; + case 2: + selectColor = LV_COLOR_WHITE; + break; + case 3: + selectColor = LV_COLOR_RED; + break; + case 4: + selectColor = LV_COLOR_CYAN; + break; + case 5: + selectColor = LV_COLOR_YELLOW; + break; + case 6: + selectColor = LV_COLOR_BLUE; + break; + case 7: + selectColor = LV_COLOR_BLACK; + break; + + default: + color = 0; + break; + } + + std::fill(b, b + bufferSize, selectColor); + color++; + return true; + } return true; } |