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

PhotoStyle Watch Face #2028

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Expand Up @@ -422,6 +422,7 @@ list(APPEND SOURCE_FILES
## Watch faces
displayapp/screens/WatchFaceAnalog.cpp
displayapp/screens/WatchFaceDigital.cpp
displayapp/screens/WatchFacePhotoStyle.cpp
displayapp/screens/WatchFaceInfineat.cpp
displayapp/screens/WatchFaceTerminal.cpp
displayapp/screens/WatchFacePineTimeStyle.cpp
Expand Down
65 changes: 64 additions & 1 deletion src/components/settings/Settings.h
Expand Up @@ -45,6 +45,16 @@ namespace Pinetime {
PTSWeather weatherEnable = PTSWeather::Off;
};

enum class ContentStyle : uint8_t { Off, Date, Steps, Battery, Heart, Weather };

struct WatchFacePhoto {
Colors ColorTime = Colors::White;
bool PhotoBackground = true;
Colors ColorBG = Colors::Black;
ContentStyle contentStyleTop = ContentStyle::Date;
ContentStyle contentStyleBottom = ContentStyle::Steps;
};

struct WatchFaceInfineat {
bool showSideCover = true;
int colorIndex = 0;
Expand Down Expand Up @@ -112,6 +122,57 @@ namespace Pinetime {
return settings.PTS.ColorBG;
};

void SetPhotoFaceColorTime(Colors colorTime) {
if (colorTime != settings.watchFacePhoto.ColorTime)
settingsChanged = true;
settings.watchFacePhoto.ColorTime = colorTime;
};

Colors GetPhotoFaceColorTime() const {
return settings.watchFacePhoto.ColorTime;
};

void SetPhotoFaceColorBG(Colors colorBG) {
if (colorBG != settings.watchFacePhoto.ColorBG)
settingsChanged = true;
settings.watchFacePhoto.ColorBG = colorBG;
};

Colors GetPhotoFaceColorBG() const {
return settings.watchFacePhoto.ColorBG;
};

void SetPhotoFaceContentTop(ContentStyle contentStyle) {
if (contentStyle != settings.watchFacePhoto.contentStyleTop)
settingsChanged = true;
settings.watchFacePhoto.contentStyleTop = contentStyle;
};

ContentStyle GetPhotoFaceContentTop() const {
return settings.watchFacePhoto.contentStyleTop;
};

void SetPhotoFaceContentBottom(ContentStyle contentStyle) {
if (contentStyle != settings.watchFacePhoto.contentStyleBottom)
settingsChanged = true;
settings.watchFacePhoto.contentStyleBottom = contentStyle;
};

ContentStyle GetPhotoFaceContentBottom() const {
return settings.watchFacePhoto.contentStyleBottom;
};

void SetPhotoFaceShowPhoto(bool show) {
if (show != settings.watchFacePhoto.PhotoBackground) {
settings.watchFacePhoto.PhotoBackground = show;
settingsChanged = true;
}
};

bool GetPhotoFaceShowPhoto() const {
return settings.watchFacePhoto.PhotoBackground;
};

void SetInfineatShowSideCover(bool show) {
if (show != settings.watchFaceInfineat.showSideCover) {
settings.watchFaceInfineat.showSideCover = show;
Expand Down Expand Up @@ -286,7 +347,7 @@ namespace Pinetime {
private:
Pinetime::Controllers::FS& fs;

static constexpr uint32_t settingsVersion = 0x0007;
static constexpr uint32_t settingsVersion = 0x0008;

struct SettingsData {
uint32_t version = settingsVersion;
Expand All @@ -304,6 +365,8 @@ namespace Pinetime {

WatchFaceInfineat watchFaceInfineat;

WatchFacePhoto watchFacePhoto;

std::bitset<5> wakeUpMode {0};
uint16_t shakeWakeThreshold = 150;

Expand Down
1 change: 1 addition & 0 deletions src/displayapp/UserApps.h
Expand Up @@ -9,6 +9,7 @@
#include "displayapp/screens/Tile.h"
#include "displayapp/screens/ApplicationList.h"
#include "displayapp/screens/WatchFaceDigital.h"
#include "displayapp/screens/WatchFacePhotoStyle.h"
#include "displayapp/screens/WatchFaceAnalog.h"
#include "displayapp/screens/WatchFaceCasioStyleG7710.h"
#include "displayapp/screens/WatchFaceInfineat.h"
Expand Down
1 change: 1 addition & 0 deletions src/displayapp/apps/Apps.h.in
Expand Up @@ -50,6 +50,7 @@ namespace Pinetime {
Analog,
PineTimeStyle,
Terminal,
PhotoStyle,
Infineat,
CasioStyleG7710,
};
Expand Down
1 change: 1 addition & 0 deletions src/displayapp/apps/CMakeLists.txt
Expand Up @@ -24,6 +24,7 @@ else()
set(DEFAULT_WATCHFACE_TYPES "WatchFace::Digital")
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Analog")
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::PineTimeStyle")
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::PhotoStyle")
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Terminal")
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Infineat")
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::CasioStyleG7710")
Expand Down