From afbd13391495efce07000998394df035ef1c2387 Mon Sep 17 00:00:00 2001 From: Jacob Ahnstedt Date: Mon, 20 Nov 2023 14:01:22 +0100 Subject: [PATCH] Fixed missing color factoring for widget disabling --- nuklear.h | 9 +++++---- src/nuklear_tree.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/nuklear.h b/nuklear.h index 5c45145..88ecccf 100644 --- a/nuklear.h +++ b/nuklear.h @@ -22673,15 +22673,16 @@ nk_tree_element_image_push_hashed_base(struct nk_context *ctx, enum nk_tree_type switch (background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(out, header, &background->data.image, nk_white); + nk_draw_image(out, header, &background->data.image, nk_rgb_factor(nk_white, style->tab.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(out, header, &background->data.slice, nk_white); + nk_draw_nine_slice(out, header, &background->data.slice, nk_rgb_factor(nk_white, style->tab.color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, header, 0, style->tab.border_color); + nk_fill_rect(out, header, 0, nk_rgb_factor(style->tab.border_color, style->tab.color_factor)); nk_fill_rect(out, nk_shrink_rect(header, style->tab.border), - style->tab.rounding, background->data.color); + style->tab.rounding, nk_rgb_factor(background->data.color, style->tab.color_factor)); + break; } } diff --git a/src/nuklear_tree.c b/src/nuklear_tree.c index 8ecc8c3..0ccf68e 100644 --- a/src/nuklear_tree.c +++ b/src/nuklear_tree.c @@ -242,15 +242,16 @@ nk_tree_element_image_push_hashed_base(struct nk_context *ctx, enum nk_tree_type switch (background->type) { case NK_STYLE_ITEM_IMAGE: - nk_draw_image(out, header, &background->data.image, nk_white); + nk_draw_image(out, header, &background->data.image, nk_rgb_factor(nk_white, style->tab.color_factor)); break; case NK_STYLE_ITEM_NINE_SLICE: - nk_draw_nine_slice(out, header, &background->data.slice, nk_white); + nk_draw_nine_slice(out, header, &background->data.slice, nk_rgb_factor(nk_white, style->tab.color_factor)); break; case NK_STYLE_ITEM_COLOR: - nk_fill_rect(out, header, 0, style->tab.border_color); + nk_fill_rect(out, header, 0, nk_rgb_factor(style->tab.border_color, style->tab.color_factor)); nk_fill_rect(out, nk_shrink_rect(header, style->tab.border), - style->tab.rounding, background->data.color); + style->tab.rounding, nk_rgb_factor(background->data.color, style->tab.color_factor)); + break; } }