From a6580f004cbe97b51374b856cef168e85227297c Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 8 May 2024 14:41:03 -0400 Subject: [PATCH] more work on calculator --- src/displayapp/apps/CMakeLists.txt | 1 + src/displayapp/screens/Calculator.h | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/displayapp/apps/CMakeLists.txt b/src/displayapp/apps/CMakeLists.txt index d7858760..7b909124 100644 --- a/src/displayapp/apps/CMakeLists.txt +++ b/src/displayapp/apps/CMakeLists.txt @@ -14,6 +14,7 @@ else () set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Metronome") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Navigation") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Weather") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Calculator") #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Motion") set(USERAPP_TYPES "${DEFAULT_USER_APP_TYPES}" CACHE STRING "List of user apps to build into the firmware") endif () diff --git a/src/displayapp/screens/Calculator.h b/src/displayapp/screens/Calculator.h index 17513861..8a024bb9 100644 --- a/src/displayapp/screens/Calculator.h +++ b/src/displayapp/screens/Calculator.h @@ -1,6 +1,9 @@ #pragma once -#include "Screen.h" +#include "displayapp/Apps.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/Controllers.h" +#include "Symbols.h" namespace { int64_t constexpr powi(int64_t base, uint8_t exponent) { @@ -64,5 +67,14 @@ namespace Pinetime { Error error = Error::None; }; } + + template <> + struct AppTraits { + static constexpr Apps app = Apps::Calculator; + static constexpr const char* icon = Screens::Symbols::dice; + static Screens::Screen* Create(AppControllers& controllers) { + return new Screens::Calculator(); + } + }; } }