Skip to content

Commit

Permalink
Allow one more icon in 24H mode
Browse files Browse the repository at this point in the history
  • Loading branch information
JustScott committed Feb 14, 2025
1 parent 3632d5e commit 24cd41f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/displayapp/screens/Tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Tile::Tile(uint8_t screenID,
: app {app},
dateTimeController {dateTimeController},
pageIndicator(screenID, numScreens),
statusIcons(batteryController, bleController, alarmController, timer) {
statusIcons(batteryController, bleController, alarmController, timer, settingsController) {

settingsController.SetAppMenu(screenID);

Expand Down
2 changes: 1 addition & 1 deletion src/displayapp/screens/WatchFaceDigital.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ WatchFaceDigital::WatchFaceDigital(Controllers::DateTime& dateTimeController,
heartRateController {heartRateController},
motionController {motionController},
weatherService {weatherService},
statusIcons(batteryController, bleController, alarmController, timer) {
statusIcons(batteryController, bleController, alarmController, timer, settingsController) {

statusIcons.Create();

Expand Down
2 changes: 1 addition & 1 deletion src/displayapp/screens/settings/QuickSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
brightness {brightness},
motorController {motorController},
settingsController {settingsController},
statusIcons(batteryController, bleController, alarmController, timer) {
statusIcons(batteryController, bleController, alarmController, timer, settingsController) {

statusIcons.Create();

Expand Down
10 changes: 8 additions & 2 deletions src/displayapp/widgets/StatusIcons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ using namespace Pinetime::Applications::Widgets;
StatusIcons::StatusIcons(const Controllers::Battery& batteryController,
const Controllers::Ble& bleController,
const Controllers::AlarmController& alarmController,
const Controllers::Timer& timer)
const Controllers::Timer& timer,
const Controllers::Settings& settingsController)
: batteryIcon(true),
batteryController {batteryController},
bleController {bleController},
alarmController {alarmController},
timer {timer} {
timer {timer},
settingsController {settingsController} {
}

void StatusIcons::Create() {
Expand Down Expand Up @@ -112,6 +114,10 @@ void StatusIcons::Update() {
lv_label_set_text_fmt(timeRemaining, ":%02d", timerSeconds);
}

if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) {
maxIcons += 1;
}

if (activeIconCounter > maxIcons) {
lv_obj_set_hidden(timerContainer, true);
lv_obj_set_hidden(soloTimerIcon, false);
Expand Down
5 changes: 4 additions & 1 deletion src/displayapp/widgets/StatusIcons.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "components/battery/BatteryController.h"
#include "components/ble/BleController.h"
#include "components/alarm/AlarmController.h"
#include "components/settings/Settings.h"
#include "displayapp/screens/BatteryIcon.h"
#include "utility/DirtyValue.h"

Expand All @@ -17,7 +18,8 @@ namespace Pinetime {
StatusIcons(const Controllers::Battery& batteryController,
const Controllers::Ble& bleController,
const Controllers::AlarmController& alarmController,
const Controllers::Timer& timer);
const Controllers::Timer& timer,
const Controllers::Settings& settingsController);
void Align();
void Create();

Expand All @@ -33,6 +35,7 @@ namespace Pinetime {
const Controllers::Ble& bleController;
const Controllers::AlarmController& alarmController;
const Controllers::Timer& timer;
const Controllers::Settings& settingsController;

Utility::DirtyValue<uint8_t> batteryPercentRemaining {};
Utility::DirtyValue<bool> powerPresent {};
Expand Down

0 comments on commit 24cd41f

Please sign in to comment.