Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9466bf02ed | ||
|
|
acbd43bc65 | ||
|
|
06d79002e1 |
No files matched your search
@@ -1,4 +1,9 @@
|
||||
# Changelog
|
||||
## [1.3.2] - 2026-06-17
|
||||
### Fixed
|
||||
- Unified scroll containers so content stays out of scrollbar tracks and scroll positions clamp cleanly at the bottom.
|
||||
- Android meditation audio downloads now show a localized network-permission/connectivity modal when the host cannot be resolved.
|
||||
|
||||
## [1.3.1] - 2026-06-17
|
||||
### Fixed
|
||||
- Fixed Android orientation resizing and habit import merging by name.
|
||||
|
||||
@@ -61,8 +61,8 @@ FLINT_SRCS := $(filter-out $(FLINT_ICON_ASSETS_C),$(wildcard $(FLINT_DIR)/src/*.
|
||||
FLINT_WEB_SRCS := $(filter-out $(FLINT_DIR)/src/flint_file_dialog.c,$(FLINT_SRCS))
|
||||
FLINT_WINDOWS_SRCS := $(filter-out $(FLINT_DIR)/src/flint_file_dialog.c,$(FLINT_SRCS))
|
||||
FLINT_INCLUDE := -I$(FLINT_DIR)/include
|
||||
FLINT_CURL_CFLAGS ?= $(shell pkg-config --cflags libcurl 2>/dev/null)
|
||||
FLINT_CURL_LDLIBS ?= $(shell pkg-config --libs libcurl 2>/dev/null)
|
||||
FLINT_CURL_CFLAGS ?= $(shell pkg-config --cflags libcurl 2>/dev/null || curl-config --cflags 2>/dev/null)
|
||||
FLINT_CURL_LDLIBS ?= $(shell pkg-config --libs libcurl 2>/dev/null || curl-config --libs 2>/dev/null)
|
||||
SQLITE_DIR := vendor/sqlite
|
||||
SQLITE_BUILD_DIR := $(BUILD_OBJ_DIR)/sqlite
|
||||
SQLITE_AMALGAMATION_C := $(SQLITE_BUILD_DIR)/sqlite3.c
|
||||
@@ -72,13 +72,8 @@ SQLITE_INCLUDE := -I$(SQLITE_BUILD_DIR)
|
||||
TEST_BIN_DIR := $(BUILD_BIN_DIR)/tests
|
||||
STORAGE_IMPORT_TEST := $(TEST_BIN_DIR)/storage_import_test
|
||||
FLINT_TEXT_SCALING_TEST := $(TEST_BIN_DIR)/flint_text_scaling_test
|
||||
ifneq ($(strip $(FLINT_CURL_LDLIBS)),)
|
||||
FLINT_RUNTIME_ASSET_CFLAGS := -DFLINT_HAS_LIBCURL=1 $(FLINT_CURL_CFLAGS)
|
||||
FLINT_RUNTIME_ASSET_LDLIBS := $(FLINT_CURL_LDLIBS)
|
||||
else
|
||||
FLINT_RUNTIME_ASSET_CFLAGS :=
|
||||
FLINT_RUNTIME_ASSET_LDLIBS :=
|
||||
endif
|
||||
|
||||
APP_SRCS := \
|
||||
src/main.c \
|
||||
@@ -147,7 +142,7 @@ WEB_ASSET_FILES := $(shell find web-assets -type f 2>/dev/null)
|
||||
UNPACKAGED_AUDIO_DIR := unpackaged_assets/audio
|
||||
MEDITATION_AUDIO_ZIP := web-assets/dl/inbe-meditation-audio-v1.zip
|
||||
|
||||
.PHONY: all native run test dist appimage clean clean-linux clean-raylib android-check-keystore android-copy-assets android-debug android-release android-bundle android-install android-install-release android-clean package-unpackaged-assets windows windows64 windows32 web
|
||||
.PHONY: all native run test dist appimage clean clean-linux clean-raylib android-check-keystore android-copy-assets android-debug android-release android-bundle android-install android-install-release android-clean package-unpackaged-assets windows-runtime-assets-check windows windows64 windows32 web
|
||||
.NOTPARALLEL: dist windows windows64 windows32 android-release android-bundle
|
||||
|
||||
all: native
|
||||
@@ -353,11 +348,16 @@ $(APPIMAGE_TARGET): $(TARGET) $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPIMAGE_DESKTOP)
|
||||
echo "appimagetool is missing. Re-enter the flake shell with: nix develop"; \
|
||||
exit 1; \
|
||||
}
|
||||
@command -v patchelf >/dev/null || { \
|
||||
echo "patchelf is missing. Re-enter the flake shell with: nix develop"; \
|
||||
exit 1; \
|
||||
}
|
||||
rm -rf $(LINUX_APPDIR)
|
||||
rm -rf $(LINUX_DIST_DIR)/*.AppDir
|
||||
rm -f $(LINUX_DIST_DIR)/*.AppImage
|
||||
mkdir -p $(LINUX_APPDIR)/usr/bin $(LINUX_APPDIR)/usr/share/applications $(LINUX_APPDIR)/usr/share/icons/hicolor/512x512/apps
|
||||
cp $(TARGET) $(LINUX_APPDIR)/usr/bin/$(APP_NAME)
|
||||
patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 $(LINUX_APPDIR)/usr/bin/$(APP_NAME)
|
||||
cp $(LINUX_APPIMAGE_APPRUN) $(LINUX_APPDIR)/AppRun
|
||||
chmod +x $(LINUX_APPDIR)/AppRun
|
||||
cp $(LINUX_APPIMAGE_DESKTOP) $(LINUX_APPDIR)/$(APP_NAME).desktop
|
||||
@@ -525,9 +525,14 @@ package-unpackaged-assets:
|
||||
rm -f $(MEDITATION_AUDIO_ZIP)
|
||||
cd $(UNPACKAGED_AUDIO_DIR) && find . -mindepth 2 -type f -name '*.ogg' -exec zip -9 -r $(abspath $(MEDITATION_AUDIO_ZIP)) {} + && zip -9 -r $(abspath $(MEDITATION_AUDIO_ZIP)) LICENSE.md MANIFEST.txt
|
||||
|
||||
windows64: $(WIN64_TARGET)
|
||||
windows-runtime-assets-check:
|
||||
@echo "Windows runtime asset downloads are not wired into this build yet"; \
|
||||
echo "Refusing to build Windows binaries that cannot download meditation audio."; \
|
||||
exit 1
|
||||
|
||||
windows32: $(WIN32_TARGET)
|
||||
windows64: windows-runtime-assets-check $(WIN64_TARGET)
|
||||
|
||||
windows32: windows-runtime-assets-check $(WIN32_TARGET)
|
||||
|
||||
windows:
|
||||
$(MAKE) windows64
|
||||
@@ -568,4 +573,7 @@ endif
|
||||
ifeq ($(strip $(RAY_RAYLIB_CONFIG)),)
|
||||
$(error RAY_RAYLIB_CONFIG is not set. Enter the ray flake shell with 'nix develop')
|
||||
endif
|
||||
ifeq ($(strip $(FLINT_CURL_LDLIBS)),)
|
||||
$(error libcurl pkg-config metadata is missing. Runtime asset downloads are required; enter the flake shell with 'nix develop' or set FLINT_CURL_CFLAGS/FLINT_CURL_LDLIBS explicitly)
|
||||
endif
|
||||
endif
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 39 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 75 KiB |
@@ -35,8 +35,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdk 19
|
||||
targetSdk 35
|
||||
versionCode 29
|
||||
versionName "1.3.1"
|
||||
versionCode 30
|
||||
versionName "1.3.2"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.net.URL;
|
||||
|
||||
public class MainActivity extends NativeActivity {
|
||||
@@ -249,6 +252,9 @@ public class MainActivity extends NativeActivity {
|
||||
}
|
||||
|
||||
nativeRuntimeAssetDownloadSucceeded(handle, written, status);
|
||||
} catch (UnknownHostException | SocketException | SocketTimeoutException e) {
|
||||
outputFile.delete();
|
||||
nativeRuntimeAssetDownloadFailed(handle, status, "NETWORK_UNAVAILABLE");
|
||||
} catch (Exception e) {
|
||||
outputFile.delete();
|
||||
nativeRuntimeAssetDownloadFailed(handle, status, e.getMessage());
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
### Fixed
|
||||
- Unified scroll containers so content stays out of scrollbar tracks and scroll positions clamp cleanly at the bottom.
|
||||
- Android meditation audio downloads now show a localized network-permission/connectivity modal when the host cannot be resolved.
|
||||
@@ -126,6 +126,8 @@ typedef struct {
|
||||
typedef struct {
|
||||
Rectangle bounds;
|
||||
int content_height;
|
||||
int content_x;
|
||||
int content_width;
|
||||
int *scroll_offset;
|
||||
int wheel_step;
|
||||
int scrollbar_x;
|
||||
@@ -257,6 +259,7 @@ int ui_scrollbar_reserved_width(int max_scroll);
|
||||
int ui_scrollbar_content_width(int content_width, int max_scroll);
|
||||
int ui_scrollbar_safe_content_width(int content_x, int content_width,
|
||||
int scrollbar_x, int max_scroll);
|
||||
FlintUIScrollView ui_scroll_container_measure(FlintUIScrollArea area);
|
||||
FlintUIScrollView ui_scroll_container_begin(FlintUIScrollArea area);
|
||||
void ui_scroll_container_end(FlintUIScrollArea area, FlintUIScrollView view);
|
||||
int ui_draw_scrollbar(int x, int y, int viewport_h, int content_h, int *scroll_offset, int max_scroll);
|
||||
|
||||
+37
-25
@@ -2779,25 +2779,22 @@ ui_scrollbar_safe_content_width(int content_x, int content_width,
|
||||
}
|
||||
|
||||
FlintUIScrollView
|
||||
ui_scroll_container_begin(FlintUIScrollArea area)
|
||||
ui_scroll_container_measure(FlintUIScrollArea area)
|
||||
{
|
||||
static int content_drag_active = 0;
|
||||
static int content_dragging = 0;
|
||||
static int content_drag_start_y = 0;
|
||||
static int content_drag_start_scroll = 0;
|
||||
FlintUIScrollView view;
|
||||
Vector2 mouse_world = ui_mouse_world();
|
||||
int wheel_step = area.wheel_step > 0 ? area.wheel_step : flint_px(42);
|
||||
int x = (int)area.bounds.x;
|
||||
int y = (int)area.bounds.y;
|
||||
int w = (int)area.bounds.width;
|
||||
int h = (int)area.bounds.height;
|
||||
int inside = CheckCollisionPointRec(mouse_world, area.bounds);
|
||||
int captured = ui_input_captures_click(mouse_world);
|
||||
int drag_threshold = flint_px(5);
|
||||
int scrollbar_w = flint_px(8);
|
||||
int scrollbar_x = area.scrollbar_x > 0
|
||||
? area.scrollbar_x
|
||||
: x + w - scrollbar_w;
|
||||
int content_x = area.content_x > 0 ? area.content_x : x;
|
||||
int content_w = area.content_width > 0 ? area.content_width : w;
|
||||
|
||||
memset(&view, 0, sizeof(view));
|
||||
view.content_x = x;
|
||||
view.content_x = content_x;
|
||||
view.viewport_h = h;
|
||||
view.content_h = area.content_height > 0 ? area.content_height : 0;
|
||||
view.max_scroll = view.content_h - h;
|
||||
@@ -2805,19 +2802,39 @@ ui_scroll_container_begin(FlintUIScrollArea area)
|
||||
view.max_scroll = 0;
|
||||
|
||||
if(area.scroll_offset != NULL) {
|
||||
if(*area.scroll_offset < 0)
|
||||
*area.scroll_offset = 0;
|
||||
if(*area.scroll_offset > view.max_scroll)
|
||||
*area.scroll_offset = view.max_scroll;
|
||||
int scroll_offset = ui_clampi(*area.scroll_offset, 0, view.max_scroll);
|
||||
view.content_y = y - scroll_offset;
|
||||
} else {
|
||||
view.content_y = y;
|
||||
}
|
||||
view.content_w = ui_scrollbar_safe_content_width(content_x, content_w,
|
||||
scrollbar_x, view.max_scroll);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
FlintUIScrollView
|
||||
ui_scroll_container_begin(FlintUIScrollArea area)
|
||||
{
|
||||
static int content_drag_active = 0;
|
||||
static int content_dragging = 0;
|
||||
static int content_drag_start_y = 0;
|
||||
static int content_drag_start_scroll = 0;
|
||||
FlintUIScrollView view = ui_scroll_container_measure(area);
|
||||
Vector2 mouse_world = ui_mouse_world();
|
||||
int y = (int)area.bounds.y;
|
||||
int wheel_step = area.wheel_step > 0 ? area.wheel_step : flint_px(42);
|
||||
int inside = CheckCollisionPointRec(mouse_world, area.bounds);
|
||||
int captured = ui_input_captures_click(mouse_world);
|
||||
int drag_threshold = flint_px(5);
|
||||
|
||||
if(area.scroll_offset != NULL) {
|
||||
*area.scroll_offset = ui_clampi(*area.scroll_offset, 0, view.max_scroll);
|
||||
if(view.max_scroll > 0 && inside && !captured) {
|
||||
float wheel = GetMouseWheelMove();
|
||||
if(wheel != 0.0f) {
|
||||
*area.scroll_offset -= (int)(wheel * (float)wheel_step);
|
||||
if(*area.scroll_offset < 0)
|
||||
*area.scroll_offset = 0;
|
||||
if(*area.scroll_offset > view.max_scroll)
|
||||
*area.scroll_offset = view.max_scroll;
|
||||
*area.scroll_offset = ui_clampi(*area.scroll_offset, 0, view.max_scroll);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2849,10 +2866,7 @@ ui_scroll_container_begin(FlintUIScrollArea area)
|
||||
g_ui_pointer_owner = UI_POINTER_OWNER_SCROLL;
|
||||
content_dragging = 1;
|
||||
*area.scroll_offset = content_drag_start_scroll - dy;
|
||||
if(*area.scroll_offset < 0)
|
||||
*area.scroll_offset = 0;
|
||||
if(*area.scroll_offset > view.max_scroll)
|
||||
*area.scroll_offset = view.max_scroll;
|
||||
*area.scroll_offset = ui_clampi(*area.scroll_offset, 0, view.max_scroll);
|
||||
ui_set_input_blocked(1);
|
||||
}
|
||||
} else if(content_drag_active) {
|
||||
@@ -2865,8 +2879,6 @@ ui_scroll_container_begin(FlintUIScrollArea area)
|
||||
} else {
|
||||
view.content_y = y;
|
||||
}
|
||||
|
||||
view.content_w = ui_scrollbar_content_width(w, view.max_scroll);
|
||||
{
|
||||
Rectangle screen_bounds = {
|
||||
g_ui_camera.offset.x + area.bounds.x * g_ui_camera.zoom,
|
||||
|
||||
@@ -70,6 +70,12 @@ Vyzkoušet přehrání
|
||||
[meditation_music_stop_test_button]
|
||||
Zastavit test
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
Síť není dostupná
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
Nelze se připojit k serveru s meditačním audiem. Zkontrolujte síťová oprávnění Androidu a připojení k internetu a zkuste to znovu.
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -103,6 +109,9 @@ Uložit dokončená kola před ukončením?
|
||||
[cancel_button]
|
||||
Zrušit
|
||||
---
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[save_button]
|
||||
Uložit
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@ Testwiedergabe
|
||||
[meditation_music_stop_test_button]
|
||||
Test stoppen
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
Netzwerk nicht verfügbar
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
Der Meditations-Audioserver konnte nicht erreicht werden. Prüfe die Android-Netzwerkberechtigungen und deine Internetverbindung und versuche es erneut.
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -103,6 +109,9 @@ Abgeschlossene Runden vor dem Beenden speichern?
|
||||
[cancel_button]
|
||||
Abbrechen
|
||||
---
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[save_button]
|
||||
Speichern
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@ Test audio
|
||||
[meditation_music_stop_test_button]
|
||||
Stop test
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
Network unavailable
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
Could not reach the meditation audio server. Check Android network permissions and your internet connection, then try again.
|
||||
---
|
||||
[meditation_music_attribution]
|
||||
Music by Elijah_K.
|
||||
---
|
||||
@@ -106,6 +112,9 @@ Save completed rounds before exit?
|
||||
[cancel_button]
|
||||
Cancel
|
||||
---
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[save_button]
|
||||
Save
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@ Probar reproducción
|
||||
[meditation_music_stop_test_button]
|
||||
Detener prueba
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
Red no disponible
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
No se pudo acceder al servidor de audio de meditación. Revisa los permisos de red de Android y tu conexión a internet, e inténtalo de nuevo.
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -103,6 +109,9 @@ INICIO
|
||||
[cancel_button]
|
||||
Cancelar
|
||||
---
|
||||
[ok_button]
|
||||
Aceptar
|
||||
---
|
||||
[save_button]
|
||||
Guardar
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@ Tester la lecture
|
||||
[meditation_music_stop_test_button]
|
||||
Arrêter le test
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
Réseau indisponible
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
Impossible de joindre le serveur audio de méditation. Vérifiez les autorisations réseau d'Android et votre connexion internet, puis réessayez.
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -103,6 +109,9 @@ Enregistrer les cycles terminés avant de quitter ?
|
||||
[cancel_button]
|
||||
Annuler
|
||||
---
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[save_button]
|
||||
Enregistrer
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@ Coba putar
|
||||
[meditation_music_stop_test_button]
|
||||
Hentikan tes
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
Jaringan tidak tersedia
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
Tidak dapat menjangkau server audio meditasi. Periksa izin jaringan Android dan koneksi internetmu, lalu coba lagi.
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -103,6 +109,9 @@ Simpan ronde yang selesai sebelum keluar?
|
||||
[cancel_button]
|
||||
Batal
|
||||
---
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[save_button]
|
||||
Simpan
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@ Test audio
|
||||
[meditation_music_stop_test_button]
|
||||
Ferma test
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
Rete non disponibile
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
Impossibile raggiungere il server audio per la meditazione. Controlla le autorizzazioni di rete di Android e la connessione a internet, poi riprova.
|
||||
---
|
||||
[duration_5m]
|
||||
5 min
|
||||
---
|
||||
@@ -103,6 +109,9 @@ Salvare i round completati prima di uscire?
|
||||
[cancel_button]
|
||||
Annulla
|
||||
---
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[save_button]
|
||||
Salva
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@
|
||||
[meditation_music_stop_test_button]
|
||||
テスト停止
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
ネットワークを利用できません
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
瞑想音声サーバーに接続できませんでした。Android のネットワーク権限とインターネット接続を確認してから、もう一度お試しください。
|
||||
---
|
||||
[duration_5m]
|
||||
5分
|
||||
---
|
||||
@@ -103,6 +109,9 @@
|
||||
[cancel_button]
|
||||
キャンセル
|
||||
---
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[save_button]
|
||||
保存
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@ Inner Breeze
|
||||
[meditation_music_stop_test_button]
|
||||
테스트 중지
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
네트워크를 사용할 수 없음
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
명상 오디오 서버에 연결할 수 없습니다. Android 네트워크 권한과 인터넷 연결을 확인한 뒤 다시 시도하세요.
|
||||
---
|
||||
[duration_5m]
|
||||
5분
|
||||
---
|
||||
@@ -103,6 +109,9 @@ Inner Breeze
|
||||
[cancel_button]
|
||||
취소
|
||||
---
|
||||
[ok_button]
|
||||
확인
|
||||
---
|
||||
[save_button]
|
||||
저장
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@ Testar reprodução
|
||||
[meditation_music_stop_test_button]
|
||||
Parar teste
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
Rede indisponível
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
Não foi possível acessar o servidor de áudio de meditação. Verifique as permissões de rede do Android e sua conexão com a internet, depois tente novamente.
|
||||
---
|
||||
[duration_5m]
|
||||
5m
|
||||
---
|
||||
@@ -103,6 +109,9 @@ Salvar rodadas concluídas antes de sair?
|
||||
[cancel_button]
|
||||
Cancelar
|
||||
---
|
||||
[ok_button]
|
||||
OK
|
||||
---
|
||||
[save_button]
|
||||
Salvar
|
||||
---
|
||||
|
||||
@@ -70,6 +70,12 @@ Wim Hof 呼吸
|
||||
[meditation_music_stop_test_button]
|
||||
停止测试
|
||||
---
|
||||
[meditation_music_network_error_title]
|
||||
网络不可用
|
||||
---
|
||||
[meditation_music_network_error_message]
|
||||
无法连接到冥想音频服务器。请检查 Android 网络权限和互联网连接,然后重试。
|
||||
---
|
||||
[duration_5m]
|
||||
5分钟
|
||||
---
|
||||
@@ -103,6 +109,9 @@ Wim Hof 呼吸
|
||||
[cancel_button]
|
||||
取消
|
||||
---
|
||||
[ok_button]
|
||||
确定
|
||||
---
|
||||
[save_button]
|
||||
保存
|
||||
---
|
||||
|
||||
@@ -1322,6 +1322,26 @@ handle_back_button(InbeApp *app)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
draw_global_modal(InbeApp *app)
|
||||
{
|
||||
int modal_result;
|
||||
|
||||
if(app == NULL || !app->modal.active)
|
||||
return;
|
||||
|
||||
if(app->modal.type == UIModalMeditationNetworkError) {
|
||||
modal_result = ui_draw_modal(locale_get("meditation_music_network_error_title"),
|
||||
locale_get("meditation_music_network_error_message"),
|
||||
locale_get("ok_button"),
|
||||
locale_get("ok_button"));
|
||||
if(modal_result != 0) {
|
||||
app->modal.active = 0;
|
||||
app->modal.type = UIModalNone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
updateapp(InbeApp *app)
|
||||
{
|
||||
@@ -1505,6 +1525,7 @@ updateapp(InbeApp *app)
|
||||
}
|
||||
|
||||
finish_frame:
|
||||
draw_global_modal(app);
|
||||
app_flush_deferred_settings(app);
|
||||
app->inbe.frame++;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ typedef enum {
|
||||
UIModalConfirmDeleteData,
|
||||
UIModalConfirmDeleteHabit,
|
||||
UIModalEditProgressiveStartSpeed,
|
||||
UIModalMeditationNetworkError,
|
||||
} UIModalType;
|
||||
|
||||
typedef struct {
|
||||
@@ -222,6 +223,7 @@ struct InbeApp {
|
||||
int meditation_music_playing;
|
||||
int meditation_music_test_playing;
|
||||
int meditation_music_archive_extracted;
|
||||
int meditation_music_network_error_notified;
|
||||
Music meditation_music;
|
||||
FlintRuntimeAssetDownload meditation_music_download;
|
||||
char meditation_music_cache_dir[FS_PATH_MAX];
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
|
||||
#define INBE_VERSION_MAJOR 1
|
||||
#define INBE_VERSION_MINOR 3
|
||||
#define INBE_VERSION_PATCH 1
|
||||
#define INBE_VERSION_STRING "1.3.1"
|
||||
#define INBE_VERSION_PATCH 2
|
||||
#define INBE_VERSION_STRING "1.3.2"
|
||||
|
||||
#endif
|
||||
@@ -1216,10 +1216,13 @@ draw_habits_screen(InbeApp *app)
|
||||
scroll_h = 0;
|
||||
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {(float)content_x, (float)scroll_y, (float)content_w, (float)scroll_h},
|
||||
.bounds = {0.0f, (float)scroll_y, (float)view_width, (float)scroll_h},
|
||||
.content_height = scroll_content_h,
|
||||
.content_x = content_x,
|
||||
.content_width = content_w,
|
||||
.scroll_offset = &app->habits.scroll,
|
||||
.wheel_step = flint_px(42)
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = view_width - flint_px(8)
|
||||
};
|
||||
scroll_view = ui_scroll_container_begin(scroll_area);
|
||||
content_x = scroll_view.content_x;
|
||||
@@ -1540,10 +1543,13 @@ draw_habit_session_edit_screen(InbeApp *app)
|
||||
flint_centered_column(max_w, side_padding, &content_x, &content_w);
|
||||
content_h = draw_habit_session_edit_content(app, &ctx, content_x, content_w, y, 0) - y;
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {(float)content_x, (float)y, (float)content_w, (float)viewport_h},
|
||||
.bounds = {0.0f, (float)y, (float)view_width, (float)viewport_h},
|
||||
.content_height = content_h,
|
||||
.content_x = content_x,
|
||||
.content_width = content_w,
|
||||
.scroll_offset = &app->habit_session_edit_scroll,
|
||||
.wheel_step = flint_px(42)
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = view_width - flint_px(8)
|
||||
};
|
||||
scroll_view = ui_scroll_container_begin(scroll_area);
|
||||
draw_habit_session_edit_content(app, &ctx, scroll_view.content_x, scroll_view.content_w,
|
||||
|
||||
+116
-95
@@ -94,6 +94,47 @@ draw_tutorial_paragraph(InbeApp *app, int step, int content_x, int *y, int conte
|
||||
flint_ui_paragraph_draw(tutorial_paragraph(app, step, content_w, body_font), content_x, y);
|
||||
}
|
||||
|
||||
static int
|
||||
manual_tutorial_content_height(InbeApp *app, int step, int content_w, int body_font)
|
||||
{
|
||||
int actual_content_h = 0;
|
||||
|
||||
if(step == 0) {
|
||||
actual_content_h += flint_px(170) + flint_px(22) +
|
||||
tutorial_paragraph_height(app, 0, content_w, body_font);
|
||||
} else if(step == 1) {
|
||||
actual_content_h += tutorial_paragraph_height(app, 1, content_w, body_font);
|
||||
} else if(step == 2) {
|
||||
actual_content_h += tutorial_paragraph_height(app, 2, content_w, body_font) + flint_px(68);
|
||||
if(app->inbe.progressive_speed)
|
||||
actual_content_h += flint_px(66);
|
||||
} else if(step == 3) {
|
||||
int preview_span;
|
||||
int preview_rmax;
|
||||
int slider_h = flint_px(40);
|
||||
|
||||
actual_content_h += tutorial_paragraph_height(app, 3, content_w, body_font) + flint_px(20);
|
||||
preview_span = (content_w < flint_px(132)) ? content_w : flint_px(132);
|
||||
preview_rmax = preview_span / 2;
|
||||
if(preview_rmax < flint_px(60)) preview_rmax = flint_px(60);
|
||||
if(preview_rmax > flint_px(120)) preview_rmax = flint_px(120);
|
||||
actual_content_h += flint_px(40) + (int)((float)preview_rmax * 0.72f) + flint_px(14);
|
||||
actual_content_h += slider_h + flint_px(8);
|
||||
} else if(step == 4) {
|
||||
int hold_preview_radius = flint_px(54);
|
||||
int hold_preview_extent = hold_preview_radius + flint_px(8) + flint_px(5);
|
||||
|
||||
actual_content_h += flint_px(26) + flint_px(36) + flint_px(20);
|
||||
actual_content_h += hold_preview_extent * 2 + flint_px(24);
|
||||
actual_content_h += tutorial_paragraph_height(app, 4, content_w, body_font);
|
||||
} else {
|
||||
actual_content_h += flint_px(200) + flint_px(22) +
|
||||
tutorial_paragraph_height(app, 5, content_w, body_font);
|
||||
}
|
||||
|
||||
return actual_content_h;
|
||||
}
|
||||
|
||||
void
|
||||
manual_screen_reset_layouts(InbeApp *app)
|
||||
{
|
||||
@@ -146,7 +187,7 @@ meditation_manual_draw(InbeApp *app)
|
||||
int button_y = view_height - flint_px(52);
|
||||
int content_y = title_h + flint_px(20);
|
||||
int content_h = button_y - content_y - flint_px(16);
|
||||
int content_total_h = flint_px(520);
|
||||
int content_total_h;
|
||||
FlintUIScrollArea scroll_area;
|
||||
FlintUIScrollView scroll_view;
|
||||
FlintUIParagraph paragraph;
|
||||
@@ -174,19 +215,50 @@ meditation_manual_draw(InbeApp *app)
|
||||
.line_gap = TUTORIAL_LINE_SPACING,
|
||||
.color = theme_get_text(),
|
||||
};
|
||||
for(int pass = 0; pass < 3; pass++) {
|
||||
FlintUIScrollView measured;
|
||||
|
||||
paragraph.width = content_w;
|
||||
content_total_h = meditation_music_measure_settings(app, content_w, 0, 1) +
|
||||
flint_px(34) +
|
||||
flint_ui_paragraph_height(paragraph) +
|
||||
flint_px(20);
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {0.0f, (float)content_y,
|
||||
(float)view_width, (float)content_h},
|
||||
.content_height = content_total_h,
|
||||
.content_x = content_x,
|
||||
.content_width = content_w,
|
||||
.scroll_offset = &app->manual_scroll,
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = view_width - flint_px(8)
|
||||
};
|
||||
measured = ui_scroll_container_measure(scroll_area);
|
||||
if(measured.content_w == content_w)
|
||||
break;
|
||||
content_w = measured.content_w;
|
||||
}
|
||||
paragraph.width = content_w;
|
||||
content_total_h = meditation_music_measure_settings(app, content_w, 0, 1) +
|
||||
flint_px(34) +
|
||||
flint_ui_paragraph_height(paragraph) +
|
||||
flint_px(20);
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {(float)content_x, (float)content_y,
|
||||
(float)content_w, (float)content_h},
|
||||
.bounds = {0.0f, (float)content_y,
|
||||
(float)view_width, (float)content_h},
|
||||
.content_height = content_total_h,
|
||||
.content_x = content_x,
|
||||
.content_width = content_w,
|
||||
.scroll_offset = &app->manual_scroll,
|
||||
.wheel_step = flint_px(42)
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = view_width - flint_px(8)
|
||||
};
|
||||
scroll_view = ui_scroll_container_begin(scroll_area);
|
||||
y = scroll_view.content_y;
|
||||
meditation_music_draw_guide_settings(app, content_x, content_w, &y);
|
||||
meditation_music_draw_guide_settings(app, scroll_view.content_x, scroll_view.content_w, &y);
|
||||
y += flint_px(34);
|
||||
flint_ui_paragraph_draw(paragraph, content_x, &y);
|
||||
paragraph.width = scroll_view.content_w;
|
||||
flint_ui_paragraph_draw(paragraph, scroll_view.content_x, &y);
|
||||
ui_scroll_container_end(scroll_area, scroll_view);
|
||||
meditation_music_draw_dropdown_menu(app);
|
||||
|
||||
@@ -220,6 +292,8 @@ manual_screen_draw(InbeApp *app)
|
||||
char page_label[32];
|
||||
int close_clicked = 0;
|
||||
int step = app->tutorial_step;
|
||||
FlintUIScrollArea scroll_area;
|
||||
FlintUIScrollView scroll_view;
|
||||
|
||||
if(app->exercise_type == EXERCISE_MEDITATION) {
|
||||
meditation_manual_draw(app);
|
||||
@@ -272,89 +346,46 @@ manual_screen_draw(InbeApp *app)
|
||||
if(close_clicked)
|
||||
manual_screen_close_tutorial(app, 0);
|
||||
|
||||
/* Calculate actual content height based on current step and text layouts */
|
||||
/* Don't include padding in this calculation - it's handled separately */
|
||||
int actual_content_h = 0; /* Content only, no padding */
|
||||
if(step == 0) {
|
||||
actual_content_h += flint_px(170) + flint_px(22) +
|
||||
tutorial_paragraph_height(app, 0, content_w, body_font);
|
||||
} else if(step == 1) {
|
||||
actual_content_h += tutorial_paragraph_height(app, 1, content_w, body_font);
|
||||
} else if(step == 2) {
|
||||
actual_content_h += tutorial_paragraph_height(app, 2, content_w, body_font) + flint_px(68);
|
||||
if(app->inbe.progressive_speed)
|
||||
actual_content_h += flint_px(66);
|
||||
} else if(step == 3) {
|
||||
actual_content_h += tutorial_paragraph_height(app, 3, content_w, body_font) + flint_px(20);
|
||||
/* Circle preview height - calculate actual rmax based on content_w */
|
||||
/* update_preview_bounds uses min(content_w, 132)/2 clamped to 60-120 for rmax */
|
||||
int preview_span = (content_w < flint_px(132)) ? content_w : flint_px(132);
|
||||
int preview_rmax = preview_span / 2;
|
||||
if(preview_rmax < flint_px(60)) preview_rmax = flint_px(60);
|
||||
if(preview_rmax > flint_px(120)) preview_rmax = flint_px(120);
|
||||
/* Circle is drawn at y+flint_px(40) with radius 0.72*preview_rmax */
|
||||
actual_content_h += flint_px(40) + (int)((float)preview_rmax * 0.72f) + flint_px(14);
|
||||
int slider_h = flint_px(40);
|
||||
actual_content_h += slider_h + flint_px(8);
|
||||
} else if(step == 4) {
|
||||
int hold_preview_radius = flint_px(54);
|
||||
int hold_preview_extent = hold_preview_radius + flint_px(8) + flint_px(5);
|
||||
actual_content_h += flint_px(26) + flint_px(36) + flint_px(20);
|
||||
actual_content_h += hold_preview_extent * 2 + flint_px(24);
|
||||
actual_content_h += tutorial_paragraph_height(app, 4, content_w, body_font);
|
||||
} else {
|
||||
actual_content_h += flint_px(200) + flint_px(22) +
|
||||
tutorial_paragraph_height(app, 5, content_w, body_font);
|
||||
}
|
||||
/* Calculate scroll range for virtual content space */
|
||||
int top_padding = flint_px(16);
|
||||
int total_content_h = actual_content_h + top_padding;
|
||||
int viewport_content_h = content_area_h;
|
||||
int max_scroll = total_content_h - viewport_content_h;
|
||||
if(max_scroll < 0)
|
||||
max_scroll = 0;
|
||||
{
|
||||
int top_padding = flint_px(16);
|
||||
int total_content_h;
|
||||
|
||||
/* Reset scroll position if content now fits in viewport */
|
||||
if(max_scroll == 0) {
|
||||
app->manual_scroll = 0;
|
||||
}
|
||||
/* Clamp scroll position to new max */
|
||||
app->manual_scroll = clampi(app->manual_scroll, 0, max_scroll);
|
||||
app->manual_scroll -= (int)(GetMouseWheelMove() * 24.0f);
|
||||
app->manual_scroll = clampi(app->manual_scroll, 0, max_scroll);
|
||||
for(int pass = 0; pass < 3; pass++) {
|
||||
FlintUIScrollView measured;
|
||||
|
||||
/* Handle content area drag scrolling */
|
||||
static int content_drag_active = 0;
|
||||
static int content_drag_start_y = 0;
|
||||
static int content_drag_start_scroll = 0;
|
||||
|
||||
Vector2 mouse_pos = GetMousePosition();
|
||||
int content_area_y = title_h;
|
||||
Rectangle content_bounds = {content_x, content_area_y, content_w, content_area_h};
|
||||
|
||||
if(IsMouseButtonDown(MOUSE_BUTTON_LEFT)) {
|
||||
if(!content_drag_active) {
|
||||
/* Start drag if clicking in content area */
|
||||
if(CheckCollisionPointRec(mouse_pos, content_bounds)) {
|
||||
content_drag_active = 1;
|
||||
content_drag_start_y = (int)mouse_pos.y;
|
||||
content_drag_start_scroll = app->manual_scroll;
|
||||
}
|
||||
} else {
|
||||
/* Continue drag */
|
||||
int dy = (int)mouse_pos.y - content_drag_start_y;
|
||||
app->manual_scroll = content_drag_start_scroll - dy;
|
||||
app->manual_scroll = clampi(app->manual_scroll, 0, max_scroll);
|
||||
total_content_h = manual_tutorial_content_height(app, step, content_w, body_font) +
|
||||
top_padding;
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {0.0f, (float)title_h, (float)view_width, (float)content_area_h},
|
||||
.content_height = total_content_h,
|
||||
.content_x = content_x,
|
||||
.content_width = content_w,
|
||||
.scroll_offset = &app->manual_scroll,
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = view_width - flint_px(8)
|
||||
};
|
||||
measured = ui_scroll_container_measure(scroll_area);
|
||||
if(measured.content_w == content_w)
|
||||
break;
|
||||
content_w = measured.content_w;
|
||||
}
|
||||
} else {
|
||||
content_drag_active = 0;
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {0.0f, (float)title_h, (float)view_width, (float)content_area_h},
|
||||
.content_height = manual_tutorial_content_height(app, step, content_w, body_font) +
|
||||
top_padding,
|
||||
.content_x = content_x,
|
||||
.content_width = content_w,
|
||||
.scroll_offset = &app->manual_scroll,
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = view_width - flint_px(8)
|
||||
};
|
||||
}
|
||||
|
||||
flint_clip_begin((int)app->camera.offset.x,
|
||||
(int)(app->camera.offset.y + title_h * app->camera.zoom),
|
||||
(int)(view_width * app->camera.zoom),
|
||||
(int)(content_area_h * app->camera.zoom));
|
||||
int y = title_h + flint_px(16) - app->manual_scroll;
|
||||
scroll_view = ui_scroll_container_begin(scroll_area);
|
||||
content_x = scroll_view.content_x;
|
||||
content_w = scroll_view.content_w;
|
||||
{
|
||||
int y = scroll_view.content_y + flint_px(16);
|
||||
if(step == 0) {
|
||||
int img_h = flint_px(170);
|
||||
ui_draw_tutorial_image(app->whm_1_image, "whm/1.jpg", content_x, y, content_w, img_h);
|
||||
@@ -427,18 +458,8 @@ manual_screen_draw(InbeApp *app)
|
||||
y += img_h + flint_px(22);
|
||||
draw_tutorial_paragraph(app, 5, content_x, &y, content_w, body_font);
|
||||
}
|
||||
flint_clip_end();
|
||||
|
||||
/* Draw scrollbar if content overflows */
|
||||
if(max_scroll > 0) {
|
||||
/* Transform world coordinates to screen coordinates for scrollbar function */
|
||||
int scrollbar_x = (int)(app->camera.offset.x + (content_x + content_w + flint_px(4)) * app->camera.zoom);
|
||||
int scrollbar_y = (int)(app->camera.offset.y + title_h * app->camera.zoom);
|
||||
int scrollbar_viewport = (int)(content_area_h * app->camera.zoom); /* Scaled by camera zoom */
|
||||
int total_content_screen_h = (int)(total_content_h * app->camera.zoom); /* Also scaled for ratio calculations */
|
||||
ui_draw_scrollbar(scrollbar_x, scrollbar_y, scrollbar_viewport, total_content_screen_h,
|
||||
&app->manual_scroll, max_scroll);
|
||||
}
|
||||
ui_scroll_container_end(scroll_area, scroll_view);
|
||||
|
||||
locale_format(page_label, sizeof(page_label), "tutorial_page_label",
|
||||
step + 1, (int)TUTORIAL_STEPS_COUNT);
|
||||
|
||||
@@ -749,8 +749,6 @@ practice_config_screen_draw(InbeApp *app)
|
||||
int scroll_y;
|
||||
int scroll_h;
|
||||
int content_h;
|
||||
int max_scroll;
|
||||
int scroll_bounds_w;
|
||||
int scrollbar_x;
|
||||
int controls_w;
|
||||
int y;
|
||||
@@ -804,27 +802,32 @@ practice_config_screen_draw(InbeApp *app)
|
||||
scroll_h = view_height - scroll_y;
|
||||
if(scroll_h < 0)
|
||||
scroll_h = 0;
|
||||
scroll_bounds_w = view_width - content_x;
|
||||
if(scroll_bounds_w < content_w)
|
||||
scroll_bounds_w = content_w;
|
||||
scrollbar_x = view_width - flint_px(12);
|
||||
scrollbar_x = view_width - flint_px(8);
|
||||
controls_w = content_w;
|
||||
for(int i = 0; i < 3; i++) {
|
||||
int next_controls_w;
|
||||
FlintUIScrollView measured;
|
||||
|
||||
content_h = practice_config_content_height(app, controls_w);
|
||||
max_scroll = content_h - scroll_h;
|
||||
if(max_scroll < 0)
|
||||
max_scroll = 0;
|
||||
next_controls_w = ui_scrollbar_safe_content_width(content_x, content_w,
|
||||
scrollbar_x, max_scroll);
|
||||
if(next_controls_w == controls_w)
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {0.0f, (float)scroll_y, (float)view_width, (float)scroll_h},
|
||||
.content_height = content_h,
|
||||
.content_x = content_x,
|
||||
.content_width = content_w,
|
||||
.scroll_offset = &app->settings_scroll,
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = scrollbar_x
|
||||
};
|
||||
measured = ui_scroll_container_measure(scroll_area);
|
||||
if(measured.content_w == controls_w)
|
||||
break;
|
||||
controls_w = next_controls_w;
|
||||
controls_w = measured.content_w;
|
||||
}
|
||||
content_h = practice_config_content_height(app, controls_w);
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {(float)content_x, (float)scroll_y, (float)scroll_bounds_w, (float)scroll_h},
|
||||
.bounds = {0.0f, (float)scroll_y, (float)view_width, (float)scroll_h},
|
||||
.content_height = content_h,
|
||||
.content_x = content_x,
|
||||
.content_width = content_w,
|
||||
.scroll_offset = &app->settings_scroll,
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = scrollbar_x
|
||||
@@ -832,10 +835,12 @@ practice_config_screen_draw(InbeApp *app)
|
||||
|
||||
scroll_view = ui_scroll_container_begin(scroll_area);
|
||||
if(app->exercise_type == EXERCISE_MEDITATION)
|
||||
y = meditation_config_draw_content(app, content_x, controls_w, scroll_view.content_y,
|
||||
y = meditation_config_draw_content(app, scroll_view.content_x, scroll_view.content_w,
|
||||
scroll_view.content_y,
|
||||
&draw_meditation_music_menu);
|
||||
else
|
||||
y = wim_hof_config_draw_content(app, content_x, controls_w, scroll_view.content_y,
|
||||
y = wim_hof_config_draw_content(app, scroll_view.content_x, scroll_view.content_w,
|
||||
scroll_view.content_y,
|
||||
&draw_breath_animation_menu);
|
||||
(void)y;
|
||||
ui_scroll_container_end(scroll_area, scroll_view);
|
||||
@@ -933,42 +938,50 @@ settings_screen_draw(InbeApp *app)
|
||||
settings_screen_clear_status();
|
||||
}
|
||||
|
||||
flint_clip_begin((int)app->camera.offset.x,
|
||||
(int)(app->camera.offset.y + tab_content_start_y * app->camera.zoom),
|
||||
(int)(view_width * app->camera.zoom),
|
||||
(int)(content_viewport_h * app->camera.zoom));
|
||||
|
||||
{
|
||||
int planned_content_w = content_w - flint_px(16);
|
||||
int draw_w = content_w;
|
||||
int app_content_h;
|
||||
if(planned_content_w < flint_px(160))
|
||||
planned_content_w = content_w;
|
||||
if(app->settings_tab == SETTINGS_TAB_THEME) {
|
||||
app_content_h = flint_px(76) + ui_theme_picker_height(planned_content_w) + flint_px(60);
|
||||
} else if(app->settings_tab == SETTINGS_TAB_DEVICE) {
|
||||
app_content_h = flint_px(74) + flint_px(74) + flint_px(76) + flint_px(40);
|
||||
FlintUIScrollArea scroll_area;
|
||||
|
||||
for(int pass = 0; pass < 3; pass++) {
|
||||
int planned_content_w = draw_w - flint_px(16);
|
||||
FlintUIScrollView measured;
|
||||
|
||||
if(planned_content_w < flint_px(160))
|
||||
planned_content_w = draw_w;
|
||||
if(app->settings_tab == SETTINGS_TAB_THEME) {
|
||||
app_content_h = flint_px(76) + ui_theme_picker_height(planned_content_w) + flint_px(60);
|
||||
} else if(app->settings_tab == SETTINGS_TAB_DEVICE) {
|
||||
app_content_h = flint_px(74) + flint_px(74) + flint_px(76) + flint_px(40);
|
||||
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
|
||||
app_content_h += flint_px(76);
|
||||
app_content_h += flint_px(76);
|
||||
#endif
|
||||
#if !defined(PLATFORM_ANDROID) && !defined(__ANDROID__) && !defined(ANDROID) && !defined(PLATFORM_WEB)
|
||||
app_content_h += flint_px(50);
|
||||
app_content_h += flint_px(50);
|
||||
#endif
|
||||
app_content_h += flint_px(72);
|
||||
} else {
|
||||
app_content_h = settings_data_content_height(content_w);
|
||||
app_content_h += flint_px(72);
|
||||
} else {
|
||||
app_content_h = settings_data_content_height(draw_w);
|
||||
}
|
||||
scroll_area = (FlintUIScrollArea){
|
||||
.bounds = {0.0f, (float)tab_content_start_y,
|
||||
(float)view_width, (float)content_viewport_h},
|
||||
.content_height = app_content_h,
|
||||
.content_x = content_x,
|
||||
.content_width = content_w,
|
||||
.scroll_offset = &app->settings_scroll,
|
||||
.wheel_step = flint_px(42),
|
||||
.scrollbar_x = view_width - flint_px(8)
|
||||
};
|
||||
measured = ui_scroll_container_measure(scroll_area);
|
||||
if(measured.content_w == draw_w)
|
||||
break;
|
||||
draw_w = measured.content_w;
|
||||
}
|
||||
int content_h = app_content_h;
|
||||
int y;
|
||||
FlintUIScrollArea scroll_area = {
|
||||
.bounds = {(float)content_x, (float)tab_content_start_y,
|
||||
(float)content_w, (float)content_viewport_h},
|
||||
.content_height = content_h,
|
||||
.scroll_offset = &app->settings_scroll,
|
||||
.wheel_step = flint_px(42)
|
||||
};
|
||||
FlintUIScrollView scroll_view = ui_scroll_container_begin(scroll_area);
|
||||
int draw_x = scroll_view.content_x;
|
||||
int draw_w = scroll_view.content_w;
|
||||
draw_w = scroll_view.content_w;
|
||||
y = scroll_view.content_y;
|
||||
|
||||
if(app->settings_tab == SETTINGS_TAB_THEME) {
|
||||
@@ -1089,7 +1102,6 @@ settings_screen_draw(InbeApp *app)
|
||||
y += flint_px(40);
|
||||
ui_scroll_container_end(scroll_area, scroll_view);
|
||||
}
|
||||
flint_clip_end();
|
||||
|
||||
ui_set_dropdown_clip_top(tab_content_start_y);
|
||||
if(draw_language_menu && language_dropdown_menu(app, 101))
|
||||
|
||||
@@ -63,6 +63,20 @@ safe_archive_member(const char *path)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
known_track_archive_member(const char *path)
|
||||
{
|
||||
if(path == NULL)
|
||||
return 0;
|
||||
|
||||
for(int i = 0; i < MEDITATION_MUSIC_TRACK_COUNT; i++) {
|
||||
if(strcmp(path, g_tracks[i].file) == 0)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
copy_text_checked(char *out, size_t out_size, const char *text)
|
||||
{
|
||||
@@ -134,6 +148,30 @@ set_status(InbeApp *app, const char *message)
|
||||
message);
|
||||
}
|
||||
|
||||
static int
|
||||
is_network_download_error(const FlintRuntimeAssetDownload *download)
|
||||
{
|
||||
const char *error;
|
||||
|
||||
if(download == NULL)
|
||||
return 0;
|
||||
error = download->error;
|
||||
if(error == NULL || error[0] == '\0')
|
||||
return 0;
|
||||
|
||||
if(strcmp(error, "NETWORK_UNAVAILABLE") == 0)
|
||||
return 1;
|
||||
if(strstr(error, "Unable to resolve host") != NULL ||
|
||||
strstr(error, "No address associated with hostname") != NULL ||
|
||||
strstr(error, "Could not resolve host") != NULL ||
|
||||
strstr(error, "Couldn't resolve host") != NULL ||
|
||||
strstr(error, "Name or service not known") != NULL ||
|
||||
strstr(error, "Temporary failure in name resolution") != NULL)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
format_download_status(char *out, size_t out_size,
|
||||
const FlintRuntimeAssetDownload *download)
|
||||
@@ -284,6 +322,8 @@ extract_audio_archive(InbeApp *app, const char *archive_path)
|
||||
continue;
|
||||
if(!safe_archive_member(stat.m_filename))
|
||||
continue;
|
||||
if(!known_track_archive_member(stat.m_filename))
|
||||
continue;
|
||||
|
||||
if(!join_path2(out_path, sizeof(out_path), app->meditation_music_cache_dir, "/audio/") ||
|
||||
!append_text_checked(out_path, sizeof(out_path), stat.m_filename)) {
|
||||
@@ -492,8 +532,17 @@ meditation_music_update(InbeApp *app)
|
||||
extract_audio_archive(app, archive_path);
|
||||
} else if(app->meditation_music_download.status == FLINT_RUNTIME_ASSET_ERROR ||
|
||||
app->meditation_music_download.status == FLINT_RUNTIME_ASSET_UNSUPPORTED) {
|
||||
if(app->meditation_music_download.error[0] != '\0')
|
||||
if(is_network_download_error(&app->meditation_music_download)) {
|
||||
set_status(app, locale_get("meditation_music_network_error_title"));
|
||||
if(!app->meditation_music_network_error_notified && !app->modal.active) {
|
||||
app->modal.active = 1;
|
||||
app->modal.type = UIModalMeditationNetworkError;
|
||||
app->modal.selected_button = 0;
|
||||
app->meditation_music_network_error_notified = 1;
|
||||
}
|
||||
} else if(app->meditation_music_download.error[0] != '\0') {
|
||||
set_status(app, app->meditation_music_download.error);
|
||||
}
|
||||
}
|
||||
|
||||
if(app->meditation_music_loaded) {
|
||||
@@ -512,6 +561,7 @@ start_download(InbeApp *app)
|
||||
|
||||
music_archive_path(app, archive_path, sizeof(archive_path));
|
||||
app->meditation_music_archive_extracted = 0;
|
||||
app->meditation_music_network_error_notified = 0;
|
||||
set_status(app, "Downloading audio...");
|
||||
flint_runtime_asset_download(&app->meditation_music_download,
|
||||
INBE_MEDITATION_AUDIO_URL,
|
||||
|
||||
@@ -1339,13 +1339,11 @@ migrate_legacy_file_sessions_in_dir(const char *dir_path)
|
||||
static void
|
||||
migrate_legacy_file_sessions_once(void)
|
||||
{
|
||||
int imported;
|
||||
|
||||
if(g_storage.db == NULL || g_storage.root[0] == '\0')
|
||||
return;
|
||||
if(meta_equals("legacy_file_sessions_migrated", "1"))
|
||||
return;
|
||||
imported = migrate_legacy_file_sessions_in_dir(g_storage.root);
|
||||
migrate_legacy_file_sessions_in_dir(g_storage.root);
|
||||
set_meta("legacy_file_sessions_migrated", "1");
|
||||
storage_schedule_persist();
|
||||
}
|
||||
|
||||
+4
-4
@@ -3,8 +3,8 @@
|
||||
IDI_APP_ICON ICON "inbe.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,3,1,0
|
||||
PRODUCTVERSION 1,3,1,0
|
||||
FILEVERSION 1,3,2,0
|
||||
PRODUCTVERSION 1,3,2,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -21,11 +21,11 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "waozi"
|
||||
VALUE "FileDescription", "Inner Breeze"
|
||||
VALUE "FileVersion", "1.3.1"
|
||||
VALUE "FileVersion", "1.3.2"
|
||||
VALUE "InternalName", "inbe"
|
||||
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
|
||||
VALUE "ProductName", "Inner Breeze"
|
||||
VALUE "ProductVersion", "1.3.1"
|
||||
VALUE "ProductVersion", "1.3.2"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
Reference in new issue
Block a user