Skip to content

Commit 80417d5

Browse files
feat(js): impl max_height, enable_scrolling, enable_child_clipping, crop_overflow
1 parent 13b60e1 commit 80417d5

File tree

9 files changed

+54
-8
lines changed

9 files changed

+54
-8
lines changed

dependencies/breeze-ui.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package("breeze-glfw")
55

66
package("breeze-ui")
77
add_urls("https://github.com/std-microblock/breeze-ui.git")
8-
add_versions("2025.10.09+14", "f29302344b8806bf6ed2c481cbff905619b0d08f")
8+
add_versions("2025.10.09+15", "c4129446879bc3fbe73bbd36b393a9cb8d9d401f")
99
add_deps("breeze-glfw", "nanovg", "glad", "nanosvg")
1010
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
1111

src/shell/script/binding_qjs.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ template<> struct js_bind<mb_shell::js::breeze_ui::js_flex_layout_widget> {
104104
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_padding_top, &mb_shell::js::breeze_ui::js_flex_layout_widget::set_padding_top>("padding_top")
105105
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_padding_bottom, &mb_shell::js::breeze_ui::js_flex_layout_widget::set_padding_bottom>("padding_bottom")
106106
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_flex_grow, &mb_shell::js::breeze_ui::js_flex_layout_widget::set_flex_grow>("flex_grow")
107+
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_max_height, &mb_shell::js::breeze_ui::js_flex_layout_widget::set_max_height>("max_height")
108+
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_enable_scrolling, &mb_shell::js::breeze_ui::js_flex_layout_widget::set_enable_scrolling>("enable_scrolling")
109+
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_enable_child_clipping, &mb_shell::js::breeze_ui::js_flex_layout_widget::set_enable_child_clipping>("enable_child_clipping")
110+
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_crop_overflow, &mb_shell::js::breeze_ui::js_flex_layout_widget::set_crop_overflow>("crop_overflow")
107111
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_padding>("padding")
108112
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_on_click, &mb_shell::js::breeze_ui::js_flex_layout_widget::set_on_click>("on_click")
109113
.property<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_on_mouse_move, &mb_shell::js::breeze_ui::js_flex_layout_widget::set_on_mouse_move>("on_mouse_move")
@@ -134,6 +138,14 @@ template<> struct js_bind<mb_shell::js::breeze_ui::js_flex_layout_widget> {
134138
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::set_padding_bottom>("set_padding_bottom")
135139
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_flex_grow>("get_flex_grow")
136140
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::set_flex_grow>("set_flex_grow")
141+
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_max_height>("get_max_height")
142+
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::set_max_height>("set_max_height")
143+
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_enable_scrolling>("get_enable_scrolling")
144+
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::set_enable_scrolling>("set_enable_scrolling")
145+
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_enable_child_clipping>("get_enable_child_clipping")
146+
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::set_enable_child_clipping>("set_enable_child_clipping")
147+
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_crop_overflow>("get_crop_overflow")
148+
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::set_crop_overflow>("set_crop_overflow")
137149
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_padding>("get_padding")
138150
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::set_padding>("set_padding")
139151
.fun<&mb_shell::js::breeze_ui::js_flex_layout_widget::get_on_click>("get_on_click")

src/shell/script/binding_types.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ export class js_flex_layout_widget extends js_widget {
7979
set padding_bottom(value: number);
8080
get flex_grow(): number;
8181
set flex_grow(value: number);
82+
get max_height(): number;
83+
set max_height(value: number);
84+
get enable_scrolling(): boolean;
85+
set enable_scrolling(value: boolean);
86+
get enable_child_clipping(): boolean;
87+
set enable_child_clipping(value: boolean);
88+
get crop_overflow(): boolean;
89+
set crop_overflow(value: boolean);
8290
get padding(): [number, number, number, number];
8391
get on_click(): ((arg1: number) => void);
8492
set on_click(value: ((arg1: number) => void));

src/shell/script/binding_types_breeze_ui.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,18 @@ IMPL_ANIMATED_PROP(breeze_ui::js_flex_layout_widget, widget_js_base,
462462

463463
IMPL_SIMPLE_PROP(breeze_ui::js_flex_layout_widget, widget_js_base, auto_size,
464464
bool)
465+
IMPL_SIMPLE_PROP(breeze_ui::js_flex_layout_widget, widget_js_base, gap, float)
466+
IMPL_SIMPLE_PROP(breeze_ui::js_flex_layout_widget, widget_js_base, max_height,
467+
float)
468+
IMPL_SIMPLE_PROP(breeze_ui::js_flex_layout_widget, widget_js_base,
469+
enable_child_clipping, bool)
470+
IMPL_SIMPLE_PROP(breeze_ui::js_flex_layout_widget, widget_js_base,
471+
enable_scrolling, bool)
472+
IMPL_SIMPLE_PROP(breeze_ui::js_flex_layout_widget, widget_js_base,
473+
crop_overflow, bool)
465474
IMPL_SIMPLE_PROP(breeze_ui::js_flex_layout_widget, widget_js_base, flex_grow,
466475
float)
467-
IMPL_SIMPLE_PROP(breeze_ui::js_flex_layout_widget, widget_js_base, gap, float)
476+
468477
std::string breeze_ui::js_flex_layout_widget::get_justify_content() const {
469478
auto widget = std::dynamic_pointer_cast<ui::flex_widget>($widget);
470479
if (!widget)

src/shell/script/binding_types_breeze_ui.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ struct breeze_ui {
8484
DEFINE_PROP(float, padding_top)
8585
DEFINE_PROP(float, padding_bottom)
8686
DEFINE_PROP(float, flex_grow)
87+
DEFINE_PROP(float, max_height)
88+
DEFINE_PROP(bool, enable_scrolling)
89+
DEFINE_PROP(bool, enable_child_clipping)
90+
DEFINE_PROP(bool, crop_overflow)
8791
std::tuple<float, float, float, float> get_padding() const;
8892
void set_padding(float left, float right, float top, float bottom);
8993

src/shell/script/script.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/shell/script/ts/src/jsx.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ declare module 'react' {
3434
autoSize?: boolean;
3535
gap?: number;
3636
flexGrow?: number;
37+
maxHeight?: number;
38+
enableScrolling?: boolean;
39+
enableChildClipping?: boolean;
40+
cropOverflow?: boolean;
3741
},
3842
text: {
3943
text?: string[] | string;

src/shell/script/ts/src/react/renderer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ const componentMap = {
138138
alignItems: getSetFactory('align_items'),
139139
gap: getSetFactory('gap'),
140140
flexGrow: getSetFactory('flex_grow'),
141+
maxHeight: getSetFactory('max_height'),
142+
enableScrolling: getSetFactory('enable_scrolling'),
143+
enableChildClipping: getSetFactory('enable_child_clipping'),
144+
cropOverflow: getSetFactory('crop_overflow'),
141145
...commonProps
142146
}
143147
},

src/shell/script/ts/yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@
145145
"@types/prop-types" "*"
146146
csstype "^3.0.2"
147147

148+
breeze-shell-types@^0.0.14:
149+
version "0.0.14"
150+
resolved "https://registry.yarnpkg.com/breeze-shell-types/-/breeze-shell-types-0.0.14.tgz#eccff81d132510e8e5d0a2ad954bda450fe80255"
151+
integrity sha512-pggWZUNT2l+HRnIfhWHgkFJGAOZVq+olAfJE1b6WYeFSEJSzP5XANubSSeKojb7CgRXq2OsgQcMXJeYRAW0U9Q==
152+
148153
csstype@^3.0.2:
149154
version "3.1.3"
150155
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81"

0 commit comments

Comments
 (0)