Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate color picker into PineTimeStyle watchface #718

Merged
merged 27 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3320eae
Initial commit
kieranc Oct 3, 2021
7d1da9f
Remove old PineTimeStyle settings app
kieranc Oct 3, 2021
1c86796
More duplicate color dodging
kieranc Oct 18, 2021
c4ab17f
Disable DoubleTap when settings buttons are displayed
kieranc Oct 18, 2021
ff1fce1
Merge remote-tracking branch 'upstream/develop' into pts-settings
kieranc Oct 18, 2021
1c3372b
Fix settings merge error
kieranc Oct 18, 2021
994f373
Change gauge needle color when background is white
kieranc Oct 18, 2021
f45e094
Ensure needle color is visible one reset/randomize
kieranc Oct 20, 2021
074d342
Ensure needle color is visible on reset/randomize
kieranc Oct 20, 2021
37eed43
Merge branch 'pts-settings' of https://github.com/kieranc/InfiniTime …
kieranc Oct 20, 2021
32978b6
Restore settings order
kieranc Oct 20, 2021
3ed01b3
Improve random color selection, disable longpress when settings are v…
kieranc Oct 20, 2021
411c10e
Update GetNext/GetPrevious
kieranc Oct 20, 2021
da97a94
Merge remote-tracking branch 'upstream/develop' into pts-settings
kieranc Oct 23, 2021
85d494a
Revert "Update GetNext/GetPrevious"
kieranc Oct 23, 2021
18e3cc7
Merge remote-tracking branch 'upstream/develop' into pts-settings
kieranc Nov 7, 2021
39157f2
Close menu with button
Riksu9000 Nov 13, 2021
2e7b51c
clang-format and clang-tidy PineTimeStyle
Riksu9000 Nov 13, 2021
2fa63c7
Merge pull request #1 from Riksu9000/pts-settings-fix
kieranc Nov 15, 2021
5a0cf8e
Merge remote-tracking branch 'upstream/develop' into pts-settings
kieranc Nov 15, 2021
50406ad
Merge remote-tracking branch 'upstream/develop' into pts-settings
kieranc Nov 15, 2021
29bb359
Fix notification icon alignment
kieranc Nov 15, 2021
bea5c60
Revert "Fix notification icon alignment"
kieranc Nov 16, 2021
1b2a8a5
Improve notification icon alignment
kieranc Nov 16, 2021
c00ad4a
Merge remote-tracking branch 'upstream/develop' into pts-settings
kieranc Dec 5, 2021
ae4b9e0
Include Colors.h
kieranc Dec 6, 2021
6cf4a93
Merge remote-tracking branch 'upstream/develop' into pts-settings
kieranc Dec 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ list(APPEND SOURCE_FILES
displayapp/screens/settings/SettingWakeUp.cpp
displayapp/screens/settings/SettingDisplay.cpp
displayapp/screens/settings/SettingSteps.cpp
displayapp/screens/settings/SettingPineTimeStyle.cpp

## Watch faces
displayapp/icons/bg_clock.c
Expand Down
3 changes: 1 addition & 2 deletions src/displayapp/Apps.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ namespace Pinetime {
SettingTimeFormat,
SettingDisplay,
SettingWakeUp,
SettingSteps,
SettingPineTimeStyle
SettingSteps
};
}
}
5 changes: 0 additions & 5 deletions src/displayapp/DisplayApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "displayapp/screens/settings/SettingWakeUp.h"
#include "displayapp/screens/settings/SettingDisplay.h"
#include "displayapp/screens/settings/SettingSteps.h"
#include "displayapp/screens/settings/SettingPineTimeStyle.h"

#include "libs/lv_conf.h"

Expand Down Expand Up @@ -365,10 +364,6 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
currentScreen = std::make_unique<Screens::SettingSteps>(this, settingsController);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::SettingPineTimeStyle:
currentScreen = std::make_unique<Screens::SettingPineTimeStyle>(this, settingsController);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
break;
case Apps::BatteryInfo:
currentScreen = std::make_unique<Screens::BatteryInfo>(this, batteryController);
ReturnApp(Apps::Settings, FullRefreshDirections::Down, TouchEvents::SwipeDown);
Expand Down
270 changes: 254 additions & 16 deletions src/displayapp/screens/PineTimeStyle.cpp

Large diffs are not rendered by default.

21 changes: 20 additions & 1 deletion src/displayapp/screens/PineTimeStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,20 @@ namespace Pinetime {
Controllers::MotionController& motionController);
~PineTimeStyle() override;

bool OnTouchEvent(TouchEvents event) override;

void Refresh() override;

void UpdateSelected(lv_obj_t *object, lv_event_t event);

private:
char displayedChar[5];

uint16_t currentYear = 1970;
Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown;
Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
uint8_t currentDay = 0;
uint32_t savedTick = 0;

DirtyValue<uint8_t> batteryPercentRemaining {};
DirtyValue<bool> isCharging {};
Expand All @@ -48,6 +53,18 @@ namespace Pinetime {
DirtyValue<uint32_t> stepCount {};
DirtyValue<bool> notificationState {};

Pinetime::Controllers::Settings::Colors GetNext(Controllers::Settings::Colors color);
Pinetime::Controllers::Settings::Colors GetPrevious(Controllers::Settings::Colors color);

lv_obj_t* btnNextTime;
lv_obj_t* btnPrevTime;
lv_obj_t* btnNextBar;
lv_obj_t* btnPrevBar;
lv_obj_t* btnNextBG;
lv_obj_t* btnPrevBG;
lv_obj_t* btnReset;
lv_obj_t* btnRandom;
lv_obj_t* btnClose;
lv_obj_t* timebar;
lv_obj_t* sidebar;
lv_obj_t* timeDD1;
Expand All @@ -67,6 +84,8 @@ namespace Pinetime {
lv_obj_t* calendarCrossBar2;
lv_obj_t* notificationIcon;
lv_obj_t* stepGauge;
lv_obj_t* btnSet;
lv_obj_t* lbl_btnSet;
lv_color_t needle_colors[1];

Controllers::DateTime& dateTimeController;
Expand All @@ -82,4 +101,4 @@ namespace Pinetime {
};
}
}
}
}
318 changes: 0 additions & 318 deletions src/displayapp/screens/settings/SettingPineTimeStyle.cpp

This file was deleted.

56 changes: 0 additions & 56 deletions src/displayapp/screens/settings/SettingPineTimeStyle.h

This file was deleted.

21 changes: 3 additions & 18 deletions src/displayapp/screens/settings/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ Settings::Settings(Pinetime::Applications::DisplayApp* app, Pinetime::Controller
},
[this]() -> std::unique_ptr<Screen> {
return CreateScreen2();
},
[this]() -> std::unique_ptr<Screen> {
return CreateScreen3();
}},
Screens::ScreenListModes::UpDown} {
}
Expand All @@ -42,29 +39,17 @@ std::unique_ptr<Screen> Settings::CreateScreen1() {
{Symbols::home, "Watch face", Apps::SettingWatchFace},
}};

return std::make_unique<Screens::List>(0, 3, app, settingsController, applications);
return std::make_unique<Screens::List>(0, 2, app, settingsController, applications);
}

std::unique_ptr<Screen> Settings::CreateScreen2() {

std::array<Screens::List::Applications, 4> applications {{
{Symbols::shoe, "Steps", Apps::SettingSteps},
{Symbols::batteryHalf, "Battery", Apps::BatteryInfo},
{Symbols::paintbrush, "PTS Colors", Apps::SettingPineTimeStyle},
{Symbols::check, "Firmware", Apps::FirmwareValidation},
}};

return std::make_unique<Screens::List>(1, 3, app, settingsController, applications);
}

std::unique_ptr<Screen> Settings::CreateScreen3() {

std::array<Screens::List::Applications, 4> applications {{
{Symbols::list, "About", Apps::SysInfo},
{Symbols::none, "None", Apps::None},
{Symbols::none, "None", Apps::None},
{Symbols::none, "None", Apps::None},
}};

return std::make_unique<Screens::List>(2, 3, app, settingsController, applications);
}
return std::make_unique<Screens::List>(1, 2, app, settingsController, applications);
}