cleanup and fixes

This commit is contained in:
waozi committed 2026-06-14 11:40:56 -03:00
1 parent 801f49d470
commit 7ff89fd78b
49 files changed
+2099 -2509

No files matched your search

+56 -4
View File
@@ -17,16 +17,21 @@ LINUX_OBJ_DIR := $(BUILD_OBJ_DIR)/linux
LINUX_BIN_DIR := $(BUILD_BIN_DIR)/linux
LINUX_DIST_DIR := $(BUILD_DIST_DIR)/linux
ANDROID_BUILD_DIR := $(BUILD_DIR)/android
WEB_OBJ_DIR := $(BUILD_OBJ_DIR)/web
WEB_DIST_DIR := $(BUILD_DIST_DIR)/web
RAYLIB_DIR := vendor/raylib/src
RAYLIB_BUILD_DIR := $(LINUX_OBJ_DIR)/$(ARCH)/native/raylib
RAYLIB_A := $(RAYLIB_BUILD_DIR)/libraylib.a
WEB_RAYLIB_BUILD_DIR := $(WEB_OBJ_DIR)/raylib
WEB_RAYLIB_A := $(WEB_RAYLIB_BUILD_DIR)/libraylib.web.a
RAYLIB_SOURCES := $(wildcard $(RAYLIB_DIR)/*.c) $(wildcard $(RAYLIB_DIR)/*.h)
FLINT_DIR := flint
FLINT_ICON_FILES := $(wildcard $(FLINT_DIR)/icons/*.png)
FLINT_ICON_ASSETS_C := $(FLINT_DIR)/src/flint_icon_assets.c
FLINT_SRCS := $(filter-out $(FLINT_ICON_ASSETS_C),$(wildcard $(FLINT_DIR)/src/*.c)) $(FLINT_ICON_ASSETS_C)
FLINT_WEB_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)
@@ -50,6 +55,7 @@ APP_SRCS := \
src/main.c \
src/inbe.c \
src/app.c \
src/app_preferences.c \
src/app_session.c \
src/habits/habits.c \
src/meditation_music.c \
@@ -59,7 +65,7 @@ APP_SRCS := \
src/data.c \
src/storage.c \
src/miniz.c \
src/tabs/history_tab.c \
src/android/android_device.c \
src/tabs/language_tab.c \
src/tabs/manual_tab.c \
src/tabs/settings_tab.c
@@ -77,10 +83,16 @@ SRC := $(APP_SRCS) $(EMBEDDED_ASSETS_C)
APP_INCLUDE := -Isrc -Isrc/android
APP_RAYLIB_CONFIG := $(filter-out -DSUPPORT_MODULE_RAUDIO=0 -DSUPPORT_FILEFORMAT_PNG=0 -DSUPPORT_FILEFORMAT_JPG=0 -DSUPPORT_FILEFORMAT_OGG=0 -DSUPPORT_FILEFORMAT_MP3=0,$(RAY_RAYLIB_CONFIG)) -DSUPPORT_MODULE_RAUDIO=1 -DSUPPORT_FILEFORMAT_JPG=1 -DSUPPORT_FILEFORMAT_OGG=1 -DSUPPORT_FILEFORMAT_MP3=1
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 -DFLINT_EMBEDDED_ONLY=1 $(FLINT_RUNTIME_ASSET_CFLAGS)
WEB_CFLAGS := $(filter-out -std=c99,$(CFLAGS)) -std=gnu99
LDFLAGS := -Wl,--gc-sections -s
BINARY_NAME := $(APP_NAME)-linux-$(ARCH)
TARGET := $(LINUX_BIN_DIR)/$(BINARY_NAME)
WEB_CC ?= emcc
WEB_AR ?= emar
WEB_CACHE_BUSTER ?= $(shell git rev-parse --short HEAD 2>/dev/null || date +%s)
WEB_TARGET := $(WEB_DIST_DIR)/index.html
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
@@ -103,7 +115,7 @@ $(STORAGE_IMPORT_TEST): tests/storage_import_test.c src/storage.c src/storage.h
tests/storage_import_test.c src/storage.c src/habits/habits.c src/miniz.c $(SQLITE_SRC) \
-lm -lpthread -ldl
$(BUILD_OBJ_DIR) $(LINUX_BIN_DIR) $(LINUX_DIST_DIR) $(ANDROID_BUILD_DIR) $(TEST_BIN_DIR):
$(BUILD_OBJ_DIR) $(LINUX_BIN_DIR) $(LINUX_DIST_DIR) $(ANDROID_BUILD_DIR) $(TEST_BIN_DIR) $(WEB_OBJ_DIR) $(WEB_DIST_DIR):
mkdir -p $@
assets/fonts:
@@ -136,6 +148,20 @@ $(RAYLIB_A): $(RAYLIB_SOURCES)
SDL_LIBRARIES="$(RAY_SDL_LDLIBS)" \
CUSTOM_CFLAGS="-DUSING_SDL2_PROJECT $(RAY_CFLAGS) $(APP_RAYLIB_CONFIG) -Os -ffunction-sections -fdata-sections"
$(WEB_RAYLIB_A): $(RAYLIB_SOURCES) | $(WEB_OBJ_DIR)
rm -rf $(WEB_OBJ_DIR)/raylib-src
mkdir -p $(WEB_OBJ_DIR)/raylib-src $(WEB_RAYLIB_BUILD_DIR)
cp -R $(RAYLIB_DIR)/. $(WEB_OBJ_DIR)/raylib-src/
$(MAKE) -j1 -C $(WEB_OBJ_DIR)/raylib-src \
PLATFORM=PLATFORM_WEB \
RAYLIB_LIBTYPE=STATIC \
RAYLIB_RELEASE_PATH=../raylib \
RAYLIB_MODULE_AUDIO=TRUE \
RAYLIB_MODULE_MODELS=FALSE \
CC="$(WEB_CC)" \
AR="$(WEB_AR)" \
CUSTOM_CFLAGS="$(APP_RAYLIB_CONFIG) -Os -ffunction-sections -fdata-sections"
$(SQLITE_AMALGAMATION_C) $(SQLITE_AMALGAMATION_H): $(SQLITE_DIR)/configure $(SQLITE_DIR)/manifest | $(BUILD_OBJ_DIR)
mkdir -p $(SQLITE_BUILD_DIR)
cd $(SQLITE_BUILD_DIR) && ../../../$(SQLITE_DIR)/configure
@@ -161,6 +187,33 @@ $(TARGET): Makefile $(SRC) $(FLINT_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H)
-lm -lpthread -ldl -lrt \
$(LDFLAGS)
$(WEB_TARGET): Makefile $(SRC) $(FLINT_WEB_SRCS) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_OUTPUTS) $(EMBEDDED_ASSETS_C) $(WEB_RAYLIB_A) src/web_shell.html manifest.json $(WEB_ASSET_FILES) | $(WEB_DIST_DIR)
$(WEB_CC) $(WEB_CFLAGS) \
$(APP_INCLUDE) \
$(FLINT_INCLUDE) \
$(SQLITE_INCLUDE) \
-I$(RAYLIB_DIR) \
-DPLATFORM_WEB \
-DSUPPORT_MODULE_RAUDIO=1 \
-DSUPPORT_FILEFORMAT_OGG=1 \
-DSUPPORT_FILEFORMAT_MP3=1 \
-o $@ \
$(SRC) \
$(FLINT_WEB_SRCS) \
$(SQLITE_SRC) \
$(WEB_RAYLIB_A) \
-sUSE_GLFW=3 \
-sASYNCIFY \
-sFORCE_FILESYSTEM=1 \
-sFETCH=1 \
-sALLOW_MEMORY_GROWTH=1 \
--shell-file src/web_shell.html \
-lidbfs.js \
-lm
perl -0pi -e 's/WEB_CACHE_BUSTER/$(WEB_CACHE_BUSTER)/g' $(WEB_DIST_DIR)/index.html
cp -R web-assets $(WEB_DIST_DIR)/
cp manifest.json $(WEB_DIST_DIR)/
android-copy-assets:
$(MAKE) $(FONT_OUTPUTS)
$(MAKE) $(EMBEDDED_ASSETS_C)
@@ -232,8 +285,7 @@ windows:
@exit 1
web:
@echo "Web packaging was removed with the Flint CLI layer. Add a focused script when it is needed."
@exit 1
$(MAKE) $(WEB_TARGET)
clean:
rm -rf build
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

+2 -2
View File
@@ -35,8 +35,8 @@ android {
defaultConfig {
minSdk 19
targetSdk 35
versionCode 27
versionName "1.2.6"
versionCode 28
versionName "1.3.0"
}
+1 -2
View File
@@ -9,9 +9,8 @@
android:roundIcon="@mipmap/ic_launcher_round">
<activity
android:name="xyz.waozi.inbe.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:configChanges="orientation|keyboardHidden|screenSize|uiMode"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
android:windowLayoutInDisplayCutoutMode="never">
<meta-data
+2 -1
View File
@@ -86,6 +86,7 @@ add_library(main SHARED
"${SRC_DIR}/main.c"
"${SRC_DIR}/inbe.c"
"${SRC_DIR}/app.c"
"${SRC_DIR}/app_preferences.c"
"${SRC_DIR}/app_session.c"
"${SRC_DIR}/habits/habits.c"
"${SRC_DIR}/meditation_music.c"
@@ -96,10 +97,10 @@ add_library(main SHARED
"${SRC_DIR}/storage.c"
"${SRC_DIR}/miniz.c"
"${SQLITE_AMALGAMATION_C}"
"${SRC_DIR}/android/android_device.c"
"${SRC_DIR}/android/android_import.c"
"${SRC_DIR}/android/android_runtime_assets.c"
"${SRC_DIR}/android/android_share.c"
"${SRC_DIR}/tabs/history_tab.c"
"${SRC_DIR}/tabs/language_tab.c"
"${SRC_DIR}/tabs/manual_tab.c"
"${SRC_DIR}/tabs/settings_tab.c"
@@ -1,8 +1,10 @@
package xyz.waozi.inbe;
import android.app.NativeActivity;
import android.content.pm.ActivityInfo;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Insets;
import android.net.Uri;
import android.os.Build;
@@ -39,6 +41,8 @@ public class MainActivity extends NativeActivity {
private native void nativeSetInsets(int status, int nav,
int cutoutLeft, int cutoutTop, int cutoutRight, int cutoutBottom);
private native void nativeSetSystemDark(int dark);
private native void nativeSetOrientation(int orientation);
private native void nativeWakeLockReady();
private native void nativeSetBackgroundActive(boolean active);
private native int nativeGetPlayInBackground();
@@ -49,6 +53,32 @@ public class MainActivity extends NativeActivity {
private native void nativeRuntimeAssetDownloadSucceeded(long handle, long bytes, int httpStatus);
private native void nativeRuntimeAssetDownloadFailed(long handle, int httpStatus, String error);
public void applyOrientationMode(final int mode) {
runOnUiThread(new Runnable() {
@Override
public void run() {
int requested = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
switch (mode) {
case 1:
requested = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
break;
case 2:
requested = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
break;
case 3:
requested = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
break;
default:
requested = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
break;
}
setRequestedOrientation(requested);
pushDeviceConfiguration();
requestInsetRefresh();
}
});
}
public void startRuntimeAssetDownload(final String url, final String path, final long handle) {
new Thread(new Runnable() {
@Override
@@ -226,11 +256,49 @@ public class MainActivity extends NativeActivity {
}
setupInsetsListener();
pushDeviceConfiguration();
// Notify native code that activity is ready for wake lock
nativeWakeLockReady();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
pushDeviceConfiguration();
requestInsetRefresh();
}
private void pushDeviceConfiguration() {
Configuration config = getResources().getConfiguration();
int nightMask = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;
int dark = nightMask == Configuration.UI_MODE_NIGHT_YES ? 1 : 0;
int orientation = 0;
if (config.orientation == Configuration.ORIENTATION_PORTRAIT) {
orientation = 1;
} else if (config.orientation == Configuration.ORIENTATION_LANDSCAPE) {
orientation = 2;
}
nativeSetSystemDark(dark);
nativeSetOrientation(orientation);
}
private void requestInsetRefresh() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
final View decorView = getWindow().getDecorView();
decorView.post(new Runnable() {
@Override
public void run() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
decorView.requestApplyInsets();
}
}
});
}
}
private void setupInsetsListener() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
final View decorView = getWindow().getDecorView();
@@ -0,0 +1,6 @@
### Added
- Habit tracking with default Mind, Yoga, and Fitness habits.
- Habit editing, custom colors, sync options, and deletion.
- Practice tabs with configurable themes.
### Changed
- App theme now follows the active practice theme globally.
+7 -1
View File
@@ -34,7 +34,8 @@ typedef enum {
UI_ICON_TYPE_SAVE,
UI_ICON_TYPE_PLUS,
UI_ICON_TYPE_SOUND,
UI_ICON_TYPE_STACK
UI_ICON_TYPE_STACK,
UI_ICON_TYPE_GITHUB
} UIIconType;
typedef enum {
@@ -124,6 +125,7 @@ typedef struct {
int content_height;
int *scroll_offset;
int wheel_step;
int scrollbar_x;
} FlintUIScrollArea;
typedef struct {
@@ -207,6 +209,8 @@ void ui_set_dropdown_clip_top(int top);
int ui_draw_theme_switcher(int x, int y, int w, const char *label,
const char *light_label, const char *dark_label,
int *theme_id, int *dark_mode);
int ui_draw_theme_picker(int x, int y, int w, const char *label,
int dark_mode, int *theme_id);
typedef struct UITab {
const char *label;
Texture2D icon;
@@ -236,6 +240,8 @@ FlintUIHeader ui_draw_title_header(int height, const char *title,
FlintUIPanelFrame ui_draw_modal_frame(int width, int height, const char *title,
Texture2D left_icon, UIIconType left_type,
Texture2D right_icon, UIIconType right_type);
void ui_begin_scissor(int x, int y, int w, int h);
void ui_end_scissor(void);
int ui_scrollbar_reserved_width(int max_scroll);
int ui_scrollbar_content_width(int content_width, int max_scroll);
FlintUIScrollView ui_scroll_container_begin(FlintUIScrollArea area);
+1
View File
@@ -9,6 +9,7 @@ int flint_web_viewport_width(int fallback_width);
int flint_web_viewport_height(int fallback_height);
void flint_web_viewport_size(int fallback_width, int fallback_height,
int *width, int *height);
void flint_web_set_orientation_mode(int mode);
/*
* Web builds should create a resizable raylib window in CSS-pixel units and
+6 -6
View File
@@ -32,12 +32,12 @@ static const FlintThemeCatalogColors catalog_light[FLINT_THEME_COUNT] = {
};
static const FlintThemeCatalogColors catalog_dark[FLINT_THEME_COUNT] = {
[FLINT_THEME_SKY] = {{0x18,0x28,0x38,0xFF}, {0x22,0x36,0x48,0xFF}, {0xB0,0xD0,0xEA,0xFF}, {0x50,0x80,0xB0,0xFF}, {0x30,0x50,0x70,0xFF}, {0x40,0x70,0x90,0xFF}, {0x18,0x28,0x38,0xFF}, {0x60,0xA0,0xD0,0xFF}},
[FLINT_THEME_OCEAN] = {{0x10,0x25,0x40,0xFF}, {0x1C,0x34,0x50,0xFF}, {0x98,0xC0,0xDE,0xFF}, {0x30,0x60,0x90,0xFF}, {0x20,0x40,0x60,0xFF}, {0x30,0x55,0x75,0xFF}, {0x10,0x25,0x40,0xFF}, {0x50,0x90,0xC0,0xFF}},
[FLINT_THEME_FOREST] = {{0x15,0x30,0x20,0xFF}, {0x20,0x3C,0x2A,0xFF}, {0xB4,0xD0,0xB4,0xFF}, {0x35,0x65,0x45,0xFF}, {0x25,0x45,0x30,0xFF}, {0x30,0x55,0x40,0xFF}, {0x15,0x30,0x20,0xFF}, {0x50,0x80,0x60,0xFF}},
[FLINT_THEME_SUNSET] = {{0x30,0x18,0x10,0xFF}, {0x3E,0x24,0x18,0xFF}, {0xE0,0xB0,0x90,0xFF}, {0x80,0x40,0x28,0xFF}, {0x50,0x28,0x18,0xFF}, {0x60,0x35,0x25,0xFF}, {0x30,0x18,0x10,0xFF}, {0xC0,0x50,0x30,0xFF}},
[FLINT_THEME_LAVENDER] = {{0x20,0x15,0x30,0xFF}, {0x2E,0x20,0x42,0xFF}, {0xC4,0xA8,0xD0,0xFF}, {0x50,0x35,0x70,0xFF}, {0x35,0x20,0x50,0xFF}, {0x45,0x30,0x65,0xFF}, {0x20,0x15,0x30,0xFF}, {0x90,0x60,0xB0,0xFF}},
[FLINT_THEME_CHERRY] = {{0x30,0x15,0x20,0xFF}, {0x40,0x20,0x2A,0xFF}, {0xD2,0x98,0xA8,0xFF}, {0x70,0x30,0x45,0xFF}, {0x45,0x20,0x28,0xFF}, {0x55,0x30,0x38,0xFF}, {0x30,0x15,0x20,0xFF}, {0xB0,0x40,0x60,0xFF}}
[FLINT_THEME_SKY] = {{0x18,0x28,0x38,0xFF}, {0x22,0x36,0x48,0xFF}, {0xB0,0xD0,0xEA,0xFF}, {0x50,0x80,0xB0,0xFF}, {0x30,0x50,0x70,0xFF}, {0x40,0x70,0x90,0xFF}, {0xB0,0xD0,0xEA,0xFF}, {0x60,0xA0,0xD0,0xFF}},
[FLINT_THEME_OCEAN] = {{0x10,0x25,0x40,0xFF}, {0x1C,0x34,0x50,0xFF}, {0x98,0xC0,0xDE,0xFF}, {0x30,0x60,0x90,0xFF}, {0x20,0x40,0x60,0xFF}, {0x30,0x55,0x75,0xFF}, {0x98,0xC0,0xDE,0xFF}, {0x50,0x90,0xC0,0xFF}},
[FLINT_THEME_FOREST] = {{0x15,0x30,0x20,0xFF}, {0x20,0x3C,0x2A,0xFF}, {0xB4,0xD0,0xB4,0xFF}, {0x35,0x65,0x45,0xFF}, {0x25,0x45,0x30,0xFF}, {0x30,0x55,0x40,0xFF}, {0xB4,0xD0,0xB4,0xFF}, {0x50,0x80,0x60,0xFF}},
[FLINT_THEME_SUNSET] = {{0x30,0x18,0x10,0xFF}, {0x3E,0x24,0x18,0xFF}, {0xE0,0xB0,0x90,0xFF}, {0x80,0x40,0x28,0xFF}, {0x50,0x28,0x18,0xFF}, {0x60,0x35,0x25,0xFF}, {0xE0,0xB0,0x90,0xFF}, {0xC0,0x50,0x30,0xFF}},
[FLINT_THEME_LAVENDER] = {{0x20,0x15,0x30,0xFF}, {0x2E,0x20,0x42,0xFF}, {0xC4,0xA8,0xD0,0xFF}, {0x50,0x35,0x70,0xFF}, {0x35,0x20,0x50,0xFF}, {0x45,0x30,0x65,0xFF}, {0xC4,0xA8,0xD0,0xFF}, {0x90,0x60,0xB0,0xFF}},
[FLINT_THEME_CHERRY] = {{0x30,0x15,0x20,0xFF}, {0x40,0x20,0x2A,0xFF}, {0xD2,0x98,0xA8,0xFF}, {0x70,0x30,0x45,0xFF}, {0x45,0x20,0x28,0xFF}, {0x55,0x30,0x38,0xFF}, {0xD2,0x98,0xA8,0xFF}, {0xB0,0x40,0x60,0xFF}}
};
FlintThemeId
+134 -41
View File
@@ -6,6 +6,9 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#if defined(PLATFORM_WEB)
#include <emscripten.h>
#endif
/* Global UI state */
int ui_view_width = 320;
@@ -26,6 +29,58 @@ static int g_ui_focus_count = 0;
static int g_ui_focus_tab_dir = 0;
static int g_ui_focus_text_input_active = 0;
#define UI_SCISSOR_STACK_MAX 16
static Rectangle g_ui_scissor_stack[UI_SCISSOR_STACK_MAX];
static int g_ui_scissor_stack_count = 0;
static Rectangle
ui_scissor_intersection(Rectangle a, Rectangle b)
{
float x1 = a.x > b.x ? a.x : b.x;
float y1 = a.y > b.y ? a.y : b.y;
float x2 = a.x + a.width < b.x + b.width ? a.x + a.width : b.x + b.width;
float y2 = a.y + a.height < b.y + b.height ? a.y + a.height : b.y + b.height;
if(x2 < x1)
x2 = x1;
if(y2 < y1)
y2 = y1;
return (Rectangle){x1, y1, x2 - x1, y2 - y1};
}
void
ui_begin_scissor(int x, int y, int w, int h)
{
Rectangle bounds = {x, y, w, h};
if(w < 0)
bounds.width = 0;
if(h < 0)
bounds.height = 0;
if(g_ui_scissor_stack_count > 0)
bounds = ui_scissor_intersection(g_ui_scissor_stack[g_ui_scissor_stack_count - 1], bounds);
if(g_ui_scissor_stack_count < UI_SCISSOR_STACK_MAX)
g_ui_scissor_stack[g_ui_scissor_stack_count++] = bounds;
BeginScissorMode((int)bounds.x, (int)bounds.y,
(int)bounds.width, (int)bounds.height);
}
void
ui_end_scissor(void)
{
EndScissorMode();
if(g_ui_scissor_stack_count > 0)
g_ui_scissor_stack_count--;
if(g_ui_scissor_stack_count > 0) {
Rectangle bounds = g_ui_scissor_stack[g_ui_scissor_stack_count - 1];
BeginScissorMode((int)bounds.x, (int)bounds.y,
(int)bounds.width, (int)bounds.height);
}
}
static Vector2
ui_mouse_world(void)
{
@@ -190,6 +245,7 @@ ui_icon_to_flint_icon(UIIconType type)
case UI_ICON_TYPE_PLUS: return FLINT_ICON_TYPE_PLUS;
case UI_ICON_TYPE_SOUND: return FLINT_ICON_TYPE_SOUND;
case UI_ICON_TYPE_STACK: return FLINT_ICON_TYPE_STACK;
case UI_ICON_TYPE_GITHUB: return FLINT_ICON_TYPE_GITHUB;
case UI_ICON_TYPE_NONE:
default: return FLINT_ICON_TYPE_NONE;
}
@@ -241,7 +297,7 @@ flint_ui_draw_text_input(Rectangle bounds, const char *text, int cursor_position
DrawRectangleRounded(bounds, radius, 8, style.background);
DrawRectangleRoundedLines(bounds, radius, 8, border);
BeginScissorMode(x + padding_x, y, w - padding_x * 2, h);
ui_begin_scissor(x + padding_x, y, w - padding_x * 2, h);
flint_text_draw(value, text_x, text_y, font, style.text);
if(focused && cursor_visible) {
@@ -257,7 +313,7 @@ flint_ui_draw_text_input(Rectangle bounds, const char *text, int cursor_position
int cursor_x = text_x + flint_text_measure(before_cursor, font);
DrawRectangle(cursor_x, y + flint_px(6), flint_px(2), h - flint_px(12), style.cursor);
}
EndScissorMode();
ui_end_scissor();
}
int
@@ -858,7 +914,13 @@ ui_draw_icon_link(int x, int y, int icon_size, Texture2D icon, UIIconType icon_t
}
if(hover && IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) {
#if defined(PLATFORM_WEB)
EM_ASM({
window.location.href = UTF8ToString($0);
}, url);
#else
OpenURL(url);
#endif
}
}
@@ -1228,43 +1290,16 @@ dropdown_menu_layout(const UIDropdownState *state, int *dropdown_y, int *dropdow
*dropdown_h = total_h;
}
int
ui_draw_theme_switcher(int x, int y, int w, const char *label,
const char *light_label, const char *dark_label,
int *theme_id, int *dark_mode)
static int
ui_draw_theme_grid(int x, int circle_y, int w, int dark, int *theme_id)
{
int changed = 0;
int font = flint_ui_font();
int small_font = flint_ui_font_small();
int selected = theme_id != NULL ? *theme_id : FLINT_THEME_SKY;
int dark = dark_mode != NULL ? *dark_mode : 0;
if(selected < 0 || selected >= FLINT_THEME_COUNT)
selected = FLINT_THEME_SKY;
flint_text_draw(label ? label : "Theme", x, y, font, c_text);
int light_w = flint_text_measure(light_label ? light_label : "Light", font);
int dark_w = flint_text_measure(dark_label ? dark_label : "Dark", font);
int max_label_w = light_w > dark_w ? light_w : dark_w;
int toggle_w = max_label_w * 2 + flint_px(32);
int min_toggle_w = flint_px(100);
if(toggle_w < min_toggle_w)
toggle_w = min_toggle_w;
if(toggle_w > w)
toggle_w = w;
int toggle_h = flint_px(28);
int toggle_x = x + w - toggle_w - flint_px(8);
int toggle_y = y - flint_px(2);
if(ui_draw_toggle_switch(toggle_x, toggle_y, toggle_w, toggle_h, &dark,
light_label ? light_label : "Light",
dark_label ? dark_label : "Dark")) {
if(dark_mode != NULL)
*dark_mode = dark;
changed = 1;
}
int circle_size = flint_px(36);
int label_gap = flint_px(14);
int col_gap = flint_px(20);
@@ -1288,7 +1323,6 @@ ui_draw_theme_switcher(int x, int y, int w, const char *label,
}
int start_x = x + (w - row_width) / 2;
int circle_y = y + flint_px(64);
int row_step = circle_size + label_gap + small_font + row_gap;
Vector2 mouse_world = ui_mouse_world();
@@ -1333,6 +1367,58 @@ ui_draw_theme_switcher(int x, int y, int w, const char *label,
return changed;
}
int
ui_draw_theme_switcher(int x, int y, int w, const char *label,
const char *light_label, const char *dark_label,
int *theme_id, int *dark_mode)
{
int changed = 0;
int font = flint_ui_font();
int dark = dark_mode != NULL ? *dark_mode : 0;
flint_text_draw(label ? label : "Theme", x, y, font, c_text);
int light_w = flint_text_measure(light_label ? light_label : "Light", font);
int dark_w = flint_text_measure(dark_label ? dark_label : "Dark", font);
int max_label_w = light_w > dark_w ? light_w : dark_w;
int toggle_w = max_label_w * 2 + flint_px(32);
int min_toggle_w = flint_px(100);
if(toggle_w < min_toggle_w)
toggle_w = min_toggle_w;
if(toggle_w > w)
toggle_w = w;
int toggle_h = flint_px(28);
int toggle_x = x + w - toggle_w - flint_px(8);
int toggle_y = y - flint_px(2);
if(ui_draw_toggle_switch(toggle_x, toggle_y, toggle_w, toggle_h, &dark,
light_label ? light_label : "Light",
dark_label ? dark_label : "Dark")) {
if(dark_mode != NULL)
*dark_mode = dark;
changed = 1;
}
if(ui_draw_theme_grid(x, y + flint_px(64), w, dark, theme_id))
changed = 1;
return changed;
}
int
ui_draw_theme_picker(int x, int y, int w, const char *label, int dark_mode,
int *theme_id)
{
int changed = 0;
int font = flint_ui_font();
flint_text_draw(label ? label : "Theme", x, y, font, c_text);
if(ui_draw_theme_grid(x, y + flint_px(54), w, dark_mode != 0, theme_id))
changed = 1;
return changed;
}
/* Check if an open dropdown should own the current click.
* Other UI elements should call this so menu clicks and outside-close clicks do
* not pass through to controls underneath. */
@@ -1433,12 +1519,12 @@ ui_draw_dropdown_button(int id, int x, int y, int w, int h,
int text_x = x + flint_px(12);
int text_w = arrow_x - arrow_size - flint_px(8) - text_x;
if(text_w > 0) {
BeginScissorMode((int)(g_ui_camera.offset.x + (float)text_x * g_ui_camera.zoom),
ui_begin_scissor((int)(g_ui_camera.offset.x + (float)text_x * g_ui_camera.zoom),
(int)(g_ui_camera.offset.y + (float)y * g_ui_camera.zoom),
(int)((float)text_w * g_ui_camera.zoom),
(int)((float)h * g_ui_camera.zoom));
flint_text_draw(current_name, text_x, flint_ui_text_y(current_name, y, h, font), font, c_text);
EndScissorMode();
ui_end_scissor();
}
/* Draw dropdown X icon */
@@ -1562,7 +1648,7 @@ ui_draw_dropdown_menu(int id)
DrawRectangle(x, dropdown_y, w, dropdown_h, c_button);
ui_draw_bevel(x, dropdown_y, w, dropdown_h, flint_darken(c_bg, 30), flint_lighten(c_bg, 20));
BeginScissorMode((int)(g_ui_camera.offset.x + (float)x * g_ui_camera.zoom),
ui_begin_scissor((int)(g_ui_camera.offset.x + (float)x * g_ui_camera.zoom),
(int)(g_ui_camera.offset.y + (float)dropdown_y * g_ui_camera.zoom),
(int)((float)w * g_ui_camera.zoom),
(int)((float)dropdown_h * g_ui_camera.zoom));
@@ -1590,7 +1676,7 @@ ui_draw_dropdown_menu(int id)
state->touch_pressed = 0;
state->scroll_offset = 0;
changed = 1;
EndScissorMode();
ui_end_scissor();
goto draw_arrow;
}
}
@@ -1598,7 +1684,7 @@ ui_draw_dropdown_menu(int id)
flint_text_draw(options[i], x + flint_px(12), flint_ui_text_y(options[i], option_y, option_h, font), font, c_text);
}
EndScissorMode();
ui_end_scissor();
if(max_scroll > 0)
ui_draw_scrollbar(x + w - scrollbar_w, dropdown_y + flint_px(2),
@@ -2118,7 +2204,8 @@ ui_draw_modal_frame(int width, int height, const char *title,
int
ui_scrollbar_reserved_width(int max_scroll)
{
return max_scroll > 0 ? flint_px(18) : 0;
(void)max_scroll;
return 0;
}
int
@@ -2176,7 +2263,7 @@ ui_scroll_container_begin(FlintUIScrollArea area)
}
view.content_w = ui_scrollbar_content_width(w, view.max_scroll);
BeginScissorMode((int)(g_ui_camera.offset.x + area.bounds.x * g_ui_camera.zoom),
ui_begin_scissor((int)(g_ui_camera.offset.x + area.bounds.x * g_ui_camera.zoom),
(int)(g_ui_camera.offset.y + area.bounds.y * g_ui_camera.zoom),
(int)(area.bounds.width * g_ui_camera.zoom),
(int)(area.bounds.height * g_ui_camera.zoom));
@@ -2186,12 +2273,18 @@ ui_scroll_container_begin(FlintUIScrollArea area)
void
ui_scroll_container_end(FlintUIScrollArea area, FlintUIScrollView view)
{
EndScissorMode();
int scrollbar_w = flint_px(8);
int scrollbar_x;
ui_end_scissor();
if(area.scroll_offset == NULL || view.max_scroll <= 0)
return;
ui_draw_scrollbar((int)(area.bounds.x + area.bounds.width - flint_px(10)),
scrollbar_x = area.scrollbar_x > 0
? area.scrollbar_x
: ui_view_width - scrollbar_w;
ui_draw_scrollbar(scrollbar_x,
(int)area.bounds.y,
(int)area.bounds.height,
view.content_h,
+47
View File
@@ -8,6 +8,35 @@
#include <emscripten.h>
#endif
static int g_web_orientation_mode = 0;
static void
flint_web_apply_orientation_size(int *width, int *height)
{
int w;
int h;
if(width == 0 || height == 0)
return;
w = *width;
h = *height;
if(w <= 0 || h <= 0)
return;
if(g_web_orientation_mode == 1 && w > h) {
int portrait_w = (h * 9) / 16;
if(portrait_w < 1)
portrait_w = h;
*width = portrait_w;
} else if(g_web_orientation_mode == 2 && h > w) {
int landscape_h = (w * 9) / 16;
if(landscape_h < 1)
landscape_h = w;
*height = landscape_h;
}
}
int
flint_web_viewport_width(int fallback_width)
{
@@ -48,6 +77,15 @@ flint_web_viewport_size(int fallback_width, int fallback_height,
*width = flint_web_viewport_width(fallback_width);
if(height != 0)
*height = flint_web_viewport_height(fallback_height);
flint_web_apply_orientation_size(width, height);
}
void
flint_web_set_orientation_mode(int mode)
{
if(mode < 0 || mode > 2)
mode = 0;
g_web_orientation_mode = mode;
}
unsigned int
@@ -71,6 +109,15 @@ flint_web_sync_window_size(void)
if(width == GetScreenWidth() && height == GetScreenHeight())
return 0;
#if defined(PLATFORM_WEB)
EM_ASM({
const frame = document.getElementById("canvas-frame");
if(frame) {
frame.style.width = $0 + "px";
frame.style.height = $1 + "px";
}
}, width, height);
#endif
SetWindowSize(width, height);
flint_set_view_size(width, height);
flint_dpi_update(width, height);
+1 -23
View File
@@ -53,7 +53,7 @@ Hudba na pozadí
Přehrávat hudbu na pozadí
---
[meditation_music_shuffle_label]
Zamíchat skladby
Náhodná stopa
---
[meditation_music_track_label]
Skladba
@@ -326,28 +326,6 @@ Tmavý
[on_screen_keyboard_label]
Klávesnice na obrazovce
---
[history_title]
Historie
---
[history_empty]
Zatím nejsou uložena žádná sezení.
Dokončete sezení a přidejte data.
---
[history_month_label]
Měsíc %02d
---
[history_day_label]
Den %02d
---
[history_round_short_label]
K%d
---
[history_round_label]
K%d %ds
---
[history_session_label]
%02d:%02d průměr %ds
---
[tutorial_title]
Návod
---
+1 -23
View File
@@ -53,7 +53,7 @@ Hintergrundmusik
Hintergrundmusik abspielen
---
[meditation_music_shuffle_label]
Titel mischen
Zufälliger Titel
---
[meditation_music_track_label]
Titel
@@ -326,28 +326,6 @@ Dunkel
[on_screen_keyboard_label]
Bildschirmtastatur
---
[history_title]
Verlauf
---
[history_empty]
Noch keine gespeicherten Sitzungen.
Schließen Sie eine Sitzung ab, um Daten hinzuzufügen.
---
[history_month_label]
Monat %02d
---
[history_day_label]
Tag %02d
---
[history_round_short_label]
R%d
---
[history_round_label]
R%d %ds
---
[history_session_label]
%02d:%02d durchschn. %ds
---
[tutorial_title]
Anleitung
---
+20 -24
View File
@@ -53,7 +53,7 @@ Background Music
Play background music
---
[meditation_music_shuffle_label]
Shuffle tracks
Random track
---
[meditation_music_track_label]
Track
@@ -65,7 +65,7 @@ Download audio
Redownload audio
---
[meditation_music_test_button]
Test play
Test audio
---
[duration_5m]
5m
@@ -173,6 +173,24 @@ Theme
[theme_mode_label]
Theme mode
---
[theme_system]
System
---
[orientation_label]
Orientation
---
[orientation_system]
System
---
[orientation_portrait]
Portrait
---
[orientation_landscape]
Landscape
---
[orientation_sensor]
Sensor
---
[speed_label]
Speed
---
@@ -326,28 +344,6 @@ Dark
[on_screen_keyboard_label]
On-screen keyboard
---
[history_title]
History
---
[history_empty]
No saved sessions yet.
Complete a session to add data.
---
[history_month_label]
Month %02d
---
[history_day_label]
Day %02d
---
[history_round_short_label]
R%d
---
[history_round_label]
R%d %ds
---
[history_session_label]
%02d:%02d avg %ds
---
[tutorial_title]
Tutorial
---
+1 -23
View File
@@ -53,7 +53,7 @@ Música de fondo
Reproducir música de fondo
---
[meditation_music_shuffle_label]
Mezclar pistas
Pista aleatoria
---
[meditation_music_track_label]
Pista
@@ -326,28 +326,6 @@ Oscuro
[on_screen_keyboard_label]
Teclado en pantalla
---
[history_title]
Historial
---
[history_empty]
Aún no hay sesiones guardadas.
Complete una sesión para agregar datos.
---
[history_month_label]
Mes %02d
---
[history_day_label]
Día %02d
---
[history_round_short_label]
R%d
---
[history_round_label]
R%d %ds
---
[history_session_label]
%02d:%02d promedio %ds
---
[tutorial_title]
Tutorial
---
+1 -23
View File
@@ -53,7 +53,7 @@ Musique de fond
Jouer la musique de fond
---
[meditation_music_shuffle_label]
Lecture aléatoire
Piste aléatoire
---
[meditation_music_track_label]
Piste
@@ -326,28 +326,6 @@ Sombre
[on_screen_keyboard_label]
Clavier à l'écran
---
[history_title]
Historique
---
[history_empty]
Aucune séance enregistrée.
Terminez une séance pour ajouter des données.
---
[history_month_label]
Mois %02d
---
[history_day_label]
Jour %02d
---
[history_round_short_label]
C%d
---
[history_round_label]
C%d %ds
---
[history_session_label]
%02d:%02d moy. %ds
---
[tutorial_title]
Tutoriel
---
+1 -23
View File
@@ -53,7 +53,7 @@ Musik latar
Putar musik latar
---
[meditation_music_shuffle_label]
Acak trek
Trek acak
---
[meditation_music_track_label]
Trek
@@ -324,28 +324,6 @@ Gelap
[on_screen_keyboard_label]
Keyboard di layar
---
[history_title]
Riwayat
---
[history_empty]
Belum ada sesi yang disimpan.
Selesaikan sesi untuk menambah data.
---
[history_month_label]
Bulan %02d
---
[history_day_label]
Hari %02d
---
[history_round_short_label]
R%d
---
[history_round_label]
R%d %ds
---
[history_session_label]
%02d:%02d rata %ds
---
[tutorial_title]
Tutorial
---
+1
View File
@@ -4,6 +4,7 @@ cs|Čeština
de|Deutsch
fr|Français
id|Bahasa Indonesia
it|Italiano
pt|Português
ja|日本語
ko|한국어
+451
View File
@@ -0,0 +1,451 @@
[app_title]
Inner Breeze
---
[tab_history]
Cronologia
---
[tab_habits]
Abitudini
---
[tab_practice]
Pratica
---
[habit_add_button]
Aggiungi Abitudine
---
[habit_done_button]
Fatto
---
[habit_not_done_button]
Segna Come Fatto
---
[tab_manual]
Tutorial
---
[tab_settings]
Impostazioni
---
[play_button]
AVVIA
---
[exercise_wim_hof]
Respirazione Wim Hof
---
[exercise_meditation]
Meditazione
---
[meditation_title]
Meditazione
---
[meditation_manual_title]
Meditazione
---
[meditation_manual_text]
Scegli una durata, premi avvia e siediti comodamente. Lascia che la tua attenzione si riposi sul respiro. Quando la mente vaga, ritorna gentilmente al respiro. Un gong segnala l'inizio e la fine della sessione.
---
[meditation_music_settings_title]
Musica Meditazione
---
[meditation_music_section_title]
Musica di Sfondo
---
[meditation_music_enabled_label]
Riproduci musica di sfondo
---
[meditation_music_shuffle_label]
Traccia casuale
---
[meditation_music_track_label]
Traccia
---
[meditation_music_download_button]
Scarica audio
---
[meditation_music_redownload_button]
Riscarica audio
---
[meditation_music_test_button]
Test audio
---
[duration_5m]
5 min
---
[duration_15m]
15 min
---
[duration_30m]
30 min
---
[duration_1h]
1 ora
---
[duration_2h]
2 ore
---
[breath_button]
RESPIRO
---
[results_title]
RISULTATI
---
[home_button]
HOME
---
[exit_session_title]
Esci dalla Sessione?
---
[save_completed_rounds_message]
Salvare i round completati prima di uscire?
---
[cancel_button]
Annulla
---
[save_button]
Salva
---
[save_results_button]
Salva
---
[discard_button]
Scarta
---
[all_progress_lost_message]
Tutti i progressi andranno persi.
---
[exit_button]
Esci
---
[round_times_title]
Tempi round
---
[results_rounds]
%d round
---
[results_best]
migliore %ds
---
[results_avg]
media %ds
---
[round_result_label]
Round %d %ds
---
[starting_in]
INIZIA IN %2d
---
[session_round_label]
ROUND %d
---
[settings_title]
Impostazioni
---
[settings_tab_breathing]
Respirazione
---
[settings_tab_session]
Sessione
---
[settings_tab_app]
App
---
[settings_tab_data_about]
Dati e Info
---
[settings_tab_sound]
Suono
---
[settings_tab_appearance]
Aspetto
---
[settings_tab_language]
Lingua
---
[settings_tab_data]
Dati
---
[settings_tab_about]
Info
---
[theme_label]
Tema
---
[theme_mode_label]
Modalità tema
---
[theme_system]
Sistema
---
[orientation_label]
Orientamento
---
[orientation_system]
Sistema
---
[orientation_portrait]
Verticale
---
[orientation_landscape]
Orizzontale
---
[orientation_sensor]
Sensore
---
[speed_label]
Velocità
---
[progressive_speed_label]
Velocità progressiva
---
[progressive_start_speed_label]
Velocità iniziale
---
[modify_start_speed_button]
Modifica velocità iniziale
---
[progressive_start_speed_editor_title]
Velocità iniziale
---
[play_in_background_label]
Riproduci in background
---
[max_rounds_label]
Max round
---
[max_breaths_label]
Max respiri
---
[pause_after_round_label]
Pausa dopo round
---
[advanced_session_controls_label]
Controlli avanzati sessione
---
[hold_display_label]
Visualizzazione trattenuta
---
[hold_display_stopwatch]
Cronometro
---
[hold_display_circle]
Cerchio
---
[volume_label]
Volume
---
[reset_to_defaults_label]
Ripristina predefiniti
---
[fullscreen_label]
Schermo intero
---
[language_label]
Lingua
---
[language_picker_title]
Scegli Lingua
---
[next_button]
Avanti
---
[coming_soon_label]
Prossimamente...
---
[data_management_label]
Gestione Dati
---
[data_management_button]
Gestisci dati
---
[total_sessions_label]
Sessioni Totali: %d
---
[data_size_label]
Dimensione Dati: %s
---
[storage_label]
Spazio: %s
---
[export_data_button]
Esporta Dati
---
[delete_all_data_button]
Elimina Tutti i Dati
---
[export_data_dialog_title]
Esporta Dati
---
[export_failed]
Esportazione fallita
---
[exported_label]
Esportato
---
[import_data_button]
Importa Dati
---
[import_data_dialog_title]
Importa Dati
---
[import_failed]
Importazione fallita
---
[imported_sessions]
Importate %d sessioni
---
[import_invalid_file]
File di esportazione non valido
---
[import_cancelled]
Importazione annullata
---
[export_cancelled]
Esportazione annullata
---
[no_data_to_export]
Nessun dato da esportare
---
[no_data_to_delete]
Nessun dato da eliminare
---
[delete_all_data_title]
Eliminare tutti i dati?
---
[delete_all_data_message]
Ciò eliminerà permanentemente tutte le sessioni salvate.
---
[delete_cancelled]
Eliminazione annullata
---
[deleted_sessions]
Eliminate %lld sessioni
---
[version_label]
Versione %s
---
[about_description]
Inner Breeze è una semplice app di meditazione
respiratoria per aiutarti a rilassarti
e trovare la tua calma.
---
[toggle_off]
OFF
---
[toggle_on]
ON
---
[theme_light]
Chiaro
---
[theme_dark]
Scuro
---
[on_screen_keyboard_label]
Tastiera su schermo
---
[tutorial_title]
Tutorial
---
[tutorial_page_label]
%d/%d
---
[tutorial_method_title]
Metodo
---
[tutorial_step1_title]
Passo 1: Inspirazione ed Espirazione
---
[tutorial_step2_title]
Passo 2: Espira e Trattieni
---
[tutorial_step3_title]
Passo 3: Inspira e Trattieni
---
[tutorial_progressive_speed_title]
Velocità Progressiva
---
[tutorial_step_intro]
Questa pratica respiratoria si basa sul Metodo Wim Hof.
Può essere potente. Usala con cautela.
Pratica seduto o sdraiato.
Non usarla mai mentre guidi,
in piedi o in acqua.
---
[tutorial_step_method]
Segui semplicemente 4 passi:
1. Respira ritmicamente.
2. Espira e trattieni.
3. Inspira profondamente e trattieni.
4. Espira e ripeti.
Usa l'icona ingranaggio %i per regolare round, respiri, velocità e pause.
---
[tutorial_step_breathe]
Riempi completamente i polmoni, poi lascia uscire il respiro.
Usa questo slider per impostare il ritmo del cerchio respiratorio.
Trova un ritmo che ti sembri naturale.
---
[tutorial_step_progressive_speed]
La velocità progressiva rende il primo round più facile da affrontare.
Quando è attiva, il primo round inizia più lentamente, poi aumenta gradualmente fino alla velocità selezionata.
---
[tutorial_step_exhale_hold]
Espira normalmente e trattieni.
Il numero centrale continua a contare. La modalità cerchio aggiunge linee di progresso sovrapposte.
Rilascia quando il corpo richiede aria.
---
[tutorial_step_inhale_hold]
Inspira completamente e trattieni per circa 15 secondi.
Poi espira e inizia il prossimo round.
Col tempo, ogni round potrebbe sembrare più profondo.
---
[tutorial_skip_button]
SALTA
---
[tutorial_back_button]
INDIETRO
---
[tutorial_next_button]
AVANTI
---
[tutorial_finish_button]
FINE
---
[tutorial_start_button]
INIZIA ORA
---
[share_sheet_title]
Esporta Dati Sessione
---
[export_metadata_header]
Esportazione Dati Inner Breeze
---
[export_metadata_version]
Versione: %s
---
[export_metadata_date]
Data Esportazione: %s
---
[export_metadata_count]
Numero Sessioni: %d
---
[delete_history_title]
Eliminare?
---
[delete_session_message]
Eliminare questa sessione? Questa azione non può essere annullata.
---
[delete_round_message]
Eliminare questo round? Questa azione non può essere annullata.
---
[delete_button]
Elimina
---
+1 -23
View File
@@ -53,7 +53,7 @@
背景音楽を再生
---
[meditation_music_shuffle_label]
曲をシャッフル
ランダムな曲
---
[meditation_music_track_label]
曲
@@ -326,28 +326,6 @@ ON
[on_screen_keyboard_label]
オンスクリーンキーボード
---
[history_title]
履歴
---
[history_empty]
まだ保存されたセッションはありません。
セッションを完了するとここに表示されます。
---
[history_month_label]
%02d 月
---
[history_day_label]
%02d 日
---
[history_round_short_label]
R%d
---
[history_round_label]
R%d %ds
---
[history_session_label]
%02d:%02d 平均 %ds
---
[tutorial_title]
チュートリアル
---
+72 -294
View File
@@ -1,5 +1,5 @@
[app_title]
인 브 브즈
Inner Breeze
---
[tab_history]
기록
@@ -17,7 +17,7 @@
완료
---
[habit_not_done_button]
표시
완료로 표시
---
[tab_manual]
튜토리얼
@@ -29,7 +29,7 @@
시작
---
[exercise_wim_hof]
윔 호프 호흡
윔 호프 호흡법
---
[exercise_meditation]
명상
@@ -41,7 +41,7 @@
명상
---
[meditation_manual_text]
시간을 선택하고 시작을 누른 뒤 편안하게 앉으세요. 주의를 호흡에 둡니다. 마음이 흩어지면 부드럽게 호흡으로 돌아옵니다. 공 소리가 세션의 시작과 끝을 알립니다.
시간을 선택하고 시작 버튼을 누른 후 편안하게 앉으세요. 호흡에 집중하세요. 마음이 흩어지면 부드럽게 호흡으로 돌아옵니다. 공 소리가 세션의 시작과 끝을 알립니다.
---
[meditation_music_settings_title]
명상 음악
@@ -53,7 +53,7 @@
배경 음악 재생
---
[meditation_music_shuffle_label]
트랙 셔플
랜덤 트랙
---
[meditation_music_track_label]
트랙
@@ -62,10 +62,10 @@
오디오 다운로드
---
[meditation_music_redownload_button]
오디오 다시 다운로드
오디오 재다운로드
---
[meditation_music_test_button]
테스트 재생
오디오 테스트
---
[duration_5m]
5분
@@ -83,7 +83,7 @@
2시간
---
[breath_button]
숨쉼
호흡
---
[results_title]
결과
@@ -95,7 +95,7 @@
세션을 종료하시겠습니까?
---
[save_completed_rounds_message]
완료된 라운드를 저장한 후 종료하시겠습니까?
완료된 라운드를 저장하고 종료하시겠습니까?
---
[cancel_button]
취소
@@ -107,7 +107,7 @@
저장
---
[discard_button]
버리기
삭제
---
[all_progress_lost_message]
모든 진행 상황이 손실됩니다.
@@ -131,7 +131,7 @@
%d 라운드 %ds
---
[starting_in]
%d초 후 시작
%2d초 후 시작
---
[session_round_label]
%d 라운드
@@ -166,16 +166,36 @@
[settings_tab_about]
정보
---
[theme_label]
테마
---
[theme_mode_label]
테마 모드
---
[theme_system]
시스템
---
[orientation_label]
화면 방향
---
[orientation_system]
시스템
---
[orientation_portrait]
세로
---
[orientation_landscape]
가로
---
[orientation_sensor]
센서
---
[speed_label]
속도
---
[progressive_speed_label]
점진적 속도
---
[progressive_start_speed_label]
시작 속도
---
@@ -207,7 +227,7 @@
스톱워치
---
[hold_display_circle]
원
원형
---
[volume_label]
음량
@@ -216,7 +236,7 @@
기본값으로 재설정
---
[fullscreen_label]
전체화면
전체 화면
---
[language_label]
언어
@@ -230,7 +250,6 @@
[coming_soon_label]
출시 예정
---
[data_management_label]
데이터 관리
---
@@ -238,7 +257,7 @@
데이터 관리
---
[total_sessions_label]
총 세션 수: %d
총 세션: %d
---
[data_size_label]
데이터 크기: %s
@@ -277,37 +296,34 @@
잘못된 내보내기 파일
---
[import_cancelled]
Import cancelled
가져오기 취소됨
---
[export_cancelled]
Export cancelled
내보내기 취소됨
---
[no_data_to_export]
No data to export
내보낼 데이터 없음
---
[no_data_to_delete]
No data to delete
삭제할 데이터 없음
---
[delete_all_data_title]
Delete all data?
모든 데이터를 삭제하시겠습니까?
---
[delete_all_data_message]
This will permanently delete all saved sessions.
저장된 모든 세션이 영구적으로 삭제됩니다.
---
[delete_cancelled]
Delete cancelled
삭제 취소됨
---
[deleted_sessions]
Deleted %lld sessions
%lld개 세션 삭제됨
---
[version_label]
버전 %s
---
[about_description]
인 브 브즈는 마음을 진정시키고
편안해질 수 있도록 돕돕이 호흡 명상 앱입니다.
사용에 주의하세요.
Inner Breeze는 편안함과 평온을 찾을 수 있도록 도와주는 간단한 호흡 명상 앱입니다.
---
[toggle_off]
꺼짐
@@ -322,30 +338,7 @@ Deleted %lld sessions
다크
---
[on_screen_keyboard_label]
온스크린 키보드
---
[history_title]
기록
---
[history_empty]
아직 저장된 세션이 없습니다.
세션을 완료하면 여기에 표시됩니다.
---
[history_month_label]
%02d월
---
[history_day_label]
%02d일
---
[history_round_short_label]
R%d
---
[history_round_label]
R%d %ds
---
[history_session_label]
%02d:%02d 평균 %ds
---
화면 키보드
---
[tutorial_title]
튜토리얼
@@ -357,63 +350,62 @@ R%d %ds
방법
---
[tutorial_step1_title]
1단계: 들이마시 내뱨기
1단계: 들이마시기와 내뱉기
---
[tutorial_step2_title]
2단계: 내뱨시 참기
2단계: 내뱉고 참기
---
[tutorial_step3_title]
3단계: 들이마시 참기
3단계: 들이마시고 참기
---
[tutorial_progressive_speed_title]
점진적 속도
---
[tutorial_step_intro]
이 호흡 방법은 윔 호프 메서드를 기반으로 합니다.
이 호흡법은 윔 호프 메서드를 기반으로 합니다.
강력하게 느낄 수 있습니다.
주의해서 사용하세요.
강력한 효과가 있을 수 있습니다. 주의해서 사용하세요.
앉거나 누워서 사용하세요.
운전 중이나 서 있는 곳에서는 사용하지 마세요.
앉거나 누운 상태에서 연습하세요.
운전 중, 서 있거나 물속에서는 사용하지 마세요.
---
[tutorial_step_method]
4단계를 따르세요:
다음 4단계를 따르세요:
1. 리듬하게 호흡합니다.
2. 내뱨시고 참습니다.
1. 리듬적으로 호흡합니다.
2. 내뱉고 참습니다.
3. 깊게 들이마시고 참습니다.
4. 내뱨시고 반복합니다.
4. 내뱉고 반복합니다.
톱니바 아이콘 %i를 사용하여 라운드, 호흡, 속도 및 일시정지를 조정할 수 있습니다.
톱니바퀴 아이콘 %i을 사용하여 라운드, 호흡, 속도 및 일시정지를 조정할 수 있습니다.
---
[tutorial_step_breathe]
폐를 완전히 채우고 자연스럽게 내뱨습니다.
폐를 완전히 채운 후 자연스럽게 내뱉으세요.
이 컨트롤로 호흡 리듬의 템포를 설정합니다.
이 슬라이더로 호흡 원의 속도를 설정합니다.
자연스러운 리듬을 찾으세요.
자연스러운 리듬을 찾아보세요.
---
[tutorial_step_progressive_speed]
점진적 속도는 첫 라운드를 쉽게 시작할 수 있게 합니다.
점진적 속도는 첫 라운드를 쉽게 시작할 수 있게 해줍니다.
활성화되면 첫 라운드는 속도 1에서 처음 5번 호흡을 하고 점차 선택한 속도까지 증가합니다.
켜면 첫 라운드가 느리게 시작된 후 점차 선택한 속도까지 증가합니다.
---
[tutorial_step_exhale]
호흡 라운드 후,
자연스럽게 내뱨고 참습니다.
[tutorial_step_exhale_hold]
자연스럽게 내뱉고 참습니다.
몸이 요청할 때까지 참으세요.
억지로 하지 마세요.
중앙 숫자가 계속 카운트됩니다. 원형 모드는 여러 진행 막대를 표시합니다.
몸이 공기를 필요로 할 때 놓으세요.
---
[tutorial_step_inhale_hold]
완전히 들이마시고 약 15초 동안 참습니다.
완전히 들이마시고 약 15초간 참으세요.
그런 다음 내뱨시고 다음 라운드를 시작합니다.
시간이 지남에 따라 각 라운드가 더 깊어질 수 있습니다.
그 후 내뱉고 다음 라운드를 시작하세요.
시간이 지날수록 각 라운드가 더 깊어질 수 있습니다.
---
[tutorial_skip_button]
건너뛰
건너뛰기
---
[tutorial_back_button]
뒤로
@@ -431,7 +423,7 @@ R%d %ds
세션 데이터 내보내기
---
[export_metadata_header]
인 브 브즈 데이터 내보내기
Inner Breeze 데이터 내보내기
---
[export_metadata_version]
버전: %s
@@ -454,217 +446,3 @@ R%d %ds
[delete_button]
삭제
---
[progressive_speed_label]
점진적 속도
---
[toggle_off]
꺼짐
---
[toggle_on]
켜짐
---
[round_times_title]
라운드 시간
---
[R%d]
%d 라운드
---
[C%d]
%d초
---
[round_result_label]
%d 라운드 %ds
---
[R%d %ds]
---
[session_rounds_label]
%d/%d
---
[play_in_background_label]
백그라운드 재생
---
[rounds_label]
라운드
---
[breaths_label]
호흡
---
[R%d %ds]
---
[R%d %ds]
---
[C%d %ds]
---
[C%d %ds]
---
[exit_session_title_title]
세션을 종료하시겠습니까?
---
[exit_session_title_message]
진행 중인 세션입니다.
진행 상태를 잃게 저장하고 종료하시겠습니까?
---
[exit_session_subtitle]
진행 상태
---
[continue_button]
계속
---
[confirm_button]
확인
---
[round_times_title]
라운드 시간
---
[R%d]
%d 라운드
---
[C%d]
%d초
---
[round_result_label]
%d 라운드 %ds
---
[R%d %ds]
---
[session_rounds_label]
%d/%d
---
[play_in_background_label]
백그라운드 재생
---
[rounds_label]
라운드
---
[breaths_label]
호흡
---
[round_button_label]
%d 라운드
---
[round_button_short_label]
R%d
---
[round_settings_label]
%d/%d
---
[round_short_label]
%d/%d
---
[breaths_button_label]
%d/%d
---
[breaths_short_label]
%d/%d
---
[C%d]
%d초
---
[C%d]
%d초
---
[C%d]
%d초
---
[history_edit_title]
편집
---
[history_edit_done]
완료
---
[history_edit_cancel]
취소
---
[history_delete_title]
기록 삭제
---
[history_delete_message]
이 기록을 삭제하시겠습니까?
---
[pause_button_label]
일시정지
---
[resume_button_label]
재개
---
[tutorial_step_breathe]
폐를 완전히 채우고 자연스럽게 내뱨세요.
이 컨트롤로 호흡 리듬의 템포를 설정합니다.
자연스러운 리듬을 찾으세요.
---
[tutorial_step_exhale]
호흡 라운드 후,
자연스럽게 내뱨시고 참습니다.
시체가 공기가 필요할 때까지 참으세요.
강제로 하지 마세요.
---
[tutorial_step_inhale_hold]
완전히 들이마시고 약 15초 동안 참습니다.
그 다음 내뱨시고 다음 라운드를 시작합니다.
시간이 지남에 따라 각 라운드가 더 깊어질 수 있습니다.
---
[tutorial_skip_button]
건너뛰
---
[tutorial_back_button]
뒤로
---
[tutorial_next_button]
다음
---
[tutorial_finish_button]
완료
---
[tutorial_start_button]
지금 시작
---
[share_sheet_title]
세션 데이터 내보내기
---
[export_metadata_header]
인 브 브즈 데이터 내보내기
---
[export_metadata_version]
버전: %s
---
[export_metadata_date]
내보내기 날짜: %s
---
[export_metadata_count]
세션 수: %d
---
[delete_history_title]
기록 삭제
---
[delete_session_message]
이 기록을 삭제하시겠습니까? 되돌릴 수 없습니다.
---
[delete_round_message]
이 라운드를 삭제하시겠습니까? 되돌릴 수 없습니다.
---
[delete_button]
삭제
---
[R%d %ds]
---
[R%d %ds]
---
[round_result_label]
%d 라운드 %ds
---
[R%d %ds]
---
---
[history_round_short_label]
R%d
---
[history_round_label]
R%d %ds
---
[history_session_label]
%02d:%02d 평균 %ds
---
+1 -23
View File
@@ -53,7 +53,7 @@ Música de fundo
Tocar música de fundo
---
[meditation_music_shuffle_label]
Embaralhar faixas
Faixa aleatória
---
[meditation_music_track_label]
Faixa
@@ -326,28 +326,6 @@ Escuro
[on_screen_keyboard_label]
Teclado na tela
---
[history_title]
Histórico
---
[history_empty]
Ainda não há sessões salvas.
Conclua uma sessão para adicionar dados.
---
[history_month_label]
Mês %02d
---
[history_day_label]
Dia %02d
---
[history_round_short_label]
R%d
---
[history_round_label]
R%d %ds
---
[history_session_label]
%02d:%02d média %ds
---
[tutorial_title]
Tutorial
---
+1 -23
View File
@@ -53,7 +53,7 @@ Wim Hof 呼吸
播放背景音乐
---
[meditation_music_shuffle_label]
随机播放曲目
随机曲目
---
[meditation_music_track_label]
曲目
@@ -324,28 +324,6 @@ Inner Breeze 是一款简单的呼吸冥想应用,帮助你放松并平静下
[on_screen_keyboard_label]
屏幕键盘
---
[history_title]
历史
---
[history_empty]
还没有保存的练习。
完成一次练习后会添加到这里。
---
[history_month_label]
%02d 月
---
[history_day_label]
第 %02d 天
---
[history_round_short_label]
第%d轮
---
[history_round_label]
第%d轮 %ds
---
[history_session_label]
%02d:%02d 平均 %ds
---
[tutorial_title]
教程
---
+20
View File
@@ -0,0 +1,20 @@
{
"name": "Inner Breeze",
"short_name": "Inbe",
"start_url": "/",
"display": "fullscreen",
"background_color": "#1a1a2e",
"theme_color": "#779999",
"icons": [
{
"src": "/web-assets/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/web-assets/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
+113
View File
@@ -0,0 +1,113 @@
#include "android_device.h"
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
#include <android/log.h>
#include <android_native_app_glue.h>
#include <jni.h>
#include <pthread.h>
extern struct android_app *GetAndroidApp(void);
static pthread_mutex_t device_mutex = PTHREAD_MUTEX_INITIALIZER;
static int current_system_dark = 0;
static int current_orientation = APP_DEVICE_ORIENTATION_UNKNOWN;
void
android_device_native_set_system_dark(int dark)
{
pthread_mutex_lock(&device_mutex);
current_system_dark = dark != 0;
pthread_mutex_unlock(&device_mutex);
}
void
android_device_native_set_orientation(int orientation)
{
pthread_mutex_lock(&device_mutex);
current_orientation = orientation;
pthread_mutex_unlock(&device_mutex);
}
void
android_device_init(void)
{
pthread_mutex_lock(&device_mutex);
current_system_dark = 0;
current_orientation = APP_DEVICE_ORIENTATION_UNKNOWN;
pthread_mutex_unlock(&device_mutex);
}
int
android_device_system_dark(void)
{
int dark;
pthread_mutex_lock(&device_mutex);
dark = current_system_dark;
pthread_mutex_unlock(&device_mutex);
return dark;
}
int
android_device_orientation(void)
{
int orientation;
pthread_mutex_lock(&device_mutex);
orientation = current_orientation;
pthread_mutex_unlock(&device_mutex);
return orientation;
}
void
android_device_set_orientation_mode(int mode)
{
struct android_app *app = GetAndroidApp();
JavaVM *jvm;
JNIEnv *env = NULL;
jobject activity;
jclass activity_class;
jmethodID method;
int attached = 0;
if(app == NULL || app->activity == NULL || app->activity->vm == NULL ||
app->activity->clazz == NULL)
return;
jvm = app->activity->vm;
activity = app->activity->clazz;
if((*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_6) != JNI_OK) {
if((*jvm)->AttachCurrentThread(jvm, &env, NULL) != JNI_OK || env == NULL)
return;
attached = 1;
}
activity_class = (*env)->GetObjectClass(env, activity);
if(activity_class == NULL)
goto done;
method = (*env)->GetMethodID(env, activity_class, "applyOrientationMode", "(I)V");
if(method == NULL) {
__android_log_write(ANDROID_LOG_ERROR, "INBE_DEVICE", "applyOrientationMode not found");
goto done;
}
(*env)->CallVoidMethod(env, activity, method, (jint)mode);
done:
if((*env)->ExceptionCheck(env)) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
}
if(attached)
(*jvm)->DetachCurrentThread(jvm);
}
#else
void android_device_native_set_system_dark(int dark) { (void)dark; }
void android_device_native_set_orientation(int orientation) { (void)orientation; }
void android_device_init(void) {}
int android_device_system_dark(void) { return 0; }
int android_device_orientation(void) { return APP_DEVICE_ORIENTATION_UNKNOWN; }
void android_device_set_orientation_mode(int mode) { (void)mode; }
#endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef INBE_ANDROID_DEVICE_H
#define INBE_ANDROID_DEVICE_H
#include "app.h"
void android_device_init(void);
int android_device_system_dark(void);
int android_device_orientation(void);
void android_device_set_orientation_mode(int mode);
void android_device_native_set_system_dark(int dark);
void android_device_native_set_orientation(int orientation);
#endif
+3
View File
@@ -1,5 +1,6 @@
#include "android_insets.h"
#include "android_import.h"
#include "android_device.h"
#include "android_runtime_assets.h"
#include "android_timer.h"
#include "android_wakelock.h"
@@ -177,6 +178,8 @@ static const JNINativeMethod g_methods[] = {
{"nativeGetPlayInBackground", "()I", (void*)nativeGetPlayInBackground},
{"nativePauseSession", "()I", (void*)nativePauseSession},
{"nativeResumeSession", "()V", (void*)nativeResumeSession},
{"nativeSetSystemDark", "(I)V", (void*)android_device_native_set_system_dark},
{"nativeSetOrientation", "(I)V", (void*)android_device_native_set_orientation},
{"nativeImportSelectedFile", "(Ljava/lang/String;)V", (void*)android_import_native_selected},
{"nativeImportCancelled", "()V", (void*)android_import_native_cancelled},
{"nativeRuntimeAssetDownloadSucceeded", "(JJI)V", (void*)android_runtime_asset_native_succeeded},
+524 -247
View File
File diff suppressed because it is too large. Load diff
+37 -19
View File
@@ -67,7 +67,6 @@ typedef enum {
UIModalMeditationSetup,
UIModalDataManagement,
UIModalConfirmDeleteData,
UIModalConfirmDeleteHistory,
UIModalEditProgressiveStartSpeed,
UIModalHabitLinkedDetails,
} UIModalType;
@@ -110,6 +109,35 @@ typedef enum ExerciseType {
EXERCISE_COUNT
} ExerciseType;
typedef enum AppThemeMode {
APP_THEME_SYSTEM = 0,
APP_THEME_LIGHT = 1,
APP_THEME_DARK = 2,
} AppThemeMode;
typedef enum AppOrientationMode {
APP_ORIENTATION_SYSTEM = 0,
APP_ORIENTATION_PORTRAIT = 1,
APP_ORIENTATION_LANDSCAPE = 2,
APP_ORIENTATION_SENSOR = 3,
} AppOrientationMode;
typedef enum AppDeviceOrientation {
APP_DEVICE_ORIENTATION_UNKNOWN = 0,
APP_DEVICE_ORIENTATION_PORTRAIT = 1,
APP_DEVICE_ORIENTATION_LANDSCAPE = 2,
} AppDeviceOrientation;
typedef enum AppMainTab {
APP_MAIN_TAB_HABITS = 0,
APP_MAIN_TAB_PRACTICE = 1,
} AppMainTab;
typedef enum HabitsViewMode {
HABITS_VIEW_CALENDAR = 0,
HABITS_VIEW_LINKED = 1,
} HabitsViewMode;
struct InbeApp {
Inbe inbe;
Inbe settings_preview;
@@ -137,6 +165,7 @@ struct InbeApp {
Texture2D save_icon;
Texture2D discord_icon;
Texture2D telegram_icon;
Texture2D github_icon;
Texture2D globe_icon;
Texture2D btc_icon;
Texture2D monero_icon;
@@ -164,6 +193,7 @@ struct InbeApp {
int settings_drag_content;
int settings_drag_content_y;
int settings_dirty;
int settings_save_delay_ticks;
int settings_category;
int settings_sub_tab;
int app_settings_tab;
@@ -186,27 +216,14 @@ struct InbeApp {
int theme_id;
int dark_mode;
int theme_mode;
int orientation_mode;
int android_orientation;
int main_tab;
int pending_bottom_tab;
#if defined(LOTUS_BUILD)
unsigned int lotus_settings_version;
#endif
int history_scroll;
int history_drag_scrollbar;
int history_drag_content;
int history_drag_content_y;
int history_level;
int history_year;
int history_month;
int history_day;
char history_record[16];
int history_edit_active;
int history_edit_kind;
int history_edit_round;
int history_edit_cursor;
char history_edit_path[FS_PATH_MAX];
char history_edit_text[16];
int history_delete_kind;
int history_delete_round;
char history_delete_path[FS_PATH_MAX];
InbeHabits habits;
int habits_view_mode;
int habits_list_scroll;
@@ -217,6 +234,7 @@ struct InbeApp {
int habit_detail_index;
int habit_detail_day;
int habit_detail_session_index;
char habit_detail_session_path[FS_PATH_MAX];
int habit_session_edit_scroll;
int habit_session_edit_active;
int habit_session_edit_kind;
+151
View File
@@ -0,0 +1,151 @@
#include "app_preferences.h"
#include "theme.h"
#include "theme_meta.h"
#include "flint_ui.h"
#if defined(LOTUS_BUILD)
#include "lotus_settings.h"
#endif
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
#include "android_device.h"
#endif
#if defined(PLATFORM_WEB)
#include "flint_web.h"
#endif
#include <stdbool.h>
extern Color c_text, c_bg, c_surface, c_circle, c_button, c_button_hover, c_icon;
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_surface = lotus_alias_color("surface");
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_surface, c_circle, c_button, c_button_hover, c_icon);
return;
#else
Color bg;
Color surface;
Color text;
Color circle;
Color button;
Color button_hover;
Color icon;
FlintThemeId theme;
bool dark;
if(theme_id < 0 || theme_id >= THEME_COUNT)
theme_id = ThemeSky;
theme = flint_theme_normalize(theme_id);
dark = dark_mode != 0;
flint_theme_catalog_color(theme, dark, "background", &bg);
flint_theme_catalog_color(theme, dark, "surface", &surface);
flint_theme_catalog_color(theme, dark, "text", &text);
flint_theme_catalog_color(theme, dark, "circle", &circle);
flint_theme_catalog_color(theme, dark, "button", &button);
flint_theme_catalog_color(theme, dark, "button_hover", &button_hover);
flint_theme_catalog_color(theme, dark, "icon", &icon);
c_bg = bg;
c_surface = surface;
c_text = text;
c_circle = circle;
c_button = button;
c_button_hover = button_hover;
c_icon = icon;
ui_set_colors(text, bg, surface, circle, button, button_hover, icon);
#endif
}
int
app_effective_dark_mode(InbeApp *app)
{
if(app == NULL)
return 0;
if(app->theme_mode == APP_THEME_LIGHT)
return 0;
if(app->theme_mode == APP_THEME_DARK)
return 1;
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
return android_device_system_dark() != 0;
#else
return 0;
#endif
}
void
app_refresh_theme(InbeApp *app)
{
if(app == NULL)
return;
app->dark_mode = app_effective_dark_mode(app);
refresh_theme_colors(app->theme_id, app->dark_mode);
}
void
app_apply_orientation_preference(InbeApp *app)
{
if(app == NULL)
return;
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
android_device_set_orientation_mode(app->orientation_mode);
#elif defined(PLATFORM_WEB)
flint_web_set_orientation_mode(app->orientation_mode);
flint_web_sync_window_size();
#else
if(app->orientation_mode == APP_ORIENTATION_PORTRAIT &&
GetScreenWidth() > GetScreenHeight()) {
SetWindowSize(GetScreenHeight(), GetScreenWidth());
} else if(app->orientation_mode == APP_ORIENTATION_LANDSCAPE &&
GetScreenHeight() > GetScreenWidth()) {
SetWindowSize(GetScreenHeight(), GetScreenWidth());
}
#endif
}
void
app_device_preferences_init(InbeApp *app)
{
if(app == NULL)
return;
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
app->android_orientation = android_device_orientation();
#else
app->android_orientation = APP_DEVICE_ORIENTATION_UNKNOWN;
#endif
app_refresh_theme(app);
app_apply_orientation_preference(app);
}
void
app_device_preferences_update(InbeApp *app)
{
int effective_dark;
int orientation = APP_DEVICE_ORIENTATION_UNKNOWN;
if(app == NULL)
return;
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
orientation = android_device_orientation();
#endif
if(app->android_orientation != orientation)
app->android_orientation = orientation;
effective_dark = app_effective_dark_mode(app);
if(app->dark_mode != effective_dark) {
app->dark_mode = effective_dark;
refresh_theme_colors(app->theme_id, app->dark_mode);
}
}
+12
View File
@@ -0,0 +1,12 @@
#ifndef INBE_APP_PREFERENCES_H
#define INBE_APP_PREFERENCES_H
#include "app.h"
int app_effective_dark_mode(InbeApp *app);
void app_refresh_theme(InbeApp *app);
void app_device_preferences_init(InbeApp *app);
void app_device_preferences_update(InbeApp *app);
void app_apply_orientation_preference(InbeApp *app);
#endif
+28
View File
@@ -546,6 +546,34 @@ session_draw_inbe(InbeApp *app, int center_x, int center_y)
draw_session_counter(app, center_x, center_y);
}
static void
draw_meditation_start_preview(InbeApp *app, int center_x, int center_y)
{
char text[16];
int seconds = 0;
int font = flint_px(44);
int text_w;
if(app != NULL && app->meditation_duration_seconds > 0)
seconds = app->meditation_duration_seconds;
snprintf(text, sizeof(text), "%02d:%02d", seconds / 60, seconds % 60);
text_w = flint_text_measure(text, font);
flint_text_draw(text, center_x - text_w / 2, center_y - font / 2,
font, c_text);
}
void
session_draw_start_preview(InbeApp *app, int center_x, int center_y)
{
if(app != NULL && app->exercise_type == EXERCISE_MEDITATION) {
draw_meditation_start_preview(app, center_x, center_y);
return;
}
session_draw_inbe(app, center_x, center_y);
}
static void
draw_session_status(InbeApp *app, int center_x, int center_y)
{
+1
View File
@@ -10,6 +10,7 @@ int session_ensure_results_saved(InbeApp *app);
void session_discard_saved_results(InbeApp *app);
int session_has_completed_rounds(InbeApp *app);
void session_draw_inbe(InbeApp *app, int center_x, int center_y);
void session_draw_start_preview(InbeApp *app, int center_x, int center_y);
void session_update_screen(InbeApp *app, int center_x, int center_y, int *hover);
void session_draw_results_screen(InbeApp *app, int center_x, int center_y, int *hover);
void update_session_sounds(InbeApp *app);
+23 -5
View File
@@ -190,13 +190,31 @@ data_delete_all(void)
return inbe_storage_delete_all_sessions();
}
void
data_default_export_filename(char *out, size_t out_size)
{
time_t now;
if(out == NULL || out_size == 0)
return;
now = time(NULL);
if(now > 0)
snprintf(out, out_size, "inbe-%lld.zip", (long long)now);
else
snprintf(out, out_size, "inbe.zip");
}
int
data_export(const char *path)
{
data_init();
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
(void)path;
return android_share_export("inbe-export.zip");
char filename[64];
if(path != NULL && path[0] != '\0')
return android_share_export(path);
data_default_export_filename(filename, sizeof(filename));
return android_share_export(filename);
#else
return inbe_storage_export_zip(path);
#endif
@@ -256,15 +274,15 @@ data_list_sessions(data_session_callback callback, void *user)
DbListSessionContext ctx = {callback, user};
if(callback == NULL)
return;
data_list_history(db_list_session_callback, &ctx);
data_list_session_records(db_list_session_callback, &ctx);
}
void
data_list_history(data_history_callback callback, void *user)
data_list_session_records(data_session_record_callback callback, void *user)
{
data_init();
if(callback != NULL)
inbe_storage_list_history((InbeStorageHistoryCallback)callback, user);
inbe_storage_list_session_records((InbeStorageSessionRecordCallback)callback, user);
}
int
+8 -7
View File
@@ -19,20 +19,21 @@ int data_has_any(void);
long long data_get_total_size(void);
int data_get_session_count(void);
long long data_delete_all(void);
void data_default_export_filename(char *out, size_t out_size);
int data_export(const char *path);
int data_import(const char *path);
int data_validate_import_file(const char *path);
typedef void (*data_session_callback)(const char *date, const char *time,
int rounds, int best, void *user);
typedef void (*data_history_callback)(const char *path,
int year, int month, int day,
int hour, int minute, int second,
int topic, int activity,
const int *round_times, int round_count,
void *user);
typedef void (*data_session_record_callback)(const char *path,
int year, int month, int day,
int hour, int minute, int second,
int topic, int activity,
const int *round_times, int round_count,
void *user);
void data_list_sessions(data_session_callback callback, void *user);
void data_list_history(data_history_callback callback, void *user);
void data_list_session_records(data_session_record_callback callback, void *user);
int data_load_session(const char *path, int *round_times, int max_rounds,
int *year, int *month, int *day,
int *hour, int *minute, int *second);
-1
View File
@@ -37,7 +37,6 @@ enum {
InbeScreenSettings,
InbeScreenLanguage,
InbeScreenManual,
InbeScreenHistory,
InbeScreenHabits,
InbeScreenHabitManager,
InbeScreenHabitEdit,
+3
View File
@@ -16,6 +16,7 @@ __declspec(dllimport) int __stdcall MessageBoxA(void *hwnd, const char *text,
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
#include "android_insets.h"
#include "android_device.h"
#include "android_runtime_assets.h"
#include "android_wakelock.h"
#include "android_timer.h"
@@ -275,6 +276,8 @@ int main(int argc, char **argv) {
#if INBE_ANDROID_BUILD
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Calling android_insets_init");
android_insets_init();
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Calling android_device_init");
android_device_init();
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Calling android_wakelock_init");
android_wakelock_init();
__android_log_write(ANDROID_LOG_INFO, "INBE_MAIN", "Calling android_timer_init");
+85 -42
View File
@@ -38,6 +38,8 @@ static const char *g_track_options[MEDITATION_MUSIC_TRACK_COUNT] = {
"Truth Of Silence"
};
static int load_track(InbeApp *app, int track);
static int
file_exists(const char *path)
{
@@ -295,6 +297,29 @@ meditation_music_stop(InbeApp *app)
app->meditation_music_playing = 0;
}
static void
meditation_music_test_track(InbeApp *app)
{
int track;
if(app == NULL)
return;
if(!meditation_music_available(app)) {
set_status(app, "Download audio before testing");
return;
}
track = app->meditation_music_track;
if(track < 0 || track >= MEDITATION_MUSIC_TRACK_COUNT)
track = 0;
if(!load_track(app, track))
return;
PlayMusicStream(app->meditation_music);
app->meditation_music_playing = 1;
set_status(app, "Playing test audio");
}
static int
load_track(InbeApp *app, int track)
{
@@ -388,8 +413,9 @@ start_download(InbeApp *app)
archive_path);
}
void
meditation_music_draw_settings(InbeApp *app, int content_x, int content_w, int *y)
static void
draw_music_picker(InbeApp *app, int content_x, int content_w, int *y,
int show_installed_download, int show_status)
{
int toggle_w = flint_px(56);
int toggle_h = flint_px(30);
@@ -401,15 +427,14 @@ meditation_music_draw_settings(InbeApp *app, int content_x, int content_w, int *
if(app == NULL || y == NULL)
return;
flint_text_draw(locale_get("meditation_music_enabled_label"), content_x, *y, flint_ui_font(), c_text);
if(ui_draw_toggle_switch(content_x, *y + flint_px(26), toggle_w, toggle_h,
&app->meditation_music_enabled,
locale_get("toggle_off"), locale_get("toggle_on"))) {
if(app->meditation_music_track < 0 ||
app->meditation_music_track >= MEDITATION_MUSIC_TRACK_COUNT)
app->meditation_music_track = 0;
if(!app->meditation_music_enabled) {
app->meditation_music_enabled = 1;
app->settings_dirty = 1;
if(!app->meditation_music_enabled)
meditation_music_stop(app);
}
*y += flint_px(76);
flint_text_draw(locale_get("meditation_music_shuffle_label"), content_x, *y, flint_ui_font(), c_text);
if(ui_draw_toggle_switch(content_x, *y + flint_px(26), toggle_w, toggle_h,
@@ -419,45 +444,63 @@ meditation_music_draw_settings(InbeApp *app, int content_x, int content_w, int *
*y += flint_px(76);
flint_text_draw(locale_get("meditation_music_track_label"), content_x, *y, flint_ui_font(), c_text);
if(ui_draw_dropdown_button(401, content_x, *y + flint_px(24), content_w, flint_px(36),
g_track_options, MEDITATION_MUSIC_TRACK_COUNT,
&app->meditation_music_track)) {
app->settings_dirty = 1;
meditation_music_stop(app);
if(app->meditation_music_shuffle) {
ui_draw_generic_button(content_x, *y + flint_px(24), content_w, flint_px(36),
g_track_options[app->meditation_music_track],
UI_BUTTON_STYLE_SECONDARY, 1, NULL);
} else {
if(ui_draw_dropdown_button(401, content_x, *y + flint_px(24), content_w, flint_px(36),
g_track_options, MEDITATION_MUSIC_TRACK_COUNT,
&app->meditation_music_track)) {
app->settings_dirty = 1;
meditation_music_stop(app);
}
}
*y += flint_px(74);
installed = meditation_music_available(app);
button_w = flint_text_measure(locale_get(installed ? "meditation_music_redownload_button"
: "meditation_music_download_button"),
flint_ui_font()) + flint_px(24);
if(button_w > content_w)
button_w = content_w;
if(ui_draw_generic_button(content_x, *y, button_w, button_h,
locale_get(installed ? "meditation_music_redownload_button"
: "meditation_music_download_button"),
UI_BUTTON_STYLE_PRIMARY, 0, &hover))
start_download(app);
*y += button_h + flint_px(12);
button_w = flint_text_measure(locale_get("meditation_music_test_button"),
flint_ui_font()) + flint_px(24);
if(button_w > content_w)
button_w = content_w;
if(ui_draw_generic_button(content_x, *y, button_w, button_h,
locale_get("meditation_music_test_button"),
UI_BUTTON_STYLE_SECONDARY, 0, &hover)) {
if(app->meditation_music_playing)
meditation_music_stop(app);
else if(load_track(app, app->meditation_music_track)) {
PlayMusicStream(app->meditation_music);
app->meditation_music_playing = 1;
}
if(installed) {
button_w = flint_text_measure(locale_get("meditation_music_test_button"),
flint_ui_font()) + flint_px(24);
if(button_w > content_w)
button_w = content_w;
if(ui_draw_generic_button(content_x, *y, button_w, button_h,
locale_get("meditation_music_test_button"),
UI_BUTTON_STYLE_SECONDARY, 0, &hover))
meditation_music_test_track(app);
*y += button_h + flint_px(12);
}
*y += button_h + flint_px(16);
flint_text_draw(app->meditation_music_status, content_x, *y, flint_ui_font(), c_text);
*y += flint_px(34);
if(!installed || show_installed_download) {
button_w = flint_text_measure(locale_get(installed ? "meditation_music_redownload_button"
: "meditation_music_download_button"),
flint_ui_font()) + flint_px(24);
if(button_w > content_w)
button_w = content_w;
if(ui_draw_generic_button(content_x, *y, button_w, button_h,
locale_get(installed ? "meditation_music_redownload_button"
: "meditation_music_download_button"),
UI_BUTTON_STYLE_PRIMARY, 0, &hover))
start_download(app);
*y += button_h + flint_px(12);
}
if(show_status && (!installed || app->meditation_music_download.status != FLINT_RUNTIME_ASSET_IDLE)) {
flint_text_draw(app->meditation_music_status, content_x, *y, flint_ui_font(), c_text);
*y += flint_px(34);
}
}
void
meditation_music_draw_settings(InbeApp *app, int content_x, int content_w, int *y)
{
draw_music_picker(app, content_x, content_w, y, 1, 1);
}
void
meditation_music_draw_guide_settings(InbeApp *app, int content_x, int content_w, int *y)
{
draw_music_picker(app, content_x, content_w, y, 0, 1);
}
int
+1
View File
@@ -13,6 +13,7 @@ void meditation_music_unload(InbeApp *app);
void meditation_music_start_session(InbeApp *app);
void meditation_music_stop(InbeApp *app);
void meditation_music_draw_settings(InbeApp *app, int content_x, int content_w, int *y);
void meditation_music_draw_guide_settings(InbeApp *app, int content_x, int content_w, int *y);
int meditation_music_draw_dropdown_menu(InbeApp *app);
int meditation_music_available(InbeApp *app);
const char *meditation_music_selected_label(InbeApp *app);
+19 -1
View File
@@ -342,6 +342,22 @@ inbe_storage_set_setting_text(const char *key, const char *value)
sqlite3_finalize(stmt);
}
void
inbe_storage_settings_begin_write(void)
{
if(g_storage.db == NULL)
return;
exec_sql("BEGIN IMMEDIATE");
}
void
inbe_storage_settings_end_write(void)
{
if(g_storage.db == NULL)
return;
exec_sql("COMMIT");
}
void
inbe_storage_set_setting_int(const char *key, int value)
{
@@ -593,7 +609,7 @@ inbe_storage_delete_session(const char *path_or_id)
}
void
inbe_storage_list_history(InbeStorageHistoryCallback callback, void *user)
inbe_storage_list_session_records(InbeStorageSessionRecordCallback callback, void *user)
{
sqlite3_stmt *stmt = NULL;
if(callback == NULL || g_storage.db == NULL)
@@ -765,6 +781,8 @@ migrate_settings_file(const char *path, int overwrite)
static const char *keys[] = {
"speed", "max_rounds", "max_breaths", "pause_seconds", "sound_volume",
"tutorial_seen", "exercise_manual_seen_mask", "theme", "dark_mode",
"theme_mode", "orientation_mode",
"main_tab", "habits_view_mode",
"fullscreen", "on_screen_keyboard", "progressive_speed", "progressive_start_speed",
"advanced_session_controls", "hold_display_mode", "exercise_type",
"meditation_music_enabled", "meditation_music_shuffle", "meditation_music_track",
+9 -7
View File
@@ -9,12 +9,12 @@ enum {
INBE_STORAGE_ID_SIZE = 64
};
typedef void (*InbeStorageHistoryCallback)(const char *id,
int year, int month, int day,
int hour, int minute, int second,
int topic, int activity,
const int *rounds, int round_count,
void *user);
typedef void (*InbeStorageSessionRecordCallback)(const char *id,
int year, int month, int day,
int hour, int minute, int second,
int topic, int activity,
const int *rounds, int round_count,
void *user);
int inbe_storage_init(const char *root);
void inbe_storage_close(void);
@@ -24,6 +24,8 @@ int inbe_storage_get_setting_int(const char *key, int fallback);
const char *inbe_storage_get_setting_text(const char *key);
void inbe_storage_set_setting_int(const char *key, int value);
void inbe_storage_set_setting_text(const char *key, const char *value);
void inbe_storage_settings_begin_write(void);
void inbe_storage_settings_end_write(void);
int inbe_storage_settings_empty(void);
int inbe_storage_save_session(const int *round_times, int round_count,
@@ -37,7 +39,7 @@ int inbe_storage_delete_session(const char *id);
int inbe_storage_load_session(const char *id, int *round_times, int max_rounds,
int *year, int *month, int *day,
int *hour, int *minute, int *second);
void inbe_storage_list_history(InbeStorageHistoryCallback callback, void *user);
void inbe_storage_list_session_records(InbeStorageSessionRecordCallback callback, void *user);
int inbe_storage_has_any(void);
int inbe_storage_session_count(void);
long long inbe_storage_total_size(void);
File diff suppressed because it is too large. Load diff
-57
View File
@@ -1,57 +0,0 @@
#ifndef HISTORY_TAB_H
#define HISTORY_TAB_H
#include <stddef.h>
#include "../inbe.h"
#include "../app_fwd.h"
/* History constants */
enum {
HISTORY_MAX_SESSIONS = 48,
HISTORY_PATH_SIZE = 512,
HISTORY_TEXT_SIZE = 96,
};
/* History entry structure */
typedef struct HistoryEntry {
char path[HISTORY_PATH_SIZE];
int year;
int month;
int day;
int hour;
int minute;
int second;
int round_count;
int best;
int avg_seconds;
int rounds[MaxRounds];
} HistoryEntry;
/* Draw the history tab */
void history_tab_draw(InbeApp *app);
/* Handle tab click - switch to history screen */
void history_tab_on_click(void *user_data);
/* Reset all history viewer state */
void history_tab_reset(InbeApp *app);
/* Handle history-specific back behavior, returning non-zero when handled */
int history_tab_handle_back(InbeApp *app);
/* Return non-zero while the history tab owns keyboard text input */
int history_tab_is_editing(const InbeApp *app);
/* Open the latest session in history viewer */
void history_open_latest(InbeApp *app);
/* Load a session file and populate a history entry */
void history_load_session_file(const char *path, HistoryEntry *entry);
/* Clear the record selection in history viewer */
void history_clear_record_selection(InbeApp *app);
/* Format session label for display (e.g., "14:30 5 rounds 45s") */
void history_format_session_label(const HistoryEntry *entry, char *out, size_t out_size);
#endif
+32 -6
View File
@@ -2,6 +2,7 @@
#include "app.h"
#include "app_session.h"
#include "locale.h"
#include "meditation_music.h"
#include "flint_ui.h"
#include "theme_meta.h"
#include "raylib.h"
@@ -129,6 +130,14 @@ meditation_manual_draw(InbeApp *app)
int responsive_max_w = (int)(view_width * 0.90f);
int max_content_w = flint_px(520);
int y;
int button_w;
int button_h = flint_px(36);
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(410);
FlintUIScrollArea scroll_area;
FlintUIScrollView scroll_view;
FlintUIParagraph paragraph;
if(responsive_max_w > max_content_w)
@@ -141,6 +150,9 @@ meditation_manual_draw(InbeApp *app)
if(ui_draw_screen_header(locale_get("meditation_manual_title"), 1))
manual_tab_close_tutorial(app, 0);
if(content_h < flint_px(120))
content_h = flint_px(120);
paragraph = (FlintUIParagraph){
.text = locale_get("meditation_manual_text"),
.icon = (Texture2D){0},
@@ -152,15 +164,29 @@ meditation_manual_draw(InbeApp *app)
.color = c_text,
};
y = title_h + flint_px(32);
scroll_area = (FlintUIScrollArea){
.bounds = {(float)content_x, (float)content_y,
(float)content_w, (float)content_h},
.content_height = content_total_h,
.scroll_offset = &app->manual_scroll,
.wheel_step = flint_px(42)
};
scroll_view = ui_scroll_container_begin(scroll_area);
y = scroll_view.content_y;
flint_ui_paragraph_draw(paragraph, content_x, &y);
y += flint_px(24);
flint_text_draw(locale_get("meditation_music_section_title"),
content_x, y, flint_ui_font(), c_text);
y += flint_px(30);
meditation_music_draw_guide_settings(app, content_x, content_w, &y);
ui_scroll_container_end(scroll_area, scroll_view);
meditation_music_draw_dropdown_menu(app);
{
int hover = 0;
int button_w = content_w;
int button_h = flint_px(36);
int button_y = view_height - flint_px(52);
button_w = content_w;
if(button_w > flint_px(260))
button_w = flint_px(260);
@@ -317,7 +343,7 @@ manual_tab_draw(InbeApp *app)
content_drag_active = 0;
}
BeginScissorMode((int)app->camera.offset.x,
ui_begin_scissor((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));
@@ -394,7 +420,7 @@ manual_tab_draw(InbeApp *app)
y += img_h + flint_px(22);
draw_tutorial_paragraph(app, 5, content_x, &y, content_w, body_font);
}
EndScissorMode();
ui_end_scissor();
/* Draw scrollbar if content overflows */
if(max_scroll > 0) {
+128 -35
View File
@@ -1,5 +1,6 @@
#include "settings_tab.h"
#include "app.h"
#include "app_preferences.h"
#include "app_session.h"
#include "language_tab.h"
#include "meditation_music.h"
@@ -279,18 +280,19 @@ settings_draw_about_block(InbeApp *app, int content_x, int content_w, int *y)
int icon_padding;
int icon_spacing;
int icon_btn_w;
int link_count = 4;
int max_columns = 4;
int link_count = 5;
int max_columns = 5;
int total_w;
int columns;
int grid_w;
int links_start_x;
int row_spacing;
Texture2D icons[4] = {app->discord_icon, app->telegram_icon, app->btc_icon, app->monero_icon};
UIIconType icon_types[4] = {UI_ICON_TYPE_NONE, UI_ICON_TYPE_TELEGRAM, UI_ICON_TYPE_BTC, UI_ICON_TYPE_MONERO};
const char *urls[4] = {
Texture2D icons[5] = {app->discord_icon, app->telegram_icon, app->github_icon, app->btc_icon, app->monero_icon};
UIIconType icon_types[5] = {UI_ICON_TYPE_NONE, UI_ICON_TYPE_TELEGRAM, UI_ICON_TYPE_NONE, UI_ICON_TYPE_BTC, UI_ICON_TYPE_MONERO};
const char *urls[5] = {
"https://discord.com/invite/JbGZ4yENDt",
"https://t.me/lotusinbe",
"https://github.com/waozixyz/inbe",
"https://trocador.app/en/anonpay/?ticker_to=btc&network_to=Mainnet&address=bc1qxzcetg50f6epgddc09n82xqn3zswlmk44235y5&donation=True&simple_mode=True&amount=0.001&name=Inner+Breeze&[email protected]&ticker_from=btc&network_from=Mainnet&buttonbgcolor=445588&textcolor=ffffff&bgcolor=eaeaffff",
"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"
};
@@ -448,10 +450,15 @@ settings_tab_draw(InbeApp *app)
app->settings_category = -1;
app->settings_sub_tab = 0;
app->settings_scroll = 0;
app->inbe.screen = InbeScreenStart; /* Close button always exits to homepage */
app->inbe.screen = app->main_tab == APP_MAIN_TAB_HABITS
? InbeScreenHabits
: InbeScreenStart;
}
} else {
close_clicked = ui_draw_screen_header(locale_get("settings_title"), 1);
FlintUIHeader header = ui_draw_title_header(title_h, locale_get("settings_title"),
(Texture2D){0}, UI_ICON_TYPE_NONE,
app->x_icon, UI_ICON_TYPE_X);
close_clicked = header.right_clicked;
if(close_clicked) {
if(app->settings_dirty)
save_settings(app);
@@ -459,7 +466,9 @@ settings_tab_draw(InbeApp *app)
app->settings_from_exercise_selector = 0;
app->settings_category = -1;
app->settings_sub_tab = 0;
app->inbe.screen = InbeScreenStart;
app->inbe.screen = app->main_tab == APP_MAIN_TAB_HABITS
? InbeScreenHabits
: InbeScreenStart;
}
}
@@ -485,12 +494,33 @@ settings_tab_draw(InbeApp *app)
int language_menu_changed = 0;
int draw_language_menu = 0;
int draw_meditation_music_menu = 0;
int draw_theme_mode_menu = 0;
int draw_orientation_menu = 0;
int theme_mode_changed = 0;
int orientation_changed = 0;
const char *theme_mode_options[] = {
locale_get("theme_system"),
locale_get("theme_light"),
locale_get("theme_dark")
};
const char *orientation_options[] = {
locale_get("orientation_system"),
locale_get("orientation_portrait"),
locale_get("orientation_landscape"),
locale_get("orientation_sensor")
};
int orientation_option_count =
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
4;
#else
3;
#endif
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
settings_tab_handle_android_import();
#endif
BeginScissorMode((int)app->camera.offset.x,
ui_begin_scissor((int)app->camera.offset.x,
(int)(app->camera.offset.y + title_h * app->camera.zoom),
(int)(view_width * app->camera.zoom),
(int)(viewport_h * app->camera.zoom));
@@ -525,11 +555,32 @@ settings_tab_draw(InbeApp *app)
app->settings_sub_tab);
if(clicked_subtab != -1) {
app->settings_sub_tab = clicked_subtab;
app->settings_scroll = 0;
reset_settings_preview(app);
}
{
int tab_content_y = subtab_y + subtab_h + yoff;
int tab_view_y = subtab_y + subtab_h + yoff;
int tab_view_h = view_height - tab_view_y - flint_px(TAB_BAR_H);
int tab_content_h = app->settings_sub_tab == PRACTICE_SUBTAB_BREATHING
? flint_px(app->inbe.progressive_speed ? 410 : 360)
: flint_px(365);
FlintUIScrollArea scroll_area;
FlintUIScrollView scroll_view;
int tab_content_y;
if(tab_view_h < flint_px(80))
tab_view_h = flint_px(80);
scroll_area = (FlintUIScrollArea){
.bounds = {(float)content_x, (float)tab_view_y,
(float)content_w, (float)tab_view_h},
.content_height = tab_content_h,
.scroll_offset = &app->settings_scroll,
.wheel_step = flint_px(42)
};
scroll_view = ui_scroll_container_begin(scroll_area);
tab_content_y = scroll_view.content_y;
if(app->settings_sub_tab == PRACTICE_SUBTAB_BREATHING) {
int progressive_start_speed = app->inbe.progressive_start_speed;
int progressive_speed = app->inbe.progressive_speed;
@@ -641,32 +692,32 @@ settings_tab_draw(InbeApp *app)
app->settings_dirty = 1;
}
}
ui_scroll_container_end(scroll_area, scroll_view);
}
} else if(app->settings_category == SETTINGS_CATEGORY_MEDITATION) {
int y = content_start_y + flint_px(16) - app->settings_scroll;
int content_top = y;
int scroll_y = content_start_y + flint_px(16);
int scroll_h = view_height - scroll_y - flint_px(TAB_BAR_H);
int scroll_content_h = flint_px(300);
int y;
FlintUIScrollArea scroll_area;
FlintUIScrollView scroll_view;
if(scroll_h < flint_px(80))
scroll_h = flint_px(80);
scroll_area = (FlintUIScrollArea){
.bounds = {(float)content_x, (float)scroll_y,
(float)content_w, (float)scroll_h},
.content_height = scroll_content_h,
.scroll_offset = &app->settings_scroll,
.wheel_step = flint_px(42)
};
scroll_view = ui_scroll_container_begin(scroll_area);
y = scroll_view.content_y;
settings_draw_section_title(locale_get("meditation_music_section_title"), content_x, &y);
meditation_music_draw_settings(app, content_x, content_w, &y);
draw_meditation_music_menu = 1;
y += flint_px(40);
{
int total_content_h = y - content_top;
int max_scroll = total_content_h - viewport_h;
if(max_scroll < 0)
max_scroll = 0;
app->settings_scroll -= (int)(GetMouseWheelMove() * 24.0f);
app->settings_scroll = clampi(app->settings_scroll, 0, max_scroll);
if(max_scroll > 0) {
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)(viewport_h * app->camera.zoom);
int total_content_screen_h = (int)(total_content_h * app->camera.zoom);
ui_draw_scrollbar(scrollbar_x, scrollbar_y, scrollbar_viewport, total_content_screen_h,
&app->settings_scroll, max_scroll);
}
}
ui_scroll_container_end(scroll_area, scroll_view);
} else {
int subtab_h = flint_px(40);
int subtab_gap = flint_px(16);
@@ -702,8 +753,8 @@ settings_tab_draw(InbeApp *app)
content_top = y;
}
EndScissorMode();
BeginScissorMode((int)app->camera.offset.x,
ui_end_scissor();
ui_begin_scissor((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));
@@ -732,6 +783,27 @@ settings_tab_draw(InbeApp *app)
#endif
settings_draw_section_title(locale_get("settings_tab_appearance"), content_x, &y);
{
app->theme_mode = clampi(app->theme_mode, APP_THEME_SYSTEM, APP_THEME_DARK);
flint_text_draw(locale_get("theme_mode_label"), content_x, y, flint_ui_font(), c_text);
ui_draw_dropdown_button(102, content_x, y + flint_px(26), content_w,
flint_px(36), theme_mode_options, 3, &app->theme_mode);
draw_theme_mode_menu = 1;
y += flint_px(76);
}
{
int orientation_max = orientation_option_count - 1;
app->orientation_mode = clampi(app->orientation_mode,
APP_ORIENTATION_SYSTEM,
orientation_max);
flint_text_draw(locale_get("orientation_label"), content_x, y,
flint_ui_font(), c_text);
ui_draw_dropdown_button(103, content_x, y + flint_px(26), content_w,
flint_px(36), orientation_options, orientation_option_count,
&app->orientation_mode);
draw_orientation_menu = 1;
y += flint_px(76);
}
#if !defined(PLATFORM_ANDROID) && !defined(__ANDROID__) && !defined(ANDROID) && !defined(PLATFORM_WEB)
if(ui_draw_checkbox_toggle(content_x, y, locale_get("fullscreen_label"), &app->fullscreen_enabled)) {
if(app->fullscreen_enabled && !IsWindowFullscreen())
@@ -795,14 +867,32 @@ settings_tab_draw(InbeApp *app)
}
}
}
EndScissorMode();
ui_end_scissor();
/* Draw dropdown menu (floats above content) */
ui_set_dropdown_clip_top(title_h);
if(draw_language_menu && language_dropdown_menu(app, 101))
language_menu_changed = 1;
if(draw_theme_mode_menu && ui_draw_dropdown_menu(102))
theme_mode_changed = 1;
if(draw_orientation_menu && ui_draw_dropdown_menu(103))
orientation_changed = 1;
if(language_menu_changed)
apply_language_selection(app, app->language_index, 1);
if(theme_mode_changed) {
app->theme_mode = clampi(app->theme_mode, APP_THEME_SYSTEM, APP_THEME_DARK);
app_refresh_theme(app);
app->settings_dirty = 1;
save_settings(app);
}
if(orientation_changed) {
int orientation_max = orientation_option_count - 1;
app->orientation_mode = clampi(app->orientation_mode, APP_ORIENTATION_SYSTEM,
orientation_max);
app_apply_orientation_preference(app);
app->settings_dirty = 1;
save_settings(app);
}
if(draw_meditation_music_menu)
meditation_music_draw_dropdown_menu(app);
ui_set_dropdown_clip_top(0);
@@ -898,11 +988,14 @@ settings_tab_draw(InbeApp *app)
if(ui_draw_generic_button(modal_x + flint_px(18), y, button_w, button_h,
locale_get("export_data_button"), UI_BUTTON_STYLE_PRIMARY,
0, &hover_export)) {
char export_filename[64];
data_default_export_filename(export_filename, sizeof(export_filename));
if(!data_has_any()) {
settings_tab_set_status_error(locale_get("no_data_to_export"));
}
#if defined(PLATFORM_ANDROID) || defined(__ANDROID__) || defined(ANDROID)
else if(data_export("inbe-export.zip")) {
else if(data_export(export_filename)) {
settings_tab_set_status_success(locale_get("exported_label"), NULL);
app->modal.active = 0;
app->modal.type = UIModalNone;
@@ -914,7 +1007,7 @@ settings_tab_draw(InbeApp *app)
#elif defined(INBE_HAS_FLINT_FILE_DIALOG)
else {
settings_apply_file_dialog_theme(app);
if(flint_file_dialog_save(&export_dlg, locale_get("export_data_dialog_title"), "inbe-export.zip")) {
if(flint_file_dialog_save(&export_dlg, locale_get("export_data_dialog_title"), export_filename)) {
const char *path = flint_file_dialog_get_path(&export_dlg);
if(path != NULL && data_export(path)) {
const char *filename = GetFileName(path);
+3 -3
View File
@@ -2,8 +2,8 @@
#define INBE_VERSION_H
#define INBE_VERSION_MAJOR 1
#define INBE_VERSION_MINOR 2
#define INBE_VERSION_PATCH 6
#define INBE_VERSION_STRING "1.2.6"
#define INBE_VERSION_MINOR 3
#define INBE_VERSION_PATCH 0
#define INBE_VERSION_STRING "1.3.0"
#endif
+4 -4
View File
@@ -3,8 +3,8 @@
IDI_APP_ICON ICON "inbe.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,2,6,0
PRODUCTVERSION 1,2,6,0
FILEVERSION 1,3,0,0
PRODUCTVERSION 1,3,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -21,11 +21,11 @@ BEGIN
BEGIN
VALUE "CompanyName", "waozi"
VALUE "FileDescription", "Inner Breeze"
VALUE "FileVersion", "1.2.6"
VALUE "FileVersion", "1.3.0"
VALUE "InternalName", "inbe"
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
VALUE "ProductName", "Inner Breeze"
VALUE "ProductVersion", "1.2.6"
VALUE "ProductVersion", "1.3.0"
END
END
BLOCK "VarFileInfo"