Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Buildscripts/module.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ if (COMMAND tactility_add_module)
return()
endif()

macro(tactility_get_module_name NAME OUT_NAME)
if (DEFINED ENV{ESP_IDF_VERSION})
set(${OUT_NAME} ${COMPONENT_LIB})
else ()
set(${OUT_NAME} ${NAME})
endif ()
endmacro()

macro(tactility_add_module NAME)
set(options)
set(oneValueArgs)
Expand Down
Binary file removed Data/system/app/Launcher/assets/icon_apps.png
Binary file not shown.
Binary file removed Data/system/app/Launcher/assets/icon_files.png
Binary file not shown.
Binary file removed Data/system/app/Launcher/assets/icon_settings.png
Binary file not shown.
Binary file removed Data/system/app_icon_chat_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_display_settings_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_fallback_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_files_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_gpio_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_i2c_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_notes_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_power_settings_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_settings_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_system_info_dark_mode.png
Binary file not shown.
Binary file removed Data/system/app_icon_time_date_settings_dark_mode.png
Binary file not shown.
1 change: 1 addition & 0 deletions Documentation/ideas.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Before release

- Remove incubating flag from various devices
- Add `// SPDX-License-Identifier: GPL-3.0-only` and `// SPDX-License-Identifier: Apache-2.0` to individual files in the project
- Elecrow Basic & Advance 3.5" memory issue: not enough memory for App Hub
- App Hub crashes if you close it while an app is being installed
Expand Down
2 changes: 2 additions & 0 deletions Modules/lvgl-module/Assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.ttf
*.codepoints
175 changes: 175 additions & 0 deletions Modules/lvgl-module/Assets/generate-all.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
import os
import urllib.request

def download_file(url: str, filename: str):
if not os.path.exists(filename):
print(f"Downloading {filename} from {url}")
urllib.request.urlretrieve(url, filename)
else:
print(f"{filename} already exists, skipping download.")

def generate(bpp, size, font_file: str, symbols: list, output: str):
output_file_name = f"{output}_{size}.c"
output_path = os.path.join("..", "Source", "fonts", output_file_name)
print(f"Generating {output_file_name}")
cmd = "lv_font_conv --no-compress --no-prefilter --bpp {} --size {} --font {} -r {} --format lvgl -o {} --force-fast-kern-format".format(bpp, size, font_file, ",".join(symbols), output_path)
os.system(cmd)

def read_code_points_map(file_path: str):
codepoints = {}
with open(file_path, 'r') as f:
for line in f:
parts = line.strip().split()
if len(parts) >= 2:
name, cp = parts[0].lower(), parts[1]
codepoints[name] = cp
if len(codepoints) == 0:
raise ValueError(f"Code points map is empty or wasn't found at {file_path}")
return codepoints


def get_code_points(codepoints, names: list) -> list:
result = []
for name in names:
safe_name = name.lower()
if not safe_name in codepoints:
raise ValueError(f"Code point '{safe_name}' not found in map")
result.append(f"0x{codepoints[safe_name].upper()}")
return result

def generate_icon_fonts(font_file, font_sizes, symbols, output):
for size in font_sizes:
generate(2, size, font_file, symbols, output)

def generate_icon_names(codepoint_map: dict, codepoint_names: list, filename: str):
print(f"Generating {filename}")
output_path = os.path.join("..", "Include", "tactility", filename)
with open(output_path, 'w') as f:
f.write("#pragma once\n\n")
for name in codepoint_names:
safe_name = name.lower()
if safe_name in codepoint_map:
hex_val = codepoint_map[safe_name]
# Convert hex to int
val = int(hex_val, 16)
# Convert to UTF-8 escaped string
utf8_bytes = chr(val).encode('utf-8')
escaped_str = "".join(f"\\x{b:02X}" for b in utf8_bytes)

f.write(f'#define LVGL_SYMBOL_{safe_name.upper()} "{escaped_str}"\n')
else:
print(f"Warning: {safe_name} not found in codepoint map")

# --------------- Symbol Fonts ---------------

shared_symbol_code_point_names = [
"add",
"apps",
"area_chart", # System Info
"app_registration", # App Settings app
"calendar_month",
"cable",
"circle",
"close",
"cloud", # Web server
"check",
"delete",
"devices", # Developer app
"display_settings", # Display Settings app
"edit_note",
"electric_bolt", # Power (settings) app
"folder",
"deployed_code", # 3D cube
"download",
"forum", # Chat app
"gamepad",
"help", # Diceware help
"hub", # App Hub
"image", # Screenshot app
"keyboard_arrow_up",
"lightbulb",
"language", # Globe
"lists", # Chat app toolbar
"mail",
"menu",
"mop",
"more_vert",
"music_note",
"note_add",
"power_settings_new", # Power off for T-Lora Pager
"refresh", # e.g. App Hub reload button
"search",
"settings",
"toolbar", # Apps without custom icon
"navigation", # GPS (settings) app
"keyboard_alt", # Keyboard (settings) app
"usb", # Power (settings) app
"wifi", # WiFi (settings) app
]

statusbar_symbol_code_point_names = [
# Location tracking
"location_on",
# Development server
"cloud",
# SD Card
"sd_card",
"sd_card_alert",
# Wi-Fi
"signal_wifi_0_bar",
"network_wifi_1_bar",
"network_wifi_2_bar",
"network_wifi_3_bar",
"signal_wifi_4_bar",
"signal_wifi_off",
# Battery
"battery_android_frame_1",
"battery_android_frame_2",
"battery_android_frame_3",
"battery_android_frame_4",
"battery_android_frame_5",
"battery_android_frame_6",
"battery_android_frame_bolt"
]

launcher_symbol_code_point_names = [
"apps",
"folder",
"settings"
]
shared_symbol_font_sizes = [
16 # Fits with montserrat 14 in lv_list as icon with text
]

# Resolve file path relative to this script so it can be executed from any CWD
base_dir = os.path.dirname(__file__)
if base_dir:
os.chdir(base_dir)

codepoints_url = "https://github.com/google/material-design-icons/raw/refs/heads/master/variablefont/MaterialSymbolsRounded%5BFILL,GRAD,opsz,wght%5D.codepoints"
ttf_url = "https://github.com/google/material-design-icons/raw/refs/heads/master/variablefont/MaterialSymbolsRounded%5BFILL,GRAD,opsz,wght%5D.ttf"

codepoints_filename = "MaterialSymbolsRounded.codepoints"
ttf_filename = "MaterialSymbolsRounded.ttf"

download_file(codepoints_url, codepoints_filename)
download_file(ttf_url, ttf_filename)

codepoints_map_path = codepoints_filename
codepoints_map = read_code_points_map(codepoints_map_path)

# Shared symbols
shared_symbol_code_points = get_code_points(codepoints_map, shared_symbol_code_point_names)
generate_icon_fonts(ttf_filename, shared_symbol_font_sizes, shared_symbol_code_points, "material_symbols_shared")
generate_icon_names(codepoints_map, shared_symbol_code_point_names, "lvgl_symbols_shared.h")

# Statusbar symbols
statusbar_symbol_code_points = get_code_points(codepoints_map, statusbar_symbol_code_point_names)
generate_icon_fonts(ttf_filename, [20], statusbar_symbol_code_points, "material_symbols_statusbar")
generate_icon_names(codepoints_map, statusbar_symbol_code_point_names, "lvgl_symbols_statusbar.h")

# Launcher symbols
launcher_symbol_code_points = get_code_points(codepoints_map, launcher_symbol_code_point_names)
generate_icon_fonts(ttf_filename, [36], launcher_symbol_code_points, "material_symbols_launcher")
generate_icon_names(codepoints_map, launcher_symbol_code_point_names, "lvgl_symbols_launcher.h")

4 changes: 4 additions & 0 deletions Modules/lvgl-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ tactility_add_module(lvgl-module
INCLUDE_DIRS Include/
REQUIRES ${REQUIRES_LIST}
)

tactility_get_module_name("lvgl-module" MODULE_NAME)

target_compile_definitions(${MODULE_NAME} PUBLIC "-DLV_LVGL_H_INCLUDE_SIMPLE")
31 changes: 31 additions & 0 deletions Modules/lvgl-module/Include/tactility/lvgl_fonts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#pragma once

#include <lvgl.h>

#ifdef __cplusplus
extern "C" {
#endif

extern const lv_font_t material_symbols_statusbar_20;

extern const lv_font_t material_symbols_shared_16;

extern const lv_font_t material_symbols_launcher_36;

//#define lvgl_get_text_font_smaller() &lv_font_montserrat_12
// TODO: Make function so it's easier to use this cross-platform
#define LVGL_TEXT_FONT_DEFAULT &lv_font_montserrat_14
#define LVGL_TEXT_FONT_LARGER &lv_font_montserrat_18

// TODO: Make function so it's easier to use this cross-platform
#define LVGL_SYMBOL_FONT_DEFAULT &material_symbols_shared_16

#define LVGL_SYMBOL_FONT_LAUNCHER &material_symbols_launcher_36

// TODO: Make function so it's easier to use this cross-platform
#define LVGL_TOPBAR_FONT &material_symbols_statusbar_20
#define LVGL_TOPBAR_ICON_HEIGHT 20

#ifdef __cplusplus
}
#endif
2 changes: 1 addition & 1 deletion Modules/lvgl-module/Include/tactility/lvgl_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void lvgl_unlock(void);
*
* @return true if running, false otherwise.
*/
bool lvgl_is_running();
bool lvgl_is_running(void);

#ifdef __cplusplus
}
Expand Down
5 changes: 5 additions & 0 deletions Modules/lvgl-module/Include/tactility/lvgl_symbols_launcher.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#define LVGL_SYMBOL_APPS "\xEE\x97\x83"
#define LVGL_SYMBOL_FOLDER "\xEE\x8B\x87"
#define LVGL_SYMBOL_SETTINGS "\xEE\xA2\xB8"
44 changes: 44 additions & 0 deletions Modules/lvgl-module/Include/tactility/lvgl_symbols_shared.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#pragma once

#define LVGL_SYMBOL_ADD "\xEE\x85\x85"
#define LVGL_SYMBOL_APPS "\xEE\x97\x83"
#define LVGL_SYMBOL_AREA_CHART "\xEE\x9D\xB0"
#define LVGL_SYMBOL_APP_REGISTRATION "\xEE\xBD\x80"
#define LVGL_SYMBOL_CALENDAR_MONTH "\xEE\xAF\x8C"
#define LVGL_SYMBOL_CABLE "\xEE\xBF\xA6"
#define LVGL_SYMBOL_CIRCLE "\xEE\xBD\x8A"
#define LVGL_SYMBOL_CLOSE "\xEE\x97\x8D"
#define LVGL_SYMBOL_CLOUD "\xEF\x85\x9C"
#define LVGL_SYMBOL_CHECK "\xEE\x97\x8A"
#define LVGL_SYMBOL_DELETE "\xEE\xA4\xAE"
#define LVGL_SYMBOL_DEVICES "\xEE\x8C\xA6"
#define LVGL_SYMBOL_DISPLAY_SETTINGS "\xEE\xAE\x97"
#define LVGL_SYMBOL_EDIT_NOTE "\xEE\x9D\x85"
#define LVGL_SYMBOL_ELECTRIC_BOLT "\xEE\xB0\x9C"
#define LVGL_SYMBOL_FOLDER "\xEE\x8B\x87"
#define LVGL_SYMBOL_DEPLOYED_CODE "\xEF\x9C\xA0"
#define LVGL_SYMBOL_DOWNLOAD "\xEF\x82\x90"
#define LVGL_SYMBOL_FORUM "\xEE\xA2\xAF"
#define LVGL_SYMBOL_GAMEPAD "\xEE\x8C\x8F"
#define LVGL_SYMBOL_HELP "\xEE\xA3\xBD"
#define LVGL_SYMBOL_HUB "\xEE\xA7\xB4"
#define LVGL_SYMBOL_IMAGE "\xEE\x8F\xB4"
#define LVGL_SYMBOL_KEYBOARD_ARROW_UP "\xEE\x8C\x96"
#define LVGL_SYMBOL_LIGHTBULB "\xEE\xA4\x8F"
#define LVGL_SYMBOL_LANGUAGE "\xEE\xA2\x94"
#define LVGL_SYMBOL_LISTS "\xEE\xA6\xB9"
#define LVGL_SYMBOL_MAIL "\xEE\x85\x99"
#define LVGL_SYMBOL_MENU "\xEE\x97\x92"
#define LVGL_SYMBOL_MOP "\xEE\x8A\x8D"
#define LVGL_SYMBOL_MORE_VERT "\xEE\x97\x94"
#define LVGL_SYMBOL_MUSIC_NOTE "\xEE\x90\x85"
#define LVGL_SYMBOL_NOTE_ADD "\xEE\xA2\x9C"
#define LVGL_SYMBOL_POWER_SETTINGS_NEW "\xEF\xA3\x87"
#define LVGL_SYMBOL_REFRESH "\xEE\x97\x95"
#define LVGL_SYMBOL_SEARCH "\xEE\xA2\xB6"
#define LVGL_SYMBOL_SETTINGS "\xEE\xA2\xB8"
#define LVGL_SYMBOL_TOOLBAR "\xEE\xA7\xB7"
#define LVGL_SYMBOL_NAVIGATION "\xEE\x95\x9D"
#define LVGL_SYMBOL_KEYBOARD_ALT "\xEF\x80\xA8"
#define LVGL_SYMBOL_USB "\xEE\x87\xA0"
#define LVGL_SYMBOL_WIFI "\xEE\x98\xBE"
19 changes: 19 additions & 0 deletions Modules/lvgl-module/Include/tactility/lvgl_symbols_statusbar.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#define LVGL_SYMBOL_LOCATION_ON "\xEF\x87\x9B"
#define LVGL_SYMBOL_CLOUD "\xEF\x85\x9C"
#define LVGL_SYMBOL_SD_CARD "\xEE\x98\xA3"
#define LVGL_SYMBOL_SD_CARD_ALERT "\xEF\x81\x97"
#define LVGL_SYMBOL_SIGNAL_WIFI_0_BAR "\xEF\x82\xB0"
#define LVGL_SYMBOL_NETWORK_WIFI_1_BAR "\xEE\xAF\xA4"
#define LVGL_SYMBOL_NETWORK_WIFI_2_BAR "\xEE\xAF\x96"
#define LVGL_SYMBOL_NETWORK_WIFI_3_BAR "\xEE\xAF\xA1"
#define LVGL_SYMBOL_SIGNAL_WIFI_4_BAR "\xEF\x81\xA5"
#define LVGL_SYMBOL_SIGNAL_WIFI_OFF "\xEE\x87\x9A"
#define LVGL_SYMBOL_BATTERY_ANDROID_FRAME_1 "\xEF\x89\x97"
#define LVGL_SYMBOL_BATTERY_ANDROID_FRAME_2 "\xEF\x89\x96"
#define LVGL_SYMBOL_BATTERY_ANDROID_FRAME_3 "\xEF\x89\x95"
#define LVGL_SYMBOL_BATTERY_ANDROID_FRAME_4 "\xEF\x89\x94"
#define LVGL_SYMBOL_BATTERY_ANDROID_FRAME_5 "\xEF\x89\x93"
#define LVGL_SYMBOL_BATTERY_ANDROID_FRAME_6 "\xEF\x89\x92"
#define LVGL_SYMBOL_BATTERY_ANDROID_FRAME_BOLT "\xEF\x89\x90"
Loading
Loading