Skip to content

Commit

Permalink
Merge pull request #718 from kieranc/pts-settings
Browse files Browse the repository at this point in the history
Integrate color picker into PineTimeStyle watchface
  • Loading branch information
JF002 authored Dec 30, 2021
2 parents 5b7915b + 6cf4a93 commit 395590d
Show file tree
Hide file tree
Showing 10 changed files with 334 additions and 403 deletions.
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,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
displayapp/screens/settings/SettingSetDate.cpp
displayapp/screens/settings/SettingSetTime.cpp

Expand Down
1 change: 0 additions & 1 deletion src/displayapp/Apps.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace Pinetime {
SettingDisplay,
SettingWakeUp,
SettingSteps,
SettingPineTimeStyle,
SettingSetDate,
SettingSetTime,
Error,
Expand Down
13 changes: 4 additions & 9 deletions src/displayapp/DisplayApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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 "displayapp/screens/settings/SettingSetDate.h"
#include "displayapp/screens/settings/SettingSetTime.h"

Expand Down Expand Up @@ -255,10 +254,10 @@ void DisplayApp::Refresh() {
}
} break;
case Messages::ButtonPushed:
if (currentApp == Apps::Clock) {
PushMessageToSystemTask(System::Messages::GoToSleep);
} else {
if (!currentScreen->OnButtonPushed()) {
if (!currentScreen->OnButtonPushed()) {
if (currentApp == Apps::Clock) {
PushMessageToSystemTask(System::Messages::GoToSleep);
} else {
LoadApp(returnToApp, returnDirection);
brightnessController.Set(settingsController.GetBrightness());
brightnessController.Backup();
Expand Down Expand Up @@ -416,10 +415,6 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
currentScreen = std::make_unique<Screens::SettingSetTime>(this, dateTimeController);
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
4 changes: 4 additions & 0 deletions src/displayapp/screens/Clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ bool Clock::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
return screen->OnTouchEvent(event);
}

bool Clock::OnButtonPushed() {
return screen->OnButtonPushed();
}

std::unique_ptr<Screen> Clock::WatchFaceDigitalScreen() {
return std::make_unique<Screens::WatchFaceDigital>(app,
dateTimeController,
Expand Down
1 change: 1 addition & 0 deletions src/displayapp/screens/Clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace Pinetime {
~Clock() override;

bool OnTouchEvent(TouchEvents event) override;
bool OnButtonPushed() override;

private:
Controllers::DateTime& dateTimeController;
Expand Down
Loading

0 comments on commit 395590d

Please sign in to comment.