Reorganize settings navigation

This commit is contained in:
waozi authored and Waozi committed 2026-07-11 18:49:15 -03:00
1 parent 3960b15465
commit d838b28ec3
29 files changed
+958 -440

No files matched your search

-4
View File
@@ -1,4 +0,0 @@
# These are supported funding model platforms
github: [waozixyz]
liberapay: waozi
+1
View File
@@ -1,4 +1,5 @@
*.sym
*.backup
*.tar.gz
*.zip
*~
+8
View File
@@ -1,4 +1,12 @@
# Changelog
## [1.1.9] - 2026-06-04
### Added
- Hierarchical settings organization with 3 main categories
- Category selection screen with card-based navigation
- Back button for hierarchical navigation
### Fixed
- Settings navigation state and Android back button behavior
## [1.1.8] - 2026-06-01
### Added
- Editable history days with pencil actions for sessions and rounds
+2 -2
View File
@@ -96,7 +96,7 @@ WEB_ASSET_FILES = inbe.ini theme.ini assets/angel.jpg assets/begin.jpg $(WEB_LOC
WEB_LDFLAGS = -sUSE_GLFW=3 -sALLOW_MEMORY_GROWTH=1 -lidbfs.js --shell-file $(WEB_SHELL) $(WEB_LOCALE_PRELOADS) $(WEB_ICON_PRELOADS) $(WEB_THEME_PRELOADS) $(WEB_SOUND_PRELOADS) --preload-file [email protected] --preload-file [email protected] --preload-file assets/angel.jpg@assets/angel.jpg --preload-file assets/begin.jpg@assets/begin.jpg
INBE_RAYLIB_CONFIG = $(filter-out -DSUPPORT_MODULE_RAUDIO=0 -DSUPPORT_FILEFORMAT_PNG=0 -DSUPPORT_FILEFORMAT_JPG=0 -DSUPPORT_FILEFORMAT_OGG=0,$(RAY_RAYLIB_CONFIG)) -DSUPPORT_MODULE_RAUDIO=1 -DSUPPORT_FILEFORMAT_JPG=1 -DSUPPORT_FILEFORMAT_OGG=1
CFLAGS = -Wall -Wextra -std=c99 -Os -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES
CFLAGS = -Wall -Wextra -std=c99 -Os -D_DEFAULT_SOURCE -D_GNU_SOURCE -ffunction-sections -fdata-sections -DSUPPORT_FILEFORMAT_JPG=1 -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES
LDFLAGS = -Wl,--gc-sections -s
.NOTPARALLEL:
@@ -327,7 +327,7 @@ $(WIN_TARGET): $(SRC) $(WIN_RAYLIB_A) $(WIN_INBE_A) | $(WINDOWS_BUILD_DIR)
$(WIN_INBE_A) \
$(WIN_RAYLIB_A) \
-L$(MCFGTHREADS)/lib \
-lopengl32 -lgdi32 -lwinmm \
-lopengl32 -lgdi32 -lwinmm -lws2_32 \
-mwindows \
$(LDFLAGS)
+2 -2
View File
@@ -34,8 +34,8 @@ android {
defaultConfig {
minSdk 19
targetSdk 35
versionCode 19
versionName "1.1.8"
versionCode 20
versionName "1.1.9"
}
+1
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:hasCode="true"
android:icon="@mipmap/ic_launcher"
+7
View File
@@ -84,6 +84,13 @@ target_include_directories(main PRIVATE
target_compile_definitions(main PRIVATE
PLATFORM_ANDROID
_DEFAULT_SOURCE
_GNU_SOURCE
_FILE_OFFSET_BITS=64
MG_TLS=MG_TLS_BUILTIN
MG_ENABLE_EPOLL=0
MG_ENABLE_POLL=1
MG_ENABLE_POSIX_FS=0
SUPPORT_MODULE_RAUDIO=1
SUPPORT_FILEFORMAT_OGG=1
)
@@ -0,0 +1,6 @@
### Added
- Hierarchical settings organization with 3 main categories
- Category selection screen with card-based navigation
- Back button for hierarchical navigation
### Fixed
- Settings navigation state and Android back button behavior
+7 -9
View File
@@ -79,7 +79,7 @@
<h1>Inner Breeze</h1>
<p>guided breathing meditation based on the Wim Hof method</p>
<p class="version">1.1.8</p>
<p class="version">1.1.9</p>
<!-- Direct Downloads -->
<nav aria-label="Platform downloads" class="platform-buttons">
@@ -170,13 +170,12 @@
<!-- Source & Donations -->
<section class="info-section">
<details class="dropdown">
<summary>source</summary>
<nav aria-label="Source code repositories" class="dropdown-links">
<a href="https://git.sr.ht/~waozi/inbe" target="_blank" rel="noopener">sr.ht</a>
<a href="https://github.com/waozixyz/inbe" target="_blank" rel="noopener">GitHub</a>
</nav>
</details>
<nav aria-label="Source code" class="platform-buttons">
<a href="https://github.com/waozixyz/inbe" target="_blank" rel="noopener" class="platform-btn web">
<img src="/icons/github.png" alt="GitHub icon"/>
<span>GitHub</span>
</a>
</nav>
<details class="dropdown">
<summary>Privacy & Donations</summary>
@@ -184,7 +183,6 @@
<p><strong>Privacy:</strong> Inner Breeze respects your privacy. The app stores session history locally on your device and does not collect, transmit, or sell any personal data. No analytics, no tracking, no accounts required.</p>
<p><strong>Free & Open Source:</strong> This app is completely free with no ads, in-app purchases, or premium features. Development is supported by voluntary donations.</p>
<nav aria-label="Donation options" class="dropdown-links">
<a href="https://donate.stripe.com/4gM3cv5boaR98HH9VvfAc04" target="_blank" rel="noopener">Donate via Stripe</a>
<a href="https://trocador.app/en/anonpay/?ticker_to=xmr&network_to=Mainnet&address=86CbC3d4a2GhT9auh6X99JhmhTMFKVVk8Q9cLrKTHkBu8LLkoNWgkBeAT3YZrvDM6NczYe8brUJNsTiFmwpWDZYnFG5kzSH&donation=True&simple_mode=True&amount=0.1&name=Inner+Breeze&[email protected]&ticker_from=xmr&network_from=Mainnet&buttonbgcolor=445588&textcolor=ffffff&bgcolor=eaeaffff" target="_blank" rel="noopener">Donate via Crypto</a>
</nav>
</div>
+18
View File
@@ -300,3 +300,21 @@ Diese Runde löschen? Das kann nicht rückgängig gemacht werden.
[delete_button]
Löschen
---
[settings_category_practice]
Praxis-Einstellungen
---
[settings_category_practice_desc]
Atmung und Sitzungen konfigurieren
---
[settings_category_app]
App-Einstellungen
---
[settings_category_app_desc]
Aussehen und Audio anpassen
---
[settings_category_about_data]
Info & Daten
---
[settings_category_about_data_desc]
Informationen anzeigen und Daten verwalten
---
+18
View File
@@ -88,6 +88,24 @@ Data
[settings_tab_about]
About
---
[settings_category_practice]
Practice Settings
---
[settings_category_practice_desc]
Configure breathing and sessions
---
[settings_category_app]
App Preferences
---
[settings_category_app_desc]
Customize appearance and audio
---
[settings_category_about_data]
About & Data
---
[settings_category_about_data_desc]
View info and manage data
---
[theme_label]
Theme
---
+18
View File
@@ -300,3 +300,21 @@ Recuento de sesiones: %d
[delete_button]
Eliminar
---
[settings_category_practice]
Configuración de Práctica
---
[settings_category_practice_desc]
Configurar respiración y sesiones
---
[settings_category_app]
Preferencias de Aplicación
---
[settings_category_app_desc]
Personalizar apariencia y audio
---
[settings_category_about_data]
Acerca de y Datos
---
[settings_category_about_data_desc]
Ver información y administrar datos
---
+18
View File
@@ -300,3 +300,21 @@ Supprimer ce cycle ? Cette action est irréversible.
[delete_button]
Supprimer
---
[settings_category_practice]
Paramètres de Pratique
---
[settings_category_practice_desc]
Configurer la respiration et les séances
---
[settings_category_app]
Préférences de l'Application
---
[settings_category_app_desc]
Personnaliser l'apparence et l'audio
---
[settings_category_about_data]
À Propos et Données
---
[settings_category_about_data_desc]
Voir les informations et gérer les données
---
+18
View File
@@ -300,3 +300,21 @@ Excluir esta rodada? Isso não pode ser desfeito.
[delete_button]
Excluir
---
[settings_category_practice]
Configurações de Prática
---
[settings_category_practice_desc]
Configurar respiração e sessões
---
[settings_category_app]
Preferências do Aplicativo
---
[settings_category_app_desc]
Personalizar aparência e áudio
---
[settings_category_about_data]
Sobre e Dados
---
[settings_category_about_data_desc]
Ver informações e gerenciar dados
---
+7 -2
View File
@@ -24,10 +24,16 @@ else
fi
TMPDIR=$(mktemp -d -p /tmp)
cleanup() {
rm -rf "$TMPDIR"
rm -f "$SITE_DIR/inbe.tar.gz"
}
trap cleanup EXIT
# Base site files
rsync -av --delete \
--exclude='local.properties' \
--exclude='.git' \
--exclude='*.sym' \
--exclude='*.o' \
--exclude='*.a' \
@@ -59,6 +65,7 @@ rsync -av --delete \
--exclude='.codex' \
--exclude='.npm' \
--exclude='.local' \
--exclude='droid' \
--exclude='vendor' \
. "$TMPDIR/"
@@ -149,9 +156,7 @@ if [ ! -f "$SITE_DIR/inbe.tar.gz" ]; then
exit 1
fi
rm -rf "$TMPDIR"
hut pages publish -d inbe.waozi.xyz "$SITE_DIR/inbe.tar.gz"
echo "✓ Published to https://inbe.waozi.xyz"
rm -f "$SITE_DIR/inbe.tar.gz"
echo "✓ Done"
+2 -2
View File
@@ -4,10 +4,10 @@ max_breaths 30
pause_seconds 2
sound_volume 100
tutorial_seen 1
theme 2
theme 4
dark_mode 0
fullscreen 0
on_screen_keyboard 1
progressive_speed 1
advanced_session_controls 1
language de
language en
+98 -24
View File
@@ -7,6 +7,9 @@
#include "tabs/settings_tab.h"
#include "theme.h"
#include "theme_meta.h"
#if defined(LOTUS_BUILD)
#include "lotus_settings.h"
#endif
#include "version.h"
#include "ui/ui.h"
#include "ui/dpi.h"
@@ -51,6 +54,37 @@ Color c_text, c_bg, c_circle, c_button, c_button_hover, c_icon;
/* Forward declarations for tab callbacks */
void reset_settings_preview(InbeApp *app);
#if defined(LOTUS_BUILD)
static void
sync_lotus_settings(InbeApp *app)
{
const LotusSettings *lotus;
unsigned int version;
if(app == NULL)
return;
version = lotus_settings_version();
if(app->lotus_settings_version == version)
return;
lotus = lotus_settings_get();
app->theme_id = lotus->theme;
app->dark_mode = lotus->dark_mode ? 1 : 0;
snprintf(app->language, sizeof(app->language), "%.*s",
(int)sizeof(app->language) - 1, lotus->language);
app->language_selected = 1;
if(!locale_set(app->language)) {
snprintf(app->language, sizeof(app->language), "%s", "en");
locale_set(app->language);
}
refresh_theme_colors(app->theme_id, app->dark_mode);
refresh_locale_dependent_text(app);
app->lotus_settings_version = version;
}
#endif
/* ================================================================
* TAB BAR DEFINITIONS
* ================================================================ */
@@ -184,6 +218,18 @@ sync_web_storage(void)
void
refresh_theme_colors(int theme_id, int dark_mode)
{
#if defined(LOTUS_BUILD)
(void)theme_id;
(void)dark_mode;
c_bg = lotus_alias_color("background");
c_text = lotus_alias_color("text");
c_circle = lotus_alias_color("circle");
c_button = lotus_alias_color("button");
c_button_hover = lotus_alias_color("button_hover");
c_icon = lotus_alias_color("icon");
ui_set_colors(c_text, c_bg, c_circle, c_button, c_button_hover, c_icon);
return;
#endif
if (theme_id < 0 || theme_id >= THEME_COUNT)
theme_id = ThemeSky;
@@ -301,6 +347,20 @@ update_preview_bounds(Inbe *inbe, int content_w, int content_h)
set_circle_bounds(inbe, rmin, rmax);
}
static void
inbe_settings_path(char *out, size_t out_size)
{
char apps_path[FS_PATH_MAX];
char inbe_path[FS_PATH_MAX];
snprintf(apps_path, sizeof(apps_path), "%s/apps", data_root());
if(!DirectoryExists(apps_path))
MakeDirectory(apps_path);
snprintf(inbe_path, sizeof(inbe_path), "%s/apps/inbe", data_root());
if(!DirectoryExists(inbe_path))
MakeDirectory(inbe_path);
snprintf(out, out_size, "%s/apps/inbe/settings.ini", data_root());
}
static void
register_all_themes(void)
{
@@ -320,7 +380,7 @@ load_config(void)
const char *paths[] = {
"inbe.ini",
"apps/inbe.ini",
"apps/inbe/inbe.ini",
"../inbe/inbe.ini",
0
};
@@ -452,13 +512,9 @@ reset_settings_preview(InbeApp *app)
void
save_settings(InbeApp *app)
{
char text[512];
const char *settings_path =
#if defined(PLATFORM_WEB)
"/home/settings.ini";
#else
"settings.ini";
#endif
char text[1024];
char settings_path[FS_PATH_MAX];
inbe_settings_path(settings_path, sizeof(settings_path));
#ifdef __ANDROID__
snprintf(text, sizeof(text),
"speed %d\nmax_rounds %d\nmax_breaths %d\npause_seconds %d\nsound_volume %d\ntutorial_seen %d\ntheme %d\ndark_mode %d\nfullscreen %d\non_screen_keyboard %d\nprogressive_speed %d\nadvanced_session_controls %d\nplay_in_background %d\nlanguage %s\n",
@@ -507,12 +563,8 @@ save_settings(InbeApp *app)
static void
load_settings(InbeApp *app)
{
const char *settings_path =
#if defined(PLATFORM_WEB)
"/home/settings.ini";
#else
"settings.ini";
#endif
char settings_path[FS_PATH_MAX];
inbe_settings_path(settings_path, sizeof(settings_path));
rini_data settings = rini_load(settings_path);
int speed = rini_get_value_fallback(settings, "speed", 6);
@@ -533,6 +585,7 @@ load_settings(InbeApp *app)
app->sound_volume = clampi(sound_volume, SETTINGS_VOLUME_MIN, SETTINGS_VOLUME_MAX);
app->inbe.progressive_speed = rini_get_value_fallback(settings, "progressive_speed", 1) != 0;
app->advanced_session_controls = rini_get_value_fallback(settings, "advanced_session_controls", 0) != 0;
app->language_needs_save = 0;
{
const char *language = rini_get_value_text(settings, "language");
if(language != NULL && language[0] != '\0') {
@@ -544,13 +597,18 @@ load_settings(InbeApp *app)
}
} else {
snprintf(app->language, sizeof(app->language), "%s", "en");
app->language_selected = 0;
app->language_selected = app->tutorial_seen ? 1 : 0;
app->language_needs_save = app->language_selected;
locale_set(app->language);
}
app->language_index = locale_current_index();
if(app->language_index < 0)
app->language_index = 0;
}
#if defined(LOTUS_BUILD)
sync_lotus_settings(app);
#endif
#ifdef __ANDROID__
app->inbe.play_in_background = rini_get_value_fallback(settings, "play_in_background",
1 // Default to enabled on Android
@@ -1062,6 +1120,10 @@ inbe_app_init(void *vapp) {
update_circle_bounds_for_view(&app->inbe, ui_clamp_px(SETTINGS_TITLE_H, 48, 60),
ui_clamp_px(TAB_BAR_H, 54, 66) + ui_px(80));
load_settings(app);
if(app->language_needs_save) {
save_settings(app);
app->language_needs_save = 0;
}
update_circle_bounds_for_view(&app->inbe, ui_clamp_px(SETTINGS_TITLE_H, 48, 60),
ui_clamp_px(TAB_BAR_H, 54, 66) + 80);
data_init();
@@ -1141,11 +1203,6 @@ inbe_app_init(void *vapp) {
if(app->globe_icon.id == 0) {
app->globe_icon = load_icon_texture("globe.png");
}
if(app->stripe_icon.id == 0) {
app->stripe_icon = load_icon_texture("stripe.png");
}
if(app->monero_icon.id == 0) {
app->monero_icon = load_icon_texture("monero.png");
}
@@ -1156,12 +1213,19 @@ inbe_app_init(void *vapp) {
if(app->begin_image.id == 0) {
app->begin_image = load_asset_texture("begin.jpg");
}
#if !defined(LOTUS_BUILD)
if(!app->language_selected)
app->inbe.screen = InbeScreenLanguage;
else if(!app->tutorial_seen)
app->inbe.screen = InbeScreenManual;
else
app->inbe.screen = InbeScreenStart;
#else
if(!app->tutorial_seen)
app->inbe.screen = InbeScreenManual;
else
app->inbe.screen = InbeScreenStart;
#endif
/* Reset modal state */
app->modal.active = 0;
@@ -1189,8 +1253,17 @@ handle_back_button(InbeApp *app)
case InbeScreenSettings:
if(app->settings_dirty)
save_settings(app);
app->inbe.screen = InbeScreenStart;
app->settings_scroll = 0;
/* Hierarchical navigation: back button goes up one level */
if(app->settings_category != -1) {
/* In a sub-tab, go back to category selection */
app->settings_category = -1;
app->settings_sub_tab = 0;
app->settings_scroll = 0;
} else {
/* At category selection, go to homepage */
app->inbe.screen = InbeScreenStart;
app->settings_scroll = 0;
}
break;
case InbeScreenHistory:
@@ -1572,6 +1645,9 @@ inbe_app_update_draw(void *vapp, Rectangle viewport) {
dpi_update(view_width, view_height);
ui_init(view_width, view_height, dpi_ui_scale());
#if defined(LOTUS_BUILD)
sync_lotus_settings(app);
#endif
update_circle_bounds_for_view(&app->inbe, ui_clamp_px(SETTINGS_TITLE_H, 48, 60),
ui_clamp_px(TAB_BAR_H, 54, 66) + ui_px(80));
@@ -1630,9 +1706,7 @@ inbe_app_destroy(void *vapp)
SafeUnloadTexture(app->pencil_icon);
SafeUnloadTexture(app->save_icon);
SafeUnloadTexture(app->telegram_icon);
SafeUnloadTexture(app->globe_icon);
SafeUnloadTexture(app->monero_icon);
SafeUnloadTexture(app->stripe_icon);
SafeUnloadTexture(app->angel_image);
SafeUnloadTexture(app->begin_image);
+34 -1
View File
@@ -38,6 +38,32 @@ enum {
ICON_SIZE_LARGE_MAX = 44
};
enum {
SETTINGS_CATEGORY_PRACTICE = 0,
SETTINGS_CATEGORY_APP,
SETTINGS_CATEGORY_ABOUT_DATA,
SETTINGS_CATEGORY_COUNT
};
enum {
PRACTICE_SUBTAB_BREATHING = 0,
PRACTICE_SUBTAB_SESSION,
PRACTICE_SUBTAB_COUNT
};
enum {
APP_SUBTAB_SOUND = 0,
APP_SUBTAB_VISUAL,
APP_SUBTAB_LANGUAGE,
APP_SUBTAB_COUNT
};
enum {
ABOUT_DATA_SUBTAB_DATA = 0,
ABOUT_DATA_SUBTAB_ABOUT,
ABOUT_DATA_SUBTAB_COUNT
};
enum {
SETTINGS_TAB_BREATHING = 0,
SETTINGS_TAB_SESSION,
@@ -103,7 +129,6 @@ struct InbeApp {
Texture2D save_icon;
Texture2D telegram_icon;
Texture2D globe_icon;
Texture2D stripe_icon;
Texture2D monero_icon;
Texture2D angel_image;
@@ -124,11 +149,16 @@ struct InbeApp {
int settings_drag_content_y;
int settings_dirty;
int settings_tab;
int settings_category;
int settings_sub_tab;
int device_picker_open;
int device_picker_scroll;
int fullscreen_enabled;
int on_screen_keyboard_enabled;
char language[16];
int language_selected;
int language_index;
int language_needs_save;
int manual_scroll;
int manual_drag_scrollbar;
int manual_drag_content;
@@ -141,6 +171,9 @@ struct InbeApp {
int theme_id;
int dark_mode;
#if defined(LOTUS_BUILD)
unsigned int lotus_settings_version;
#endif
int history_scroll;
int history_drag_scrollbar;
int history_drag_content;
+4
View File
@@ -17,8 +17,10 @@
#define FS_PATH_MAX 512
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-truncation"
#endif
#if defined(PLATFORM_WEB)
#include <emscripten.h>
@@ -805,4 +807,6 @@ data_list_sessions(data_session_callback callback, void *user)
iterate_session_dates_ex(list_sessions_callback_ex, &ctx);
}
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
+50 -9
View File
@@ -37,6 +37,45 @@ void file_dialog_init(FileDialog *dlg)
dlg->cursor = 0;
}
static void copy_text_bounded(char *dst, size_t dst_size, const char *src)
{
size_t len = 0;
if(dst == NULL || dst_size == 0)
return;
if(src == NULL)
src = "";
while(len + 1 < dst_size && src[len] != '\0')
len++;
memcpy(dst, src, len);
dst[len] = '\0';
}
static void join_path_bounded(char *dst, size_t dst_size, const char *base, const char *name, char sep)
{
size_t len = 0;
if(dst == NULL || dst_size == 0)
return;
dst[0] = '\0';
if(base == NULL || base[0] == '\0') {
copy_text_bounded(dst, dst_size, name);
return;
}
while(len + 1 < dst_size && base[len] != '\0') {
dst[len] = base[len];
len++;
}
if(len + 1 < dst_size && len > 0 && dst[len - 1] != '/' && dst[len - 1] != '\\')
dst[len++] = sep;
for(size_t i = 0; len + 1 < dst_size && name != NULL && name[i] != '\0'; i++)
dst[len++] = name[i];
dst[len] = '\0';
}
static void get_default_export_path(char *path, size_t size, const char *filename)
{
(void)filename; /* Will use in the Windows path */
@@ -45,16 +84,18 @@ static void get_default_export_path(char *path, size_t size, const char *filenam
char home[MAX_PATH];
/* CSIDL_DOWNLOADS = 0x0006 */
if(SHGetFolderPathA(NULL, 0x0006, NULL, 0, home) == S_OK) {
snprintf(path, size, "%s\\%s", home, filename);
join_path_bounded(path, size, home, filename, '\\');
} else {
snprintf(path, size, "%s", filename);
copy_text_bounded(path, size, filename);
}
#elif defined(__APPLE__)
const char *base = getenv("HOME");
if(base != NULL) {
snprintf(path, size, "%s/Downloads/%s", base, filename);
char downloads[512];
join_path_bounded(downloads, sizeof(downloads), base, "Downloads", '/');
join_path_bounded(path, size, downloads, filename, '/');
} else {
snprintf(path, size, "%s", filename);
copy_text_bounded(path, size, filename);
}
#else
/* Linux and other Unix-like systems */
@@ -62,19 +103,19 @@ static void get_default_export_path(char *path, size_t size, const char *filenam
if(base != NULL) {
/* Try Downloads first, fall back to home */
char downloads[512];
snprintf(downloads, sizeof(downloads), "%s/Downloads", base);
join_path_bounded(downloads, sizeof(downloads), base, "Downloads", '/');
if(DirectoryExists(downloads)) {
snprintf(path, size, "%s/%s", downloads, filename);
join_path_bounded(path, size, downloads, filename, '/');
} else {
snprintf(path, size, "%s/%s", base, filename);
join_path_bounded(path, size, base, filename, '/');
}
} else {
/* Fallback to current directory */
struct passwd *pw = getpwuid(getuid());
if(pw != NULL && pw->pw_dir != NULL) {
snprintf(path, size, "%s/%s", pw->pw_dir, filename);
join_path_bounded(path, size, pw->pw_dir, filename, '/');
} else {
snprintf(path, size, "%s", filename);
copy_text_bounded(path, size, filename);
}
}
#endif
+26
View File
@@ -437,6 +437,26 @@ load_locale_file_for_code(const char *code, char **out_text)
#endif
}
#if defined(LOTUS_BUILD)
static void
load_locale_overlay_for_code(LocaleEntry **entries, size_t *count, size_t *cap, const char *scope, const char *code)
{
char path[96];
char *text = NULL;
if(scope == NULL || scope[0] == '\0')
return;
if(code == NULL || code[0] == '\0')
code = "en";
snprintf(path, sizeof(path), "locales/%s/%s.txt", scope, code);
if(load_file_text_from_paths(path, &text)) {
load_locale_text_into(entries, count, cap, text);
UnloadFileText(text);
}
}
#endif
static void
load_defaults(void)
{
@@ -483,6 +503,9 @@ load_base_locale(void)
load_locale_text_into(&g_base_entries, &g_base_count, &g_base_cap, text);
UnloadFileText(text);
}
#if defined(LOTUS_BUILD)
load_locale_overlay_for_code(&g_base_entries, &g_base_count, &g_base_cap, "lotus", "en");
#endif
}
static void
@@ -549,6 +572,9 @@ locale_set(const char *code)
if(load_locale_file_for_code(code, &text)) {
load_locale_text_into(&g_active_entries, &g_active_count, &g_active_cap, text);
UnloadFileText(text);
#if defined(LOTUS_BUILD)
load_locale_overlay_for_code(&g_active_entries, &g_active_count, &g_active_cap, "lotus", code);
#endif
set_current_code(code);
return 1;
}
+16
View File
@@ -3183,6 +3183,22 @@ static int mz_stat64(const char *path, struct __stat64 *buffer)
#define MZ_FREOPEN(p, m, s) freopen64(p, m, s)
#define MZ_DELETE_FILE remove
#elif defined(__ANDROID__)
#ifndef MINIZ_NO_TIME
#include <utime.h>
#endif
#define MZ_FOPEN(f, m) fopen(f, m)
#define MZ_FCLOSE fclose
#define MZ_FREAD fread
#define MZ_FWRITE fwrite
#define MZ_FTELL64 ftell
#define MZ_FSEEK64 fseek
#define MZ_FILE_STAT_STRUCT stat
#define MZ_FILE_STAT stat
#define MZ_FFLUSH fflush
#define MZ_FREOPEN(p, m, s) freopen(p, m, s)
#define MZ_DELETE_FILE remove
#elif defined(__APPLE__) || defined(__FreeBSD__) || (defined(__linux__) && defined(__x86_64__))
#ifndef MINIZ_NO_TIME
#include <utime.h>
+4 -4
View File
@@ -117,12 +117,12 @@
#if defined(__STRICT_ANSI__)
#define MZ_FORCEINLINE
#elif defined(_MSC_VER)
#if defined(_MSC_VER)
#define MZ_FORCEINLINE __forceinline
#elif defined(__GNUC__)
#define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__))
#define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__, __unused__))
#elif defined(__STRICT_ANSI__)
#define MZ_FORCEINLINE
#else
#define MZ_FORCEINLINE inline
#endif
+4
View File
@@ -36,8 +36,10 @@ enum {
};
/* Suppress GCC format-truncation warnings - paths are safely sized in practice */
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-truncation"
#endif
/* Viewport dimensions - set by inbe_app_update_draw before calling draw functions */
extern int view_width;
@@ -1452,4 +1454,6 @@ history_tab_draw(InbeApp *app)
}
}
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
+572 -374
View File
File diff suppressed because it is too large. Load diff
+3 -1
View File
@@ -117,6 +117,8 @@ text_layout_parse(const char *input, Texture2D icon, UIIconType icon_type, int i
void
text_layout_reflow(TextLayout *layout, int max_width, int font_size, int line_height)
{
(void)line_height;
if(layout == NULL || layout->elements == NULL || layout->element_count == 0) {
return;
}
@@ -312,4 +314,4 @@ text_layout_free(TextLayout *layout)
/* Clear the structure */
memset(layout, 0, sizeof(TextLayout));
}
}
+9 -4
View File
@@ -8,16 +8,16 @@
#include <math.h>
/* Global UI state */
static int ui_view_width = 320;
static int ui_view_height = 560;
int ui_view_width = 320;
int ui_view_height = 560;
static Color c_text, c_bg, c_circle, c_button, c_button_hover, c_icon;
void
ui_init(int width, int height, float dpi)
{
(void)dpi;
ui_view_width = width;
ui_view_height = height;
/* dpi parameter is now ignored - we use the global DPI cache */
}
void
@@ -846,7 +846,10 @@ ui_draw_dropdown_menu(InbeApp *app, int id)
int bevel_width = (int)(dpi_ui_scale() + 0.5f);
if(bevel_width < 1) bevel_width = 1;
int expand = bevel_width + ui_px(2); /* Extra expansion for hover highlights */
BeginScissorMode(x - expand, dropdown_y - expand, w + expand * 2, dropdown_h + expand * 2);
BeginScissorMode((int)(app->camera.offset.x + (float)(x - expand) * app->camera.zoom),
(int)(app->camera.offset.y + (float)(dropdown_y - expand) * app->camera.zoom),
(int)((float)(w + expand * 2) * app->camera.zoom),
(int)((float)(dropdown_h + expand * 2) * app->camera.zoom));
/* Draw options */
for(int i = 0; i < option_count; i++) {
@@ -1387,6 +1390,8 @@ ui_text_layout_reflow_if_needed(TextLayout *layout, int max_width)
int
ui_draw_scrollbar(InbeApp *app, int x, int y, int viewport_h, int content_h, int *scroll_offset, int max_scroll)
{
(void)app;
/* Don't show scrollbar if no scrolling needed */
if(max_scroll <= 0)
return 0;
+3
View File
@@ -94,4 +94,7 @@ int ui_text_layout_get_height(TextLayout *layout);
void ui_text_layout_free(TextLayout *layout);
void ui_text_layout_reflow_if_needed(TextLayout *layout, int max_width);
extern int ui_view_height;
extern int ui_view_width;
#endif
+2 -2
View File
@@ -3,7 +3,7 @@
#define INBE_VERSION_MAJOR 1
#define INBE_VERSION_MINOR 1
#define INBE_VERSION_PATCH 8
#define INBE_VERSION_STRING "1.1.8"
#define INBE_VERSION_PATCH 9
#define INBE_VERSION_STRING "1.1.9"
#endif