mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-10-17 02:45:05 +00:00
- Refactored many apps' UI/UX - Improve material themes - Fix for Tab5 flickering on v1 - Extend dts parser for i2c address/reg support in code - Fix for I2C Scanner glitch where it would show devices that aren't connected - Add name labels to I2C Scanner's scanned devices
61 lines
1.9 KiB
C
61 lines
1.9 KiB
C
// SPDX-License-Identifier: Apache-2.0
|
|
#pragma once
|
|
|
|
#include <lvgl.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** User-configurable theme settings */
|
|
typedef struct {
|
|
bool is_dark;
|
|
/** Use the monochrome theme, also on colour displays. Monochrome and greyscale displays always use it. */
|
|
bool is_mono;
|
|
/** Slow-refresh displays (e.g. e-paper) never show animations */
|
|
bool animations_enabled;
|
|
lv_color_t color_primary;
|
|
lv_color_t color_secondary;
|
|
lv_color_t color_error;
|
|
/** Smaller spacing and controls, for small screens (see lvgl_theme_is_compact()) */
|
|
bool is_compact;
|
|
/** Use color_surface as the surface (screen background) colour, instead of the theme's own. Not used by the monochrome theme. */
|
|
bool surface_override;
|
|
lv_color_t color_surface;
|
|
} LvglThemeSettings;
|
|
|
|
/**
|
|
* @brief Gets the theme settings, or the defaults when no settings were set.
|
|
* @param[out] settings the current theme settings
|
|
*/
|
|
void lvgl_theme_get_settings(LvglThemeSettings* settings);
|
|
|
|
/**
|
|
* @brief Gets the default theme settings for this device.
|
|
* @param[out] settings the default theme settings
|
|
*/
|
|
void lvgl_theme_get_default_settings(LvglThemeSettings* settings);
|
|
|
|
/**
|
|
* @brief Checks whether the active theme is the monochrome theme: on monochrome and greyscale displays, or when selected in the settings.
|
|
* @return true when the monochrome theme is active
|
|
*/
|
|
bool lvgl_theme_is_mono(void);
|
|
|
|
/**
|
|
* @brief Checks whether the theme settings use the compact UI density: smaller spacing and controls, for small screens.
|
|
* The device's default density is defined in its `device.properties`.
|
|
* @return true when the UI is compact
|
|
*/
|
|
bool lvgl_theme_is_compact(void);
|
|
|
|
/**
|
|
* @brief Sets the theme settings. They are used for displays that are added afterwards, e.g. when LVGL (re)starts.
|
|
* @param[in] settings the theme settings
|
|
*/
|
|
void lvgl_theme_set_settings(const LvglThemeSettings* settings);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|