[Bf-blender-cvs] [c184516c37b] blender-v2.93-release: Fix T89350: Emboss color missing from icon buttons without emboss

Hans Goudey noreply at git.blender.org
Wed Dec 14 14:42:41 CET 2022


Commit: c184516c37b3ef81507558daaff4d8268ecc7d2c
Author: Hans Goudey
Date:   Mon Jun 28 10:00:15 2021 -0500
Branches: blender-v2.93-release
https://developer.blender.org/rBc184516c37b3ef81507558daaff4d8268ecc7d2c

Fix T89350: Emboss color missing from icon buttons without emboss

Passing `emboss=False`set `UI_EMBOSS_NONE` in the layout, which
completely disables button background colors for things like animation
state. This commit changes that to `UI_EMBOSS_NONE_OR_STATUS`,
which effectively restores the behavior to what it was prior to the
addition of that flag, with the added option to completely disable
the status emboss with `UI_EMBOSS_NONE`.

===================================================================

M	source/blender/editors/interface/interface_layout.c
M	source/blender/makesrna/intern/rna_ui_api.c

===================================================================

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index cabd98902a6..2c2ea70d0d2 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1191,7 +1191,7 @@ static uiBut *uiItemFullO_ptr_ex(uiLayout *layout,
 
   const eUIEmbossType prev_emboss = layout->emboss;
   if (flag & UI_ITEM_R_NO_BG) {
-    layout->emboss = UI_EMBOSS_NONE;
+    layout->emboss = UI_EMBOSS_NONE_OR_STATUS;
   }
 
   /* create the button */
@@ -2122,7 +2122,7 @@ void uiItemFullR(uiLayout *layout,
 
   const eUIEmbossType prev_emboss = layout->emboss;
   if (no_bg) {
-    layout->emboss = UI_EMBOSS_NONE;
+    layout->emboss = UI_EMBOSS_NONE_OR_STATUS;
   }
 
   uiBut *but = NULL;
diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c
index f128719db19..104d2090978 100644
--- a/source/blender/makesrna/intern/rna_ui_api.c
+++ b/source/blender/makesrna/intern/rna_ui_api.c
@@ -912,7 +912,12 @@ void RNA_api_ui_layout(StructRNA *srna)
   RNA_def_boolean(func, "event", false, "", "Use button to input key events");
   RNA_def_boolean(
       func, "full_event", false, "", "Use button to input full events including modifiers");
-  RNA_def_boolean(func, "emboss", true, "", "Draw the button itself, not just the icon/text");
+  RNA_def_boolean(func,
+                  "emboss",
+                  true,
+                  "",
+                  "Draw the button itself, not just the icon/text. When false, corresponds to the "
+                  "'NONE_OR_STATUS' layout emboss type");
   RNA_def_int(func,
               "index",
               /* RNA_NO_INDEX == -1 */



More information about the Bf-blender-cvs mailing list