From cd0d7bdecdf85d4bfb9658ba9136f11d4c374938 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Tue, 21 Dec 2021 18:11:29 -0500 Subject: [PATCH 1/3] changelog: Use x.y.z for versioning, rather than x.yy.zz --- nuklear.h | 13 ++++++------- src/CHANGELOG | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/nuklear.h b/nuklear.h index a4e772c..a423a43 100644 --- a/nuklear.h +++ b/nuklear.h @@ -29613,13 +29613,12 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// ## Changelog /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none -/// [date][x.yy.zz]-[description] -/// -[date]: date on which the change has been pushed -/// -[x.yy.zz]: Numerical version string representation. Each version number on the right -/// resets back to zero if version on the left is incremented. -/// - [x]: Major version with API and library breaking changes -/// - [yy]: Minor version with non-breaking API and library changes -/// - [zz]: Bug fix version with no direct changes to API +/// [date] ([x.y.z]) - [description] +/// - [date]: date on which the change has been pushed +/// - [x.y.z]: Numerical version string representation +/// - [x]: Major version with API and library breaking changes +/// - [y]: Minor version with non-breaking API and library changes +/// - [z]: Bug fix version with no direct changes to API /// /// - 2021/12/19 (4.09.2) - Update to stb_rect_pack.h v1.01 and stb_truetype.h v1.26 /// - 2021/12/16 (4.09.1) - Fix the majority of GCC warnings diff --git a/src/CHANGELOG b/src/CHANGELOG index 3595944..1891c0c 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -1,12 +1,11 @@ /// ## Changelog /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none -/// [date][x.yy.zz]-[description] -/// -[date]: date on which the change has been pushed -/// -[x.yy.zz]: Numerical version string representation. Each version number on the right -/// resets back to zero if version on the left is incremented. -/// - [x]: Major version with API and library breaking changes -/// - [yy]: Minor version with non-breaking API and library changes -/// - [zz]: Bug fix version with no direct changes to API +/// [date] ([x.y.z]) - [description] +/// - [date]: date on which the change has been pushed +/// - [x.y.z]: Numerical version string representation +/// - [x]: Major version with API and library breaking changes +/// - [y]: Minor version with non-breaking API and library changes +/// - [z]: Bug fix version with no direct changes to API /// /// - 2021/12/19 (4.09.2) - Update to stb_rect_pack.h v1.01 and stb_truetype.h v1.26 /// - 2021/12/16 (4.09.1) - Fix the majority of GCC warnings From 0aa9a15a6c3bdf725da71013daadd1b86a9dc775 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Wed, 22 Dec 2021 12:06:15 -0500 Subject: [PATCH 2/3] changelog: Reference Semantic Versioning directly --- nuklear.h | 4 ++-- src/CHANGELOG | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nuklear.h b/nuklear.h index a423a43..8f835f2 100644 --- a/nuklear.h +++ b/nuklear.h @@ -29615,10 +29615,10 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none /// [date] ([x.y.z]) - [description] /// - [date]: date on which the change has been pushed -/// - [x.y.z]: Numerical version string representation +/// - [x.y.z]: Version string, represented in Semantic Versioning format /// - [x]: Major version with API and library breaking changes /// - [y]: Minor version with non-breaking API and library changes -/// - [z]: Bug fix version with no direct changes to API +/// - [z]: Patch version with no direct changes to the API /// /// - 2021/12/19 (4.09.2) - Update to stb_rect_pack.h v1.01 and stb_truetype.h v1.26 /// - 2021/12/16 (4.09.1) - Fix the majority of GCC warnings diff --git a/src/CHANGELOG b/src/CHANGELOG index 1891c0c..603ab95 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -2,10 +2,10 @@ /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none /// [date] ([x.y.z]) - [description] /// - [date]: date on which the change has been pushed -/// - [x.y.z]: Numerical version string representation +/// - [x.y.z]: Version string, represented in Semantic Versioning format /// - [x]: Major version with API and library breaking changes /// - [y]: Minor version with non-breaking API and library changes -/// - [z]: Bug fix version with no direct changes to API +/// - [z]: Patch version with no direct changes to the API /// /// - 2021/12/19 (4.09.2) - Update to stb_rect_pack.h v1.01 and stb_truetype.h v1.26 /// - 2021/12/16 (4.09.1) - Fix the majority of GCC warnings From aa47577bae8098301a3ee604a6e6d1670ea0b73d Mon Sep 17 00:00:00 2001 From: YgorVasilenko <41551412+YgorVasilenko@users.noreply.github.com> Date: Wed, 22 Dec 2021 22:43:42 +0300 Subject: [PATCH 3/3] window: Fix hover state when window is minimized (#284) * Fix hovering check when window is minimized * Align line * window: Fix checking hovering when window is minimized * changelog: Update version in clib.json Fixes #284 --- clib.json | 2 +- nuklear.h | 15 ++++++++++----- src/CHANGELOG | 1 + src/nuklear_layout.c | 3 +-- src/nuklear_window.c | 11 ++++++++--- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/clib.json b/clib.json index 7baddd9..f44cdd4 100644 --- a/clib.json +++ b/clib.json @@ -1,6 +1,6 @@ { "name": "nuklear", - "version": "4.09.3", + "version": "4.9.4", "repo": "Immediate-Mode-UI/Nuklear", "description": "A small ANSI C gui toolkit", "keywords": ["gl", "ui", "toolkit"], diff --git a/nuklear.h b/nuklear.h index d3d3fa8..523600d 100644 --- a/nuklear.h +++ b/nuklear.h @@ -20446,10 +20446,15 @@ nk_window_is_hovered(struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return 0; - if(ctx->current->flags & NK_WINDOW_HIDDEN) + if (!ctx || !ctx->current || (ctx->current->flags & NK_WINDOW_HIDDEN)) return 0; - return nk_input_is_mouse_hovering_rect(&ctx->input, ctx->current->bounds); + else { + struct nk_rect actual_bounds = ctx->current->bounds; + if (ctx->begin->flags & NK_WINDOW_MINIMIZED) { + actual_bounds.h = ctx->current->layout->header_height; + } + return nk_input_is_mouse_hovering_rect(&ctx->input, actual_bounds); + } } NK_API nk_bool nk_window_is_any_hovered(struct nk_context *ctx) @@ -22226,7 +22231,7 @@ nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx) layout->at_y = y; layout->row.index = index; } -NK_API void +NK_API void nk_spacer(struct nk_context *ctx ) { struct nk_rect dummy_rect = { 0, 0, 0, 0 }; @@ -22236,7 +22241,6 @@ nk_spacer(struct nk_context *ctx ) - /* =============================================================== * * TREE @@ -29622,6 +29626,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) /// - [y]: Minor version with non-breaking API and library changes /// - [z]: Patch version with no direct changes to the API /// +/// - 2021/12/22 (4.9.4) - Fix checking hovering when window is minimized /// - 2021/12/22 (4.09.3) - Fix layout bounds not accounting for padding. /// - 2021/12/19 (4.09.2) - Update to stb_rect_pack.h v1.01 and stb_truetype.h v1.26 /// - 2021/12/16 (4.09.1) - Fix the majority of GCC warnings diff --git a/src/CHANGELOG b/src/CHANGELOG index 0dfcfcd..93ca031 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -7,6 +7,7 @@ /// - [y]: Minor version with non-breaking API and library changes /// - [z]: Patch version with no direct changes to the API /// +/// - 2021/12/22 (4.9.4) - Fix checking hovering when window is minimized /// - 2021/12/22 (4.09.3) - Fix layout bounds not accounting for padding. /// - 2021/12/19 (4.09.2) - Update to stb_rect_pack.h v1.01 and stb_truetype.h v1.26 /// - 2021/12/16 (4.09.1) - Fix the majority of GCC warnings diff --git a/src/nuklear_layout.c b/src/nuklear_layout.c index 269cfd4..0229bd0 100644 --- a/src/nuklear_layout.c +++ b/src/nuklear_layout.c @@ -760,10 +760,9 @@ nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx) layout->at_y = y; layout->row.index = index; } -NK_API void +NK_API void nk_spacer(struct nk_context *ctx ) { struct nk_rect dummy_rect = { 0, 0, 0, 0 }; nk_panel_alloc_space( &dummy_rect, ctx ); } - diff --git a/src/nuklear_window.c b/src/nuklear_window.c index 558ebce..486b912 100644 --- a/src/nuklear_window.c +++ b/src/nuklear_window.c @@ -431,10 +431,15 @@ nk_window_is_hovered(struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return 0; - if(ctx->current->flags & NK_WINDOW_HIDDEN) + if (!ctx || !ctx->current || (ctx->current->flags & NK_WINDOW_HIDDEN)) return 0; - return nk_input_is_mouse_hovering_rect(&ctx->input, ctx->current->bounds); + else { + struct nk_rect actual_bounds = ctx->current->bounds; + if (ctx->begin->flags & NK_WINDOW_MINIMIZED) { + actual_bounds.h = ctx->current->layout->header_height; + } + return nk_input_is_mouse_hovering_rect(&ctx->input, actual_bounds); + } } NK_API nk_bool nk_window_is_any_hovered(struct nk_context *ctx)