Skip to content

Commit 1963e1f

Browse files
committed
Add theming support
1 parent 7128fc0 commit 1963e1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+9091
-81
lines changed

compile_commands.json

Lines changed: 3572 additions & 0 deletions
Large diffs are not rendered by default.

my-cmake.pp

942 Bytes
Binary file not shown.

my-cmake.te

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
module my-cmake 1.0;
3+
4+
require {
5+
type container_t;
6+
type user_home_t;
7+
class file read;
8+
}
9+
10+
#============= container_t ==============
11+
allow container_t user_home_t:file read;

post_build.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
export LC_ALL=C.UTF-8
3+
export LANG=C.UTF-8
4+
set -e
5+
set +x
6+
7+
export PROJECT_VERSION="1.15.0"
8+
9+
mkdir -p "$OUTPUT_DIR"
10+
11+
cp "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin $OUTPUT_DIR/bootloader.bin
12+
cp "$BUILD_DIR/src/pinetime-mcuboot-app-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-app-image-$PROJECT_VERSION.bin"
13+
cp "$BUILD_DIR/src/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-app-dfu-$PROJECT_VERSION.zip"
14+
15+
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin"
16+
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip"
17+
18+
cp "$BUILD_DIR/src/resources/infinitime-resources-$PROJECT_VERSION.zip" "$OUTPUT_DIR/infinitime-resources-$PROJECT_VERSION.zip"
19+
20+
mkdir -p "$OUTPUT_DIR/src"
21+
cp $BUILD_DIR/src/*.bin "$OUTPUT_DIR/src/"
22+
cp $BUILD_DIR/src/*.hex "$OUTPUT_DIR/src/"
23+
cp $BUILD_DIR/src/*.out "$OUTPUT_DIR/src/"
24+
cp $BUILD_DIR/src/*.map "$OUTPUT_DIR/src/"
25+
26+
ls -RUv1 "$OUTPUT_DIR" | sed 's;^\([^/]\); \1;g'

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ list(APPEND SOURCE_FILES
418418
displayapp/screens/settings/SettingSetDate.cpp
419419
displayapp/screens/settings/SettingSetTime.cpp
420420
displayapp/screens/settings/SettingChimes.cpp
421+
displayapp/screens/settings/SettingTheme.cpp
421422
displayapp/screens/settings/SettingShakeThreshold.cpp
422423
displayapp/screens/settings/SettingBluetooth.cpp
423424
displayapp/screens/settings/SettingOTA.cpp

src/displayapp/DisplayApp.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@
5252
#include "displayapp/screens/settings/SettingShakeThreshold.h"
5353
#include "displayapp/screens/settings/SettingBluetooth.h"
5454
#include "displayapp/screens/settings/SettingOTA.h"
55+
#include "displayapp/screens/settings/SettingTheme.h"
5556

5657
#include "libs/lv_conf.h"
5758
#include "UserApps.h"
59+
#include "displayapp/InfiniTimeTheme.h"
5860

5961
#include <algorithm>
6062

@@ -519,6 +521,14 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
519521
currentScreen.reset(nullptr);
520522
SetFullRefresh(direction);
521523

524+
// Reset screen background color based on app type
525+
// Watch faces keep black background, other apps use theme color
526+
if (app == Apps::Clock) {
527+
lv_obj_set_style_local_bg_color(lv_scr_act(), LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);
528+
} else {
529+
lv_obj_set_style_local_bg_color(lv_scr_act(), LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, Colors::page_bg);
530+
}
531+
522532
switch (app) {
523533
case Apps::Launcher: {
524534
std::array<Screens::Tile::Applications, UserAppTypes::Count> apps;
@@ -631,6 +641,9 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
631641
case Apps::SettingOTA:
632642
currentScreen = std::make_unique<Screens::SettingOTA>(this, settingsController);
633643
break;
644+
case Apps::SettingTheme:
645+
currentScreen = std::make_unique<Screens::SettingTheme>(this);
646+
break;
634647
case Apps::BatteryInfo:
635648
currentScreen = std::make_unique<Screens::BatteryInfo>(batteryController);
636649
break;

0 commit comments

Comments
 (0)