From 78e4f9bd679fcc48187917afabbe8db381fd4259 Mon Sep 17 00:00:00 2001 From: ws909 <37029098+ws909@users.noreply.github.com> Date: Thu, 2 Mar 2023 05:20:32 +0100 Subject: [PATCH] Make progress bar slider in window test program responsive --- tests/window.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/window.c b/tests/window.c index c7631246..5526c592 100644 --- a/tests/window.c +++ b/tests/window.c @@ -418,20 +418,22 @@ int main(int argc, char** argv) nk_layout_row_dynamic(nk, 30, 5); + static int state = GLFW_TASKBAR_PROGRESS_DISABLED; static int progress = 0; if(nk_button_label(nk, "No progress")) - glfwSetWindowTaskbarProgress(window, GLFW_TASKBAR_PROGRESS_DISABLED, progress); + glfwSetWindowTaskbarProgress(window, state = GLFW_TASKBAR_PROGRESS_DISABLED, progress); if (nk_button_label(nk, "Indeterminate")) - glfwSetWindowTaskbarProgress(window, GLFW_TASKBAR_PROGRESS_INDETERMINATE, progress); + glfwSetWindowTaskbarProgress(window, state = GLFW_TASKBAR_PROGRESS_INDETERMINATE, progress); if (nk_button_label(nk, "Normal")) - glfwSetWindowTaskbarProgress(window, GLFW_TASKBAR_PROGRESS_NORMAL, progress); + glfwSetWindowTaskbarProgress(window, state = GLFW_TASKBAR_PROGRESS_NORMAL, progress); if (nk_button_label(nk, "Error")) - glfwSetWindowTaskbarProgress(window, GLFW_TASKBAR_PROGRESS_ERROR, progress); + glfwSetWindowTaskbarProgress(window, state = GLFW_TASKBAR_PROGRESS_ERROR, progress); if (nk_button_label(nk, "Paused")) - glfwSetWindowTaskbarProgress(window, GLFW_TASKBAR_PROGRESS_PAUSED, progress); + glfwSetWindowTaskbarProgress(window, state = GLFW_TASKBAR_PROGRESS_PAUSED, progress); nk_label(nk, "Progress: ", NK_TEXT_ALIGN_LEFT); - nk_slider_int(nk, 0, &progress, 100, 1); + if (nk_slider_int(nk, 0, &progress, 100, 1)) + glfwSetWindowTaskbarProgress(window, state, progress); } nk_end(nk);