Skip to content

Commit acf5bf4

Browse files
committed
PhotoStyle Watch Face
A new watch face designed to have a custom photo as the background.
1 parent 6ab512a commit acf5bf4

10 files changed

+920
-1
lines changed

src/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ list(APPEND SOURCE_FILES
422422
## Watch faces
423423
displayapp/screens/WatchFaceAnalog.cpp
424424
displayapp/screens/WatchFaceDigital.cpp
425+
displayapp/screens/WatchFacePhotoStyle.cpp
425426
displayapp/screens/WatchFaceInfineat.cpp
426427
displayapp/screens/WatchFaceTerminal.cpp
427428
displayapp/screens/WatchFacePineTimeStyle.cpp

src/components/settings/Settings.h

+64-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ namespace Pinetime {
4545
PTSWeather weatherEnable = PTSWeather::Off;
4646
};
4747

48+
enum class ContentStyle : uint8_t { Off, Date, Steps, Battery, Heart, Weather };
49+
50+
struct WatchFacePhoto {
51+
Colors ColorTime = Colors::White;
52+
bool PhotoBackground = true;
53+
Colors ColorBG = Colors::Black;
54+
ContentStyle contentStyleTop = ContentStyle::Date;
55+
ContentStyle contentStyleBottom = ContentStyle::Steps;
56+
};
57+
4858
struct WatchFaceInfineat {
4959
bool showSideCover = true;
5060
int colorIndex = 0;
@@ -112,6 +122,57 @@ namespace Pinetime {
112122
return settings.PTS.ColorBG;
113123
};
114124

125+
void SetPhotoFaceColorTime(Colors colorTime) {
126+
if (colorTime != settings.watchFacePhoto.ColorTime)
127+
settingsChanged = true;
128+
settings.watchFacePhoto.ColorTime = colorTime;
129+
};
130+
131+
Colors GetPhotoFaceColorTime() const {
132+
return settings.watchFacePhoto.ColorTime;
133+
};
134+
135+
void SetPhotoFaceColorBG(Colors colorBG) {
136+
if (colorBG != settings.watchFacePhoto.ColorBG)
137+
settingsChanged = true;
138+
settings.watchFacePhoto.ColorBG = colorBG;
139+
};
140+
141+
Colors GetPhotoFaceColorBG() const {
142+
return settings.watchFacePhoto.ColorBG;
143+
};
144+
145+
void SetPhotoFaceContentTop(ContentStyle contentStyle) {
146+
if (contentStyle != settings.watchFacePhoto.contentStyleTop)
147+
settingsChanged = true;
148+
settings.watchFacePhoto.contentStyleTop = contentStyle;
149+
};
150+
151+
ContentStyle GetPhotoFaceContentTop() const {
152+
return settings.watchFacePhoto.contentStyleTop;
153+
};
154+
155+
void SetPhotoFaceContentBottom(ContentStyle contentStyle) {
156+
if (contentStyle != settings.watchFacePhoto.contentStyleBottom)
157+
settingsChanged = true;
158+
settings.watchFacePhoto.contentStyleBottom = contentStyle;
159+
};
160+
161+
ContentStyle GetPhotoFaceContentBottom() const {
162+
return settings.watchFacePhoto.contentStyleBottom;
163+
};
164+
165+
void SetPhotoFaceShowPhoto(bool show) {
166+
if (show != settings.watchFacePhoto.PhotoBackground) {
167+
settings.watchFacePhoto.PhotoBackground = show;
168+
settingsChanged = true;
169+
}
170+
};
171+
172+
bool GetPhotoFaceShowPhoto() const {
173+
return settings.watchFacePhoto.PhotoBackground;
174+
};
175+
115176
void SetInfineatShowSideCover(bool show) {
116177
if (show != settings.watchFaceInfineat.showSideCover) {
117178
settings.watchFaceInfineat.showSideCover = show;
@@ -286,7 +347,7 @@ namespace Pinetime {
286347
private:
287348
Pinetime::Controllers::FS& fs;
288349

289-
static constexpr uint32_t settingsVersion = 0x0007;
350+
static constexpr uint32_t settingsVersion = 0x0008;
290351

291352
struct SettingsData {
292353
uint32_t version = settingsVersion;
@@ -304,6 +365,8 @@ namespace Pinetime {
304365

305366
WatchFaceInfineat watchFaceInfineat;
306367

368+
WatchFacePhoto watchFacePhoto;
369+
307370
std::bitset<5> wakeUpMode {0};
308371
uint16_t shakeWakeThreshold = 150;
309372

src/displayapp/UserApps.h

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "displayapp/screens/Tile.h"
1010
#include "displayapp/screens/ApplicationList.h"
1111
#include "displayapp/screens/WatchFaceDigital.h"
12+
#include "displayapp/screens/WatchFacePhotoStyle.h"
1213
#include "displayapp/screens/WatchFaceAnalog.h"
1314
#include "displayapp/screens/WatchFaceCasioStyleG7710.h"
1415
#include "displayapp/screens/WatchFaceInfineat.h"

src/displayapp/apps/Apps.h.in

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ namespace Pinetime {
5050
Analog,
5151
PineTimeStyle,
5252
Terminal,
53+
PhotoStyle,
5354
Infineat,
5455
CasioStyleG7710,
5556
};

src/displayapp/apps/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ else()
2424
set(DEFAULT_WATCHFACE_TYPES "WatchFace::Digital")
2525
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Analog")
2626
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::PineTimeStyle")
27+
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::PhotoStyle")
2728
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Terminal")
2829
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Infineat")
2930
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::CasioStyleG7710")

0 commit comments

Comments
 (0)