mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-08-21 17:35:06 +00:00
Compare commits
No commits in common. "8e79cfec0332c9d5d666b42c7e5cf7d0c6eb24d9" and "a9340ae345df0acfdda3b13b460f3d0f67c97a09" have entirely different histories.
8e79cfec03
...
a9340ae345
@ -72,9 +72,6 @@
|
|||||||
|
|
||||||
## Lower Priority
|
## Lower Priority
|
||||||
|
|
||||||
- lvgl-module has a keyboard.cpp that creates a `keyboard_group`. This group is set as the default group, so it can also work with trackball(= LVGL "encoder").
|
|
||||||
Make a separate group that is the default group. The keyboard can then use it (or use its own).
|
|
||||||
The basic idea is to invert the ownership: now the keyboard group is made the default group, but it's probably more logical to have the default group used by the keyboard.
|
|
||||||
- lvgl-module's spinner relies on hard-coded spinner asset from Tactility main project.
|
- lvgl-module's spinner relies on hard-coded spinner asset from Tactility main project.
|
||||||
- Localize all apps
|
- Localize all apps
|
||||||
- Support hot-plugging SD card (note: this is not possible if they require the CS pin hack)
|
- Support hot-plugging SD card (note: this is not possible if they require the CS pin hack)
|
||||||
|
|||||||
@ -19,10 +19,6 @@ void lvgl_keyboard_on_start_lvgl() {
|
|||||||
lvgl_lock();
|
lvgl_lock();
|
||||||
keyboard_group = lv_group_create();
|
keyboard_group = lv_group_create();
|
||||||
check(keyboard_group);
|
check(keyboard_group);
|
||||||
// We currently set this group as the default, so it doesn't only get (manually added) textareas,
|
|
||||||
// but gets all widgets by default. This is a temporary work-around until a proper default group is
|
|
||||||
// created to fix the trackball issue (see trackball.cpp and ideas.md, search for "group")
|
|
||||||
lv_group_set_default(keyboard_group);
|
|
||||||
lvgl_unlock();
|
lvgl_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,8 +77,6 @@ error_t lvgl_keyboard_add(struct Device* device, lv_display_t* display, lv_indev
|
|||||||
lv_indev_set_display(indev, display);
|
lv_indev_set_display(indev, display);
|
||||||
}
|
}
|
||||||
|
|
||||||
lvgl_keyboard_enable(indev);
|
|
||||||
|
|
||||||
*out_indev = indev;
|
*out_indev = indev;
|
||||||
return ERROR_NONE;
|
return ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
#include <lvgl/devices/trackball.h>
|
#include <lvgl/devices/trackball.h>
|
||||||
#include <lvgl/devices/device_context.h>
|
#include <lvgl/devices/device_context.h>
|
||||||
#include <lvgl/devices/keyboard.h>
|
|
||||||
#include <lvgl/lvgl.h>
|
#include <lvgl/lvgl.h>
|
||||||
|
|
||||||
#include <tactility/drivers/trackball.h>
|
#include <tactility/drivers/trackball.h>
|
||||||
@ -155,13 +154,6 @@ error_t lvgl_trackball_add(struct Device* device, lv_display_t* display, lv_inde
|
|||||||
}
|
}
|
||||||
recenter_cursor(ctx, indev);
|
recenter_cursor(ctx, indev);
|
||||||
|
|
||||||
// Encoder indevs are useless without a group (LVGL dispatch bails out immediately if indev->group is NULL)
|
|
||||||
// Use the keyboard group for now, until it's refactored into a proper global/shared group. See ideas.md
|
|
||||||
// When refactoring this, you probably want to remove the calls to lvgl_keyboard_* below.
|
|
||||||
if (ctx->settings.mode == LVGL_TRACKBALL_MODE_ENCODER) {
|
|
||||||
lvgl_keyboard_enable(indev);
|
|
||||||
}
|
|
||||||
|
|
||||||
*out_indev = indev;
|
*out_indev = indev;
|
||||||
return ERROR_NONE;
|
return ERROR_NONE;
|
||||||
}
|
}
|
||||||
@ -204,14 +196,12 @@ error_t lvgl_trackball_set_settings(lv_indev_t* indev, const struct LvglTrackbal
|
|||||||
|
|
||||||
if (mode_changed) {
|
if (mode_changed) {
|
||||||
if (settings->mode == LVGL_TRACKBALL_MODE_POINTER) {
|
if (settings->mode == LVGL_TRACKBALL_MODE_POINTER) {
|
||||||
lvgl_keyboard_disable(indev);
|
|
||||||
lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER);
|
lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER);
|
||||||
recenter_cursor(ctx, indev);
|
recenter_cursor(ctx, indev);
|
||||||
show_cursor(ctx, indev);
|
show_cursor(ctx, indev);
|
||||||
} else {
|
} else {
|
||||||
hide_cursor(ctx);
|
hide_cursor(ctx);
|
||||||
lv_indev_set_type(indev, LV_INDEV_TYPE_ENCODER);
|
lv_indev_set_type(indev, LV_INDEV_TYPE_ENCODER);
|
||||||
lvgl_keyboard_enable(indev);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,6 @@ lv_obj_t* build_window_widget(lv_obj_t* content, WindowCreateWidgetsFn create_wi
|
|||||||
lv_obj_set_style_pad_all(widget, 0, LV_STATE_DEFAULT);
|
lv_obj_set_style_pad_all(widget, 0, LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_border_width(widget, 0, LV_STATE_DEFAULT);
|
lv_obj_set_style_border_width(widget, 0, LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_radius(widget, 0, LV_STATE_DEFAULT);
|
lv_obj_set_style_radius(widget, 0, LV_STATE_DEFAULT);
|
||||||
lv_obj_remove_flag(widget, LV_OBJ_FLAG_SCROLLABLE);
|
|
||||||
if (create_widgets != nullptr) {
|
if (create_widgets != nullptr) {
|
||||||
create_widgets(widget, user_data);
|
create_widgets(widget, user_data);
|
||||||
}
|
}
|
||||||
@ -198,8 +197,6 @@ error_t window_manager_start(void) {
|
|||||||
lv_obj_set_style_pad_all(real_widget, 0, LV_STATE_DEFAULT);
|
lv_obj_set_style_pad_all(real_widget, 0, LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_border_width(real_widget, 0, LV_STATE_DEFAULT);
|
lv_obj_set_style_border_width(real_widget, 0, LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_radius(real_widget, 0, LV_STATE_DEFAULT);
|
lv_obj_set_style_radius(real_widget, 0, LV_STATE_DEFAULT);
|
||||||
// See build_window_widget()'s identical call for why.
|
|
||||||
lv_obj_remove_flag(real_widget, LV_OBJ_FLAG_SCROLLABLE);
|
|
||||||
|
|
||||||
content_widget = (screen_init != nullptr) ? screen_init(real_widget) : nullptr;
|
content_widget = (screen_init != nullptr) ? screen_init(real_widget) : nullptr;
|
||||||
if (content_widget == nullptr) {
|
if (content_widget == nullptr) {
|
||||||
|
|||||||
@ -374,7 +374,6 @@ static lv_obj_t* windowManagerScreenInit(lv_obj_t* root) {
|
|||||||
lv_obj_set_style_bg_color(vertical_container, lv_color_black(), LV_STATE_DEFAULT);
|
lv_obj_set_style_bg_color(vertical_container, lv_color_black(), LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_border_width(vertical_container, 0, LV_STATE_DEFAULT);
|
lv_obj_set_style_border_width(vertical_container, 0, LV_STATE_DEFAULT);
|
||||||
lv_obj_set_style_radius(vertical_container, 0, LV_STATE_DEFAULT);
|
lv_obj_set_style_radius(vertical_container, 0, LV_STATE_DEFAULT);
|
||||||
lv_obj_remove_flag(vertical_container, LV_OBJ_FLAG_SCROLLABLE);
|
|
||||||
|
|
||||||
lvgl::statusbar_create(vertical_container);
|
lvgl::statusbar_create(vertical_container);
|
||||||
|
|
||||||
@ -384,7 +383,6 @@ static lv_obj_t* windowManagerScreenInit(lv_obj_t* root) {
|
|||||||
lv_obj_set_width(app_container, LV_PCT(100));
|
lv_obj_set_width(app_container, LV_PCT(100));
|
||||||
lv_obj_set_flex_grow(app_container, 1);
|
lv_obj_set_flex_grow(app_container, 1);
|
||||||
lv_obj_set_flex_flow(app_container, LV_FLEX_FLOW_COLUMN);
|
lv_obj_set_flex_flow(app_container, LV_FLEX_FLOW_COLUMN);
|
||||||
lv_obj_remove_flag(app_container, LV_OBJ_FLAG_SCROLLABLE);
|
|
||||||
|
|
||||||
// Parented to root (not app_container/vertical_container) so it overlays on top of
|
// Parented to root (not app_container/vertical_container) so it overlays on top of
|
||||||
// everything, including the statusbar, regardless of which app is showing. Hidden until a
|
// everything, including the statusbar, regardless of which app is showing. Hidden until a
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
static error_t paths_get_user_data_root_path(char* out_path, size_t out_path_size) {
|
static error_t get_user_data_root_path(char* out_path, size_t out_path_size) {
|
||||||
#if defined(CONFIG_TT_USER_DATA_LOCATION_INTERNAL)
|
#if defined(CONFIG_TT_USER_DATA_LOCATION_INTERNAL)
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
const char* mount_point = "/data";
|
const char* mount_point = "/data";
|
||||||
@ -21,7 +21,7 @@ static error_t paths_get_user_data_root_path(char* out_path, size_t out_path_siz
|
|||||||
std::strcpy(out_path, mount_point);
|
std::strcpy(out_path, mount_point);
|
||||||
return ERROR_NONE;
|
return ERROR_NONE;
|
||||||
#elif defined(CONFIG_TT_USER_DATA_LOCATION_SD)
|
#elif defined(CONFIG_TT_USER_DATA_LOCATION_SD)
|
||||||
FileSystem* found = nullptr;
|
struct FileSystem* found = nullptr;
|
||||||
file_system_for_each(&found, [](FileSystem* fs, void* context) {
|
file_system_for_each(&found, [](FileSystem* fs, void* context) {
|
||||||
auto* owner = file_system_get_owner(fs);
|
auto* owner = file_system_get_owner(fs);
|
||||||
if (owner == nullptr || device_get_type(owner) != &SDCARD_TYPE) {
|
if (owner == nullptr || device_get_type(owner) != &SDCARD_TYPE) {
|
||||||
@ -44,7 +44,7 @@ extern "C" {
|
|||||||
error_t paths_get_user_data_path(char* out_path, size_t out_path_size) {
|
error_t paths_get_user_data_path(char* out_path, size_t out_path_size) {
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
char root[64];
|
char root[64];
|
||||||
error_t error = paths_get_user_data_root_path(root, sizeof(root));
|
error_t error = get_user_data_root_path(root, sizeof(root));
|
||||||
if (error != ERROR_NONE) {
|
if (error != ERROR_NONE) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,6 @@
|
|||||||
#include <tactility/filesystem/file_system.h>
|
#include <tactility/filesystem/file_system.h>
|
||||||
#include <tactility/memory.h>
|
#include <tactility/memory.h>
|
||||||
#include <tactility/module.h>
|
#include <tactility/module.h>
|
||||||
#include <tactility/paths.h>
|
|
||||||
#include <tactility/preferences.h>
|
#include <tactility/preferences.h>
|
||||||
#include <tactility/properties_file.h>
|
#include <tactility/properties_file.h>
|
||||||
#include <tactility/wifi_auto_scan.h>
|
#include <tactility/wifi_auto_scan.h>
|
||||||
@ -244,8 +243,6 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = {
|
|||||||
// drivers/keyboard
|
// drivers/keyboard
|
||||||
DEFINE_MODULE_SYMBOL(keyboard_read_key),
|
DEFINE_MODULE_SYMBOL(keyboard_read_key),
|
||||||
DEFINE_MODULE_SYMBOL(KEYBOARD_TYPE),
|
DEFINE_MODULE_SYMBOL(KEYBOARD_TYPE),
|
||||||
// drivers/paths
|
|
||||||
DEFINE_MODULE_SYMBOL(paths_get_user_data_path),
|
|
||||||
// drivers/pointer
|
// drivers/pointer
|
||||||
DEFINE_MODULE_SYMBOL(pointer_enter_sleep),
|
DEFINE_MODULE_SYMBOL(pointer_enter_sleep),
|
||||||
DEFINE_MODULE_SYMBOL(pointer_exit_sleep),
|
DEFINE_MODULE_SYMBOL(pointer_exit_sleep),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user