diff options
| author | JF <jf@codingfield.com> | 2021-04-21 18:19:57 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2021-04-21 18:19:57 (GMT) |
| commit | a80e782f267cd2424d22da23d809c0c6a8ff8761 (patch) | |
| tree | ca2bdb100ea98d361296a61352679f63a507f955 /src/displayapp/screens/InfiniPaint.cpp | |
| parent | 24d3eea4fba05d774ace794eb8c9b21b8f2aa8c6 (diff) | |
| parent | fefb429fb4bf1020553900d9e514d3baa9040325 (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/displayapp/screens/InfiniPaint.cpp')
| -rw-r--r-- | src/displayapp/screens/InfiniPaint.cpp | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/src/displayapp/screens/InfiniPaint.cpp b/src/displayapp/screens/InfiniPaint.cpp index 6d1f75b..b6a7e3e 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,46 @@ 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; + default: + return true; + } return true; } |
