Skip to content

Commit fc1d548

Browse files
Aperture32GLaDOSmetaphys
authored andcommitted
Pride flag watchface (InfiniTimeOrg#2201)
1 parent 497d6b0 commit fc1d548

9 files changed

Lines changed: 469 additions & 1 deletion

File tree

‎src/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ list(APPEND SOURCE_FILES
428428
displayapp/screens/WatchFacePineTimeStyle.cpp
429429
displayapp/screens/WatchFaceCasioStyleG7710.cpp
430430
displayapp/screens/WatchFaceCasioStyleAE21W.cpp
431+
displayapp/screens/WatchFacePrideFlag.cpp
431432

432433
##
433434

‎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;
@@ -169,6 +170,16 @@ namespace Pinetime {
169170
return settings.PTS.weatherEnable;
170171
};
171172

173+
void SetPrideFlag(PrideFlag prideFlag) {
174+
if (prideFlag != settings.prideFlag)
175+
settingsChanged = true;
176+
settings.prideFlag = prideFlag;
177+
};
178+
179+
PrideFlag GetPrideFlag() const {
180+
return settings.prideFlag;
181+
};
182+
172183
void SetAppMenu(uint8_t menu) {
173184
appMenu = menu;
174185
};
@@ -316,7 +327,7 @@ namespace Pinetime {
316327
private:
317328
Pinetime::Controllers::FS& fs;
318329

319-
static constexpr uint32_t settingsVersion = 0x0008;
330+
static constexpr uint32_t settingsVersion = 0x0009;
320331

321332
struct SettingsData {
322333
uint32_t version = settingsVersion;
@@ -334,6 +345,8 @@ namespace Pinetime {
334345

335346
PineTimeStyle PTS;
336347

348+
PrideFlag prideFlag = PrideFlag::Gay;
349+
337350
WatchFaceInfineat watchFaceInfineat;
338351

339352
WatchFaceCasioStyleAE21W watchFaceCasioStyleAE21W;

‎src/displayapp/UserApps.h‎

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

1920
namespace Pinetime {
2021
namespace Applications {

‎src/displayapp/apps/Apps.h.in‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ namespace Pinetime {
5454
Infineat,
5555
CasioStyleAE21W,
5656
CasioStyleG7710,
57+
PrideFlag,
5758
};
5859

5960
template <Apps>

‎src/displayapp/apps/CMakeLists.txt‎

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

0 commit comments

Comments
 (0)