diff --git a/nuklear.h b/nuklear.h index 7c950e0..e125865 100644 --- a/nuklear.h +++ b/nuklear.h @@ -2577,6 +2577,21 @@ NK_API struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct /// Returns transformed `nk_rect` in layout space coordinates */ NK_API struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect); + +/*/// #### nk_spacer +/// Spacer is a dummy widget that consumes space as usual but doesn't draw anything +/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c +/// void nk_spacer(struct nk_context* ); +/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/// +/// Parameter | Description +/// ------------|----------------------------------------------------------- +/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` +/// +*/ +NK_API void nk_spacer(struct nk_context* ); + + /* ============================================================================= * * GROUP @@ -22148,6 +22163,12 @@ nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx) layout->at_y = y; layout->row.index = index; } +NK_API void +nk_spacer(struct nk_context *ctx ) +{ + struct nk_rect dummy_rect = {0}; + nk_panel_alloc_space( &dummy_rect, ctx ); +} @@ -29539,6 +29560,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// - [yy]: Minor version with non-breaking API and library changes /// - [zz]: Bug fix version with no direct changes to API /// +/// - 2021/10/16 (4.09.0) - Added nk_spacer() widget /// - 2021/09/22 (4.08.6) - Fix "may be used uninitialized" warnings in nk_widget /// - 2021/09/22 (4.08.5) - GCC __builtin_offsetof only exists in version 4 and later /// - 2021/09/15 (4.08.4) - Fix "'num_len' may be used uninitialized" in nk_do_property diff --git a/package.json b/package.json index 6acf1fe..65aa3eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuklear", - "version": "4.08.6", + "version": "4.09.0", "repo": "Immediate-Mode-UI/Nuklear", "description": "A small ANSI C gui toolkit", "keywords": ["gl", "ui", "toolkit"], diff --git a/src/CHANGELOG b/src/CHANGELOG index b88b388..ce587c8 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -8,6 +8,7 @@ /// - [yy]: Minor version with non-breaking API and library changes /// - [zz]: Bug fix version with no direct changes to API /// +/// - 2021/10/16 (4.09.0) - Added nk_spacer() widget /// - 2021/09/22 (4.08.6) - Fix "may be used uninitialized" warnings in nk_widget /// - 2021/09/22 (4.08.5) - GCC __builtin_offsetof only exists in version 4 and later /// - 2021/09/15 (4.08.4) - Fix "'num_len' may be used uninitialized" in nk_do_property diff --git a/src/nuklear.h b/src/nuklear.h index c195690..89a75b6 100644 --- a/src/nuklear.h +++ b/src/nuklear.h @@ -2356,6 +2356,21 @@ NK_API struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct /// Returns transformed `nk_rect` in layout space coordinates */ NK_API struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect); + +/*/// #### nk_spacer +/// Spacer is a dummy widget that consumes space as usual but doesn't draw anything +/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c +/// void nk_spacer(struct nk_context* ); +/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/// +/// Parameter | Description +/// ------------|----------------------------------------------------------- +/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` +/// +*/ +NK_API void nk_spacer(struct nk_context* ); + + /* ============================================================================= * * GROUP diff --git a/src/nuklear_layout.c b/src/nuklear_layout.c index bfd99c2..b737aca 100644 --- a/src/nuklear_layout.c +++ b/src/nuklear_layout.c @@ -760,4 +760,10 @@ nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx) layout->at_y = y; layout->row.index = index; } +NK_API void +nk_spacer(struct nk_context *ctx ) +{ + struct nk_rect dummy_rect = {0}; + nk_panel_alloc_space( &dummy_rect, ctx ); +}