Skip to content

Commit a7b97b8

Browse files
feat: textarea element and refactor/change default animation
1 parent 5cfe662 commit a7b97b8

31 files changed

+1181
-400
lines changed

deps/breeze-ui.lua

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ package("breeze-glfw")
55

66
local BREEZE_UI_VER = "2026.03.27"
77
local BREEZE_UI_HASH = "d09a08ea0d212b5793ae1d7ce4b174b2a303010e"
8+
local USE_LOCAL_BREEZE_UI = os.getenv("CI") ~= "true"
9+
local BREEZE_UI_LOCAL_PATH = "../breeze-ui"
810

911
package("breeze-nanosvg")
10-
add_urls("https://github.com/std-microblock/breeze-ui.git")
11-
add_versions(BREEZE_UI_VER, BREEZE_UI_HASH)
12+
if USE_LOCAL_BREEZE_UI then
13+
set_sourcedir(BREEZE_UI_LOCAL_PATH)
14+
else
15+
add_urls("https://github.com/std-microblock/breeze-ui.git")
16+
add_versions(BREEZE_UI_VER, BREEZE_UI_HASH)
17+
end
1218

1319
set_kind("library", {headeronly = true})
1420
set_description("The breeze-nanosvg package")
@@ -18,8 +24,12 @@ package("breeze-nanosvg")
1824
end)
1925

2026
package("breeze-nanovg")
21-
add_urls("https://github.com/std-microblock/breeze-ui.git")
22-
add_versions(BREEZE_UI_VER, BREEZE_UI_HASH)
27+
if USE_LOCAL_BREEZE_UI then
28+
set_sourcedir(BREEZE_UI_LOCAL_PATH)
29+
else
30+
add_urls("https://github.com/std-microblock/breeze-ui.git")
31+
add_versions(BREEZE_UI_VER, BREEZE_UI_HASH)
32+
end
2333

2434
set_description("The breeze-nanovg package")
2535

@@ -31,15 +41,19 @@ package("breeze-nanovg")
3141

3242

3343
package("breeze-ui")
34-
add_urls("https://github.com/std-microblock/breeze-ui.git")
35-
add_versions(BREEZE_UI_VER, BREEZE_UI_HASH)
36-
add_deps("breeze-glfw", "glad", "nanovg", "breeze-nanosvg", {
44+
if USE_LOCAL_BREEZE_UI then
45+
set_sourcedir(BREEZE_UI_LOCAL_PATH)
46+
else
47+
add_urls("https://github.com/std-microblock/breeze-ui.git")
48+
add_versions(BREEZE_UI_VER, BREEZE_UI_HASH)
49+
end
50+
add_deps("breeze-glfw", "glad", "nanovg", "breeze-nanosvg", "simdutf", {
3751
public = true
3852
})
3953
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
4054

4155
if is_plat("windows") then
42-
add_syslinks("dwmapi", "shcore", "windowsapp", "CoreMessaging")
56+
add_syslinks("dwmapi", "imm32", "shcore", "windowsapp", "CoreMessaging")
4357
end
4458

4559
on_install("windows", function (package)

src/shell/config.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ struct config {
7777
animated_float_conf y;
7878
} main;
7979
struct item {
80-
animated_float_conf opacity;
81-
animated_float_conf x, y;
80+
animated_float_conf opacity{.delay_scale = 0.6f};
81+
animated_float_conf x{.easing = ui::easing_type::mutation},
82+
y;
8283
animated_float_conf width;
83-
animated_float_conf blur;
84+
animated_float_conf blur{
85+
.easing = ui::easing_type::ease_in_out,
86+
.delay_scale = 0.7f,
87+
};
8488
float appear_blur = 2.5f;
8589
} item;
8690
struct bg {

src/shell/contextmenu/hooks.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ mb_shell::track_popup_menu(mb_shell::menu menu, int x, int y,
6969

7070
return menu_render.selected_menu;
7171
} catch (std::exception &e) {
72-
std::cerr << "Exception in track_popup_menu: " << e.what()
73-
<< std::endl;
72+
spdlog::error("Error in track_popup_menu: {}", e.what());
7473
return std::optional<int>{};
7574
}
7675
});
@@ -159,8 +158,8 @@ void mb_shell::context_menu_hooks::install_SHCreateDefaultContextMenu_hook() {
159158
auto user32 = proc->module("user32.dll");
160159
auto CreateWindowExWFunc = user32.value()->exports("CreateWindowExW");
161160
if (!CreateWindowExWFunc) {
162-
std::cerr << "Failed to find CreateWindowExW in user32.dll"
163-
<< std::endl;
161+
spdlog::error("Failed to find CreateWindowExW export");
162+
return;
164163
}
165164
static auto CreateWindowExWHook = CreateWindowExWFunc->inline_hook();
166165
CreateWindowExWHook->install(
@@ -288,7 +287,7 @@ void mb_shell::context_menu_hooks::install_GetUIObjectOf_hook() {
288287
IShellFolder *psfDesktop = NULL;
289288
IShellFolder2 *psf2Desktop = NULL;
290289
if (NOERROR != SHGetDesktopFolder(&psfDesktop)) {
291-
std::cerr << "Failed to get desktop shell folder" << std::endl;
290+
spdlog::error("Failed to get desktop shell folder");
292291
return;
293292
}
294293
psfDesktop->QueryInterface(IID_IShellFolder2, (void **)&psf2Desktop);

src/shell/contextmenu/menu_widget.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void mb_shell::menu_item_normal_widget::update(ui::update_context &ctx) {
258258
try {
259259
item.action.value()();
260260
} catch (std::exception &e) {
261-
std::cerr << "Error in action: " << e.what() << std::endl;
261+
spdlog::error("Error in menu item action: {}", e.what());
262262
}
263263
}
264264
}
@@ -475,8 +475,7 @@ void mb_shell::menu_widget::update(ui::update_context &ctx) {
475475
try {
476476
wid->item.action.value()();
477477
} catch (std::exception &e) {
478-
std::cerr << "Error in action: " << e.what()
479-
<< std::endl;
478+
spdlog::error("Error in menu item action: {}", e.what());
480479
}
481480
} else if (wid->item.submenu) {
482481
wid->show_submenu(ctx);
@@ -577,8 +576,7 @@ void mb_shell::menu_widget::update(ui::update_context &ctx) {
577576
try {
578577
wid->item.action.value()();
579578
} catch (std::exception &e) {
580-
std::cerr << "Error in action: " << e.what()
581-
<< std::endl;
579+
spdlog::error("Error in menu item action: {}", e.what());
582580
}
583581
} else if (wid && wid->item.submenu && !wid->submenu_wid) {
584582
wid->show_submenu(ctx);

src/shell/qjs_sanitizer.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <string>
88
#include <unordered_map>
99
#include <thread>
10+
#include "spdlog/spdlog.h"
1011

1112
#define FN(name) {#name, (void *)&name}
1213
static const std::unordered_map<std::string, void *> func_to_hook = {
@@ -188,7 +189,7 @@ void mb_shell::qjs_sanitizer_enable() {
188189
auto existing_thread_id = thread_context_map[js_ctx];
189190
if (existing_thread_id != std::this_thread::get_id()) {
190191
// Detected cross-thread JS context access
191-
std::cerr << "Detected cross-thread access to JSContext in function " << name << std::endl;
192+
spdlog::error("Detected cross-thread access to JSContext in function {}", name);
192193
}
193194
}
194195
}

0 commit comments

Comments
 (0)