diff options
| author | Joaquim <joaquim.org@gmail.com> | 2021-04-04 02:08:51 (GMT) |
|---|---|---|
| committer | Joaquim <joaquim.org@gmail.com> | 2021-04-04 02:08:51 (GMT) |
| commit | 1d3742e14f09316a1d795527713eb8f9742f0ffb (patch) | |
| tree | 6bc6343538506b68256aa057121e063d22f8ed1a /src/displayapp/screens/InfiniPaint.cpp | |
| parent | 58a2d000c4d49d96121894d6dd6bb861d7564bea (diff) | |
Big UI and navigation Rewrite
new navigation
add some color to the apps
redesign menus
new settings menu
new quick settings
code clean up
size reduction by converting navigation images to font
and more...
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 6d1f75b..b2f0fdf 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; } |
