Merge pull request #1031 from mabuch/rename-PineTimeStyle-to-WatchFacePineTimeStyle
Rename PineTimeStyle to WatchFacePineTimeStyle
This commit is contained in:
commit
943a48f189
|
@ -456,7 +456,7 @@ list(APPEND SOURCE_FILES
|
||||||
displayapp/screens/WatchFaceAnalog.cpp
|
displayapp/screens/WatchFaceAnalog.cpp
|
||||||
displayapp/screens/WatchFaceDigital.cpp
|
displayapp/screens/WatchFaceDigital.cpp
|
||||||
displayapp/screens/WatchFaceTerminal.cpp
|
displayapp/screens/WatchFaceTerminal.cpp
|
||||||
displayapp/screens/PineTimeStyle.cpp
|
displayapp/screens/WatchFacePineTimeStyle.cpp
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "displayapp/screens/WatchFaceDigital.h"
|
#include "displayapp/screens/WatchFaceDigital.h"
|
||||||
#include "displayapp/screens/WatchFaceTerminal.h"
|
#include "displayapp/screens/WatchFaceTerminal.h"
|
||||||
#include "displayapp/screens/WatchFaceAnalog.h"
|
#include "displayapp/screens/WatchFaceAnalog.h"
|
||||||
#include "displayapp/screens/PineTimeStyle.h"
|
#include "displayapp/screens/WatchFacePineTimeStyle.h"
|
||||||
|
|
||||||
using namespace Pinetime::Applications::Screens;
|
using namespace Pinetime::Applications::Screens;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ Clock::Clock(DisplayApp* app,
|
||||||
return WatchFaceAnalogScreen();
|
return WatchFaceAnalogScreen();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
return PineTimeStyleScreen();
|
return WatchFacePineTimeStyleScreen();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
return WatchFaceTerminalScreen();
|
return WatchFaceTerminalScreen();
|
||||||
|
@ -79,8 +79,8 @@ std::unique_ptr<Screen> Clock::WatchFaceAnalogScreen() {
|
||||||
app, dateTimeController, batteryController, bleController, notificatioManager, settingsController);
|
app, dateTimeController, batteryController, bleController, notificatioManager, settingsController);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<Screen> Clock::PineTimeStyleScreen() {
|
std::unique_ptr<Screen> Clock::WatchFacePineTimeStyleScreen() {
|
||||||
return std::make_unique<Screens::PineTimeStyle>(
|
return std::make_unique<Screens::WatchFacePineTimeStyle>(
|
||||||
app, dateTimeController, batteryController, bleController, notificatioManager, settingsController, motionController);
|
app, dateTimeController, batteryController, bleController, notificatioManager, settingsController, motionController);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace Pinetime {
|
||||||
std::unique_ptr<Screen> screen;
|
std::unique_ptr<Screen> screen;
|
||||||
std::unique_ptr<Screen> WatchFaceDigitalScreen();
|
std::unique_ptr<Screen> WatchFaceDigitalScreen();
|
||||||
std::unique_ptr<Screen> WatchFaceAnalogScreen();
|
std::unique_ptr<Screen> WatchFaceAnalogScreen();
|
||||||
std::unique_ptr<Screen> PineTimeStyleScreen();
|
std::unique_ptr<Screen> WatchFacePineTimeStyleScreen();
|
||||||
std::unique_ptr<Screen> WatchFaceTerminalScreen();
|
std::unique_ptr<Screen> WatchFaceTerminalScreen();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
* Style/layout copied from TimeStyle for Pebble by Dan Tilden (github.com/tilden)
|
* Style/layout copied from TimeStyle for Pebble by Dan Tilden (github.com/tilden)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "displayapp/screens/PineTimeStyle.h"
|
#include "displayapp/screens/WatchFacePineTimeStyle.h"
|
||||||
#include <date/date.h>
|
#include <date/date.h>
|
||||||
#include <lvgl/lvgl.h>
|
#include <lvgl/lvgl.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -39,7 +39,7 @@ using namespace Pinetime::Applications::Screens;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void event_handler(lv_obj_t* obj, lv_event_t event) {
|
void event_handler(lv_obj_t* obj, lv_event_t event) {
|
||||||
auto* screen = static_cast<PineTimeStyle*>(obj->user_data);
|
auto* screen = static_cast<WatchFacePineTimeStyle*>(obj->user_data);
|
||||||
screen->UpdateSelected(obj, event);
|
screen->UpdateSelected(obj, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ namespace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PineTimeStyle::PineTimeStyle(DisplayApp* app,
|
WatchFacePineTimeStyle::WatchFacePineTimeStyle(DisplayApp* app,
|
||||||
Controllers::DateTime& dateTimeController,
|
Controllers::DateTime& dateTimeController,
|
||||||
Controllers::Battery& batteryController,
|
Controllers::Battery& batteryController,
|
||||||
Controllers::Ble& bleController,
|
Controllers::Ble& bleController,
|
||||||
|
@ -300,12 +300,12 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app,
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
PineTimeStyle::~PineTimeStyle() {
|
WatchFacePineTimeStyle::~WatchFacePineTimeStyle() {
|
||||||
lv_task_del(taskRefresh);
|
lv_task_del(taskRefresh);
|
||||||
lv_obj_clean(lv_scr_act());
|
lv_obj_clean(lv_scr_act());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
|
bool WatchFacePineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
|
||||||
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnRandom)) {
|
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnRandom)) {
|
||||||
lv_obj_set_hidden(btnSet, false);
|
lv_obj_set_hidden(btnSet, false);
|
||||||
savedTick = lv_tick_get();
|
savedTick = lv_tick_get();
|
||||||
|
@ -317,7 +317,7 @@ bool PineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PineTimeStyle::CloseMenu() {
|
void WatchFacePineTimeStyle::CloseMenu() {
|
||||||
settingsController.SaveSettings();
|
settingsController.SaveSettings();
|
||||||
lv_obj_set_hidden(btnNextTime, true);
|
lv_obj_set_hidden(btnNextTime, true);
|
||||||
lv_obj_set_hidden(btnPrevTime, true);
|
lv_obj_set_hidden(btnPrevTime, true);
|
||||||
|
@ -330,7 +330,7 @@ void PineTimeStyle::CloseMenu() {
|
||||||
lv_obj_set_hidden(btnClose, true);
|
lv_obj_set_hidden(btnClose, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PineTimeStyle::OnButtonPushed() {
|
bool WatchFacePineTimeStyle::OnButtonPushed() {
|
||||||
if (!lv_obj_get_hidden(btnClose)) {
|
if (!lv_obj_get_hidden(btnClose)) {
|
||||||
CloseMenu();
|
CloseMenu();
|
||||||
return true;
|
return true;
|
||||||
|
@ -338,13 +338,12 @@ bool PineTimeStyle::OnButtonPushed() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PineTimeStyle::SetBatteryIcon() {
|
void WatchFacePineTimeStyle::SetBatteryIcon() {
|
||||||
auto batteryPercent = batteryPercentRemaining.Get();
|
auto batteryPercent = batteryPercentRemaining.Get();
|
||||||
lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent));
|
lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WatchFacePineTimeStyle::AlignIcons() {
|
||||||
void PineTimeStyle::AlignIcons() {
|
|
||||||
if (notificationState.Get() && bleState.Get()) {
|
if (notificationState.Get() && bleState.Get()) {
|
||||||
lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25);
|
lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25);
|
||||||
lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25);
|
lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25);
|
||||||
|
@ -355,7 +354,7 @@ void PineTimeStyle::AlignIcons() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PineTimeStyle::Refresh() {
|
void WatchFacePineTimeStyle::Refresh() {
|
||||||
isCharging = batteryController.IsCharging();
|
isCharging = batteryController.IsCharging();
|
||||||
if (isCharging.IsUpdated()) {
|
if (isCharging.IsUpdated()) {
|
||||||
if (isCharging.Get()) {
|
if (isCharging.Get()) {
|
||||||
|
@ -455,7 +454,7 @@ void PineTimeStyle::Refresh() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
|
void WatchFacePineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
|
||||||
auto valueTime = settingsController.GetPTSColorTime();
|
auto valueTime = settingsController.GetPTSColorTime();
|
||||||
auto valueBar = settingsController.GetPTSColorBar();
|
auto valueBar = settingsController.GetPTSColorBar();
|
||||||
auto valueBG = settingsController.GetPTSColorBG();
|
auto valueBG = settingsController.GetPTSColorBG();
|
||||||
|
@ -576,7 +575,7 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Pinetime::Controllers::Settings::Colors PineTimeStyle::GetNext(Pinetime::Controllers::Settings::Colors color) {
|
Pinetime::Controllers::Settings::Colors WatchFacePineTimeStyle::GetNext(Pinetime::Controllers::Settings::Colors color) {
|
||||||
auto colorAsInt = static_cast<uint8_t>(color);
|
auto colorAsInt = static_cast<uint8_t>(color);
|
||||||
Pinetime::Controllers::Settings::Colors nextColor;
|
Pinetime::Controllers::Settings::Colors nextColor;
|
||||||
if (colorAsInt < 16) {
|
if (colorAsInt < 16) {
|
||||||
|
@ -587,7 +586,7 @@ Pinetime::Controllers::Settings::Colors PineTimeStyle::GetNext(Pinetime::Control
|
||||||
return nextColor;
|
return nextColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
Pinetime::Controllers::Settings::Colors PineTimeStyle::GetPrevious(Pinetime::Controllers::Settings::Colors color) {
|
Pinetime::Controllers::Settings::Colors WatchFacePineTimeStyle::GetPrevious(Pinetime::Controllers::Settings::Colors color) {
|
||||||
auto colorAsInt = static_cast<uint8_t>(color);
|
auto colorAsInt = static_cast<uint8_t>(color);
|
||||||
Pinetime::Controllers::Settings::Colors prevColor;
|
Pinetime::Controllers::Settings::Colors prevColor;
|
||||||
|
|
|
@ -21,16 +21,16 @@ namespace Pinetime {
|
||||||
|
|
||||||
namespace Applications {
|
namespace Applications {
|
||||||
namespace Screens {
|
namespace Screens {
|
||||||
class PineTimeStyle : public Screen {
|
class WatchFacePineTimeStyle : public Screen {
|
||||||
public:
|
public:
|
||||||
PineTimeStyle(DisplayApp* app,
|
WatchFacePineTimeStyle(DisplayApp* app,
|
||||||
Controllers::DateTime& dateTimeController,
|
Controllers::DateTime& dateTimeController,
|
||||||
Controllers::Battery& batteryController,
|
Controllers::Battery& batteryController,
|
||||||
Controllers::Ble& bleController,
|
Controllers::Ble& bleController,
|
||||||
Controllers::NotificationManager& notificatioManager,
|
Controllers::NotificationManager& notificatioManager,
|
||||||
Controllers::Settings& settingsController,
|
Controllers::Settings& settingsController,
|
||||||
Controllers::MotionController& motionController);
|
Controllers::MotionController& motionController);
|
||||||
~PineTimeStyle() override;
|
~WatchFacePineTimeStyle() override;
|
||||||
|
|
||||||
bool OnTouchEvent(TouchEvents event) override;
|
bool OnTouchEvent(TouchEvents event) override;
|
||||||
bool OnButtonPushed() override;
|
bool OnButtonPushed() override;
|
Loading…
Reference in New Issue
Block a user