From 2849cdf8cd52e92cefea9ad0a8f56bf21a5fe2f0 Mon Sep 17 00:00:00 2001 From: Naoyuki Sawa Date: Tue, 15 Nov 2016 19:49:24 +0900 Subject: fix: In the windows demos, the key reaction is occured at the timing of the control keys are released. --- demo/d3d11/nuklear_d3d11.h | 2 +- demo/gdi/nuklear_gdi.h | 2 +- demo/gdip/nuklear_gdip.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/d3d11/nuklear_d3d11.h b/demo/d3d11/nuklear_d3d11.h index 68b067f..717686c 100644 --- a/demo/d3d11/nuklear_d3d11.h +++ b/demo/d3d11/nuklear_d3d11.h @@ -205,7 +205,7 @@ nk_d3d11_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam) case WM_SYSKEYDOWN: case WM_SYSKEYUP: { - int down = (lparam >> 31) & 1; + int down = (lparam >> 31) & 1 ? 0 : 1; int ctrl = GetKeyState(VK_CONTROL) & (1 << 15); switch (wparam) diff --git a/demo/gdi/nuklear_gdi.h b/demo/gdi/nuklear_gdi.h index e2792e4..9fb919f 100644 --- a/demo/gdi/nuklear_gdi.h +++ b/demo/gdi/nuklear_gdi.h @@ -516,7 +516,7 @@ nk_gdi_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam) case WM_SYSKEYDOWN: case WM_SYSKEYUP: { - int down = (lparam >> 31) & 1; + int down = (lparam >> 31) & 1 ? 0 : 1; int ctrl = GetKeyState(VK_CONTROL) & (1 << 15); switch (wparam) diff --git a/demo/gdip/nuklear_gdip.h b/demo/gdip/nuklear_gdip.h index 592887a..8a47511 100644 --- a/demo/gdip/nuklear_gdip.h +++ b/demo/gdip/nuklear_gdip.h @@ -754,7 +754,7 @@ nk_gdip_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam) case WM_SYSKEYDOWN: case WM_SYSKEYUP: { - int down = (lparam >> 31) & 1; + int down = (lparam >> 31) & 1 ? 0 : 1; int ctrl = GetKeyState(VK_CONTROL) & (1 << 15); switch (wparam) -- cgit v1.2.1 From 43b05749d2820b03de0d1a1b094585f6a03c6721 Mon Sep 17 00:00:00 2001 From: Naoyuki Sawa Date: Tue, 15 Nov 2016 23:26:57 +0900 Subject: fix for readability --- demo/d3d11/nuklear_d3d11.h | 2 +- demo/gdi/nuklear_gdi.h | 2 +- demo/gdip/nuklear_gdip.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/d3d11/nuklear_d3d11.h b/demo/d3d11/nuklear_d3d11.h index 717686c..efddf0d 100644 --- a/demo/d3d11/nuklear_d3d11.h +++ b/demo/d3d11/nuklear_d3d11.h @@ -205,7 +205,7 @@ nk_d3d11_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam) case WM_SYSKEYDOWN: case WM_SYSKEYUP: { - int down = (lparam >> 31) & 1 ? 0 : 1; + int down = !((lparam >> 31) & 1); int ctrl = GetKeyState(VK_CONTROL) & (1 << 15); switch (wparam) diff --git a/demo/gdi/nuklear_gdi.h b/demo/gdi/nuklear_gdi.h index 9fb919f..6d3a84a 100644 --- a/demo/gdi/nuklear_gdi.h +++ b/demo/gdi/nuklear_gdi.h @@ -516,7 +516,7 @@ nk_gdi_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam) case WM_SYSKEYDOWN: case WM_SYSKEYUP: { - int down = (lparam >> 31) & 1 ? 0 : 1; + int down = !((lparam >> 31) & 1); int ctrl = GetKeyState(VK_CONTROL) & (1 << 15); switch (wparam) diff --git a/demo/gdip/nuklear_gdip.h b/demo/gdip/nuklear_gdip.h index 8a47511..66ccc0d 100644 --- a/demo/gdip/nuklear_gdip.h +++ b/demo/gdip/nuklear_gdip.h @@ -754,7 +754,7 @@ nk_gdip_handle_event(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam) case WM_SYSKEYDOWN: case WM_SYSKEYUP: { - int down = (lparam >> 31) & 1 ? 0 : 1; + int down = !((lparam >> 31) & 1); int ctrl = GetKeyState(VK_CONTROL) & (1 << 15); switch (wparam) -- cgit v1.2.1 From a7283af0695f368429185493514e503798e54193 Mon Sep 17 00:00:00 2001 From: Naoyuki Sawa Date: Wed, 16 Nov 2016 11:32:33 +0900 Subject: fix: popup border is not shown when using the default style settings --- nuklear.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nuklear.h b/nuklear.h index 9632a43..a3c925a 100644 --- a/nuklear.h +++ b/nuklear.h @@ -15645,6 +15645,7 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) win->background = table[NK_COLOR_WINDOW]; win->fixed_background = nk_style_item_color(table[NK_COLOR_WINDOW]); win->border_color = table[NK_COLOR_BORDER]; + win->popup_border_color = table[NK_COLOR_BORDER]; win->combo_border_color = table[NK_COLOR_BORDER]; win->contextual_border_color = table[NK_COLOR_BORDER]; win->menu_border_color = table[NK_COLOR_BORDER]; @@ -15662,6 +15663,7 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) win->menu_border = 1.0f; win->group_border = 1.0f; win->tooltip_border = 1.0f; + win->popup_border = 1.0f; win->border = 2.0f; win->padding = nk_vec2(4,4); -- cgit v1.2.1 From c490e80f014e563aade24fbaadfee0677685ba05 Mon Sep 17 00:00:00 2001 From: vurtun Date: Sat, 19 Nov 2016 19:42:30 +0100 Subject: Fixed tooltip flickering #278 --- CHANGELOG.md | 1 + nuklear.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96e486e..9c50719 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog +- 2016/11/10 (1.184)- Fixed tooltip flickering - 2016/11/10 (1.183)- Fixed memory leak caused by popup repeated closing - 2016/11/10 (1.182)- Fixed memory leak caused by popup panel allocation - 2016/11/10 (1.181)- Fixed some warnings and C++ error diff --git a/nuklear.h b/nuklear.h index 09ea7f7..93bcada 100644 --- a/nuklear.h +++ b/nuklear.h @@ -20746,8 +20746,8 @@ nk_tooltip_end(struct nk_context *ctx) { NK_ASSERT(ctx); NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return; + if (!ctx || !ctx->current) return; + ctx->current->seq--; nk_popup_close(ctx); nk_popup_end(ctx); } -- cgit v1.2.1 From 6a374eabb1d8ace7e79c7562522cd435a3859393 Mon Sep 17 00:00:00 2001 From: vurtun Date: Sat, 19 Nov 2016 20:31:47 +0100 Subject: Fixed abstract comobox closing behavior #282 --- CHANGELOG.md | 1 + nuklear.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c50719..dcc8801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Changelog +- 2016/11/10 (1.184)- Fixed abstract combo box closing behavior - 2016/11/10 (1.184)- Fixed tooltip flickering - 2016/11/10 (1.183)- Fixed memory leak caused by popup repeated closing - 2016/11/10 (1.182)- Fixed memory leak caused by popup panel allocation diff --git a/nuklear.h b/nuklear.h index 93bcada..d37d93b 100644 --- a/nuklear.h +++ b/nuklear.h @@ -20978,14 +20978,14 @@ nk_contextual_end(struct nk_context *ctx) if (panel->flags & NK_WINDOW_DYNAMIC) { /* Close behavior This is a bit hack solution since we do not now before we end our popup - how big it will be. We therefore do not directly now when a + how big it will be. We therefore do not directly know when a click outside the non-blocking popup must close it at that direct frame. Instead it will be closed in the next frame.*/ struct nk_rect body = {0,0,0,0}; if (panel->at_y < (panel->bounds.y + panel->bounds.h)) { struct nk_vec2 padding = nk_panel_get_padding(&ctx->style, panel->type); body = panel->bounds; - body.y = (panel->at_y + panel->footer_height + panel->border + padding.y); + body.y = (panel->at_y + panel->footer_height + panel->border + padding.y + panel->row.height); body.h = (panel->bounds.y + panel->bounds.h) - body.y; } -- cgit v1.2.1 From a16877b5b8b739cb8d43a0a32009265cdd3d4709 Mon Sep 17 00:00:00 2001 From: vurtun Date: Tue, 22 Nov 2016 11:56:58 +0100 Subject: Fixed minimized window closing bug #266 --- CHANGELOG.md | 9 +++++---- nuklear.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcc8801..229fbda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ # Changelog -- 2016/11/10 (1.184)- Fixed abstract combo box closing behavior -- 2016/11/10 (1.184)- Fixed tooltip flickering -- 2016/11/10 (1.183)- Fixed memory leak caused by popup repeated closing -- 2016/11/10 (1.182)- Fixed memory leak caused by popup panel allocation +- 2016/11/22 (1.184)- Fixed window minimized closing bug +- 2016/11/19 (1.184)- Fixed abstract combo box closing behavior +- 2016/11/19 (1.184)- Fixed tooltip flickering +- 2016/11/19 (1.183)- Fixed memory leak caused by popup repeated closing +- 2016/11/18 (1.182)- Fixed memory leak caused by popup panel allocation - 2016/11/10 (1.181)- Fixed some warnings and C++ error - 2016/11/10 (1.180)- Added additional `nk_button` versions which allows to directly pass in a style struct to change buttons visual. diff --git a/nuklear.h b/nuklear.h index d106a3e..c37e328 100644 --- a/nuklear.h +++ b/nuklear.h @@ -16499,6 +16499,7 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan { layout->flags |= NK_WINDOW_HIDDEN; layout->flags |= NK_WINDOW_CLOSED; + layout->flags &= ~NK_WINDOW_MINIMIZED; } } @@ -16900,7 +16901,7 @@ nk_link_page_element_into_freelist(struct nk_context *ctx, NK_INTERN void nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem) { - /* fixed size pool so just add to free list */ + /* we have a pool so just add to free list */ if (ctx->use_pool) { nk_link_page_element_into_freelist(ctx, elem); return; @@ -20429,7 +20430,6 @@ nk_list_view_begin(struct nk_context *ctx, struct nk_list_view *view, if (!ctx || !view || !title) return 0; win = ctx->current; - layout = win->layout; style = &ctx->style; item_spacing = style->window.spacing; row_height += NK_MAX(0, (int)item_spacing.y); -- cgit v1.2.1