diff options
| author | JF002 <JF002@users.noreply.github.com> | 2021-04-26 19:10:11 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-26 19:10:11 (GMT) |
| commit | 4706c99db4c1e05f9dd90f152f2dea08d8f22ab2 (patch) | |
| tree | cf2bea6d67e8d91a7d6222b8e0b55a0075575003 /src/displayapp/screens/DropDownDemo.cpp | |
| parent | e56ebb8bd621cc8838e86fa032d680a6e7a35ffc (diff) | |
| parent | 69898545193a82f7d72c9f47c9d9de36167b157b (diff) | |
Merge pull request #293 from Avamander/patch-5
Reformatted all the files according to clang-format style
Diffstat (limited to 'src/displayapp/screens/DropDownDemo.cpp')
| -rw-r--r-- | src/displayapp/screens/DropDownDemo.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/displayapp/screens/DropDownDemo.cpp b/src/displayapp/screens/DropDownDemo.cpp index c3ec5d7..9043c20 100644 --- a/src/displayapp/screens/DropDownDemo.cpp +++ b/src/displayapp/screens/DropDownDemo.cpp @@ -5,20 +5,21 @@ using namespace Pinetime::Applications::Screens; -DropDownDemo::DropDownDemo(Pinetime::Applications::DisplayApp *app) : Screen(app) { +DropDownDemo::DropDownDemo(Pinetime::Applications::DisplayApp* app) : Screen(app) { // Create the dropdown object, with many item, and fix its height ddlist = lv_ddlist_create(lv_scr_act(), nullptr); - lv_ddlist_set_options(ddlist, "Apple\n" - "Banana\n" - "Orange\n" - "Melon\n" - "Grape\n" - "Raspberry\n" - "A\n" - "B\n" - "C\n" - "D\n" - "E"); + lv_ddlist_set_options(ddlist, + "Apple\n" + "Banana\n" + "Orange\n" + "Melon\n" + "Grape\n" + "Raspberry\n" + "A\n" + "B\n" + "C\n" + "D\n" + "E"); lv_ddlist_set_fix_width(ddlist, 150); lv_ddlist_set_draw_arrow(ddlist, true); lv_ddlist_set_fix_height(ddlist, 150); @@ -32,12 +33,12 @@ DropDownDemo::~DropDownDemo() { } bool DropDownDemo::Refresh() { - auto* list = static_cast<lv_ddlist_ext_t *>(ddlist->ext_attr); + auto* list = static_cast<lv_ddlist_ext_t*>(ddlist->ext_attr); // Switch touchmode to Polling if the dropdown is opened. This will allow to scroll inside the // dropdown while it is opened. // Disable the polling mode when the dropdown is closed to be able to handle the gestures. - if(list->opened) + if (list->opened) app->SetTouchMode(DisplayApp::TouchModes::Polling); else app->SetTouchMode(DisplayApp::TouchModes::Gestures); @@ -47,11 +48,10 @@ bool DropDownDemo::Refresh() { bool DropDownDemo::OnTouchEvent(Pinetime::Applications::TouchEvents event) { // If the dropdown is opened, notify Display app that it doesn't need to handle the event // (this will prevent displayApp from going back to the menu or clock scree). - auto* list = static_cast<lv_ddlist_ext_t *>(ddlist->ext_attr); - if(list->opened) { + auto* list = static_cast<lv_ddlist_ext_t*>(ddlist->ext_attr); + if (list->opened) { return true; } else { return false; } } - |
