Skip to content

Commit 4517fb8

Browse files
Pride flag watchface (#2201)
1 parent 3fc00f8 commit 4517fb8

File tree

9 files changed

+469
-1
lines changed

9 files changed

+469
-1
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ list(APPEND SOURCE_FILES
427427
displayapp/screens/WatchFaceTerminal.cpp
428428
displayapp/screens/WatchFacePineTimeStyle.cpp
429429
displayapp/screens/WatchFaceCasioStyleG7710.cpp
430+
displayapp/screens/WatchFacePrideFlag.cpp
430431

431432
##
432433

src/components/datetime/DateTimeController.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using namespace Pinetime::Controllers;
99
namespace {
1010
constexpr const char* const DaysStringShort[] = {"--", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
1111
constexpr const char* const DaysStringShortLow[] = {"--", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
12+
constexpr const char* const DaysString[] = {"--", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"};
13+
constexpr const char* const DaysStringLow[] = {"--", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
1214
constexpr const char* const MonthsString[] = {"--", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
1315
constexpr const char* const MonthsStringLow[] =
1416
{"--", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
@@ -144,6 +146,10 @@ const char* DateTime::DayOfWeekShortToString() const {
144146
return DaysStringShort[static_cast<uint8_t>(DayOfWeek())];
145147
}
146148

149+
const char* DateTime::DayOfWeekToString() const {
150+
return DaysString[static_cast<uint8_t>(DayOfWeek())];
151+
}
152+
147153
const char* DateTime::MonthShortToStringLow(Months month) {
148154
return MonthsStringLow[static_cast<uint8_t>(month)];
149155
}
@@ -152,6 +158,10 @@ const char* DateTime::DayOfWeekShortToStringLow(Days day) {
152158
return DaysStringShortLow[static_cast<uint8_t>(day)];
153159
}
154160

161+
const char* DateTime::DayOfWeekToStringLow(Days day) {
162+
return DaysStringLow[static_cast<uint8_t>(day)];
163+
}
164+
155165
void DateTime::Register(Pinetime::System::SystemTask* systemTask) {
156166
this->systemTask = systemTask;
157167
}

src/components/datetime/DateTimeController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ namespace Pinetime {
121121

122122
const char* MonthShortToString() const;
123123
const char* DayOfWeekShortToString() const;
124+
const char* DayOfWeekToString() const;
124125
static const char* MonthShortToStringLow(Months month);
125126
static const char* DayOfWeekShortToStringLow(Days day);
127+
static const char* DayOfWeekToStringLow(Days day);
126128

127129
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime();
128130

src/components/settings/Settings.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace Pinetime {
3636
};
3737
enum class PTSGaugeStyle : uint8_t { Full, Half, Numeric };
3838
enum class PTSWeather : uint8_t { On, Off };
39+
enum class PrideFlag : uint8_t { Gay, Trans, Bi, Lesbian };
3940

4041
struct PineTimeStyle {
4142
Colors ColorTime = Colors::Teal;
@@ -154,6 +155,16 @@ namespace Pinetime {
154155
return settings.PTS.weatherEnable;
155156
};
156157

158+
void SetPrideFlag(PrideFlag prideFlag) {
159+
if (prideFlag != settings.prideFlag)
160+
settingsChanged = true;
161+
settings.prideFlag = prideFlag;
162+
};
163+
164+
PrideFlag GetPrideFlag() const {
165+
return settings.prideFlag;
166+
};
167+
157168
void SetAppMenu(uint8_t menu) {
158169
appMenu = menu;
159170
};
@@ -301,7 +312,7 @@ namespace Pinetime {
301312
private:
302313
Pinetime::Controllers::FS& fs;
303314

304-
static constexpr uint32_t settingsVersion = 0x0008;
315+
static constexpr uint32_t settingsVersion = 0x0009;
305316

306317
struct SettingsData {
307318
uint32_t version = settingsVersion;
@@ -319,6 +330,8 @@ namespace Pinetime {
319330

320331
PineTimeStyle PTS;
321332

333+
PrideFlag prideFlag = PrideFlag::Gay;
334+
322335
WatchFaceInfineat watchFaceInfineat;
323336

324337
std::bitset<5> wakeUpMode {0};

src/displayapp/UserApps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "displayapp/screens/WatchFaceInfineat.h"
1515
#include "displayapp/screens/WatchFacePineTimeStyle.h"
1616
#include "displayapp/screens/WatchFaceTerminal.h"
17+
#include "displayapp/screens/WatchFacePrideFlag.h"
1718

1819
namespace Pinetime {
1920
namespace Applications {

src/displayapp/apps/Apps.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ namespace Pinetime {
5353
Terminal,
5454
Infineat,
5555
CasioStyleG7710,
56+
PrideFlag,
5657
};
5758

5859
template <Apps>

src/displayapp/apps/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ else()
2828
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Terminal")
2929
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Infineat")
3030
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::CasioStyleG7710")
31+
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::PrideFlag")
3132
set(WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}" CACHE STRING "List of watch faces to build into the firmware")
3233
endif()
3334

0 commit comments

Comments
 (0)