[Bf-blender-cvs] [811dc12e34b] temp-ui-tweaks: UI: Make use of menu item theme roundness

Pablo Vazquez noreply at git.blender.org
Tue Aug 24 03:07:07 CEST 2021


Commit: 811dc12e34b3c9f76c7975d0e94d661306dbf1f3
Author: Pablo Vazquez
Date:   Tue Aug 24 02:48:43 2021 +0200
Branches: temp-ui-tweaks
https://developer.blender.org/rB811dc12e34b3c9f76c7975d0e94d661306dbf1f3

UI: Make use of menu item theme roundness

Use theme preference instead of hardcoded square corners.

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

M	source/blender/editors/interface/interface_widgets.c

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

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 3194764415b..585348555a1 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -4070,9 +4070,14 @@ static void widget_menu_itembut(uiWidgetColors *wcol,
   uiWidgetBase wtb;
   widget_init(&wtb);
 
-  /* not rounded, no outline */
+  /* Padding on the sides. */
+  rect->xmin += 0.2f * U.widget_unit;
+  rect->xmax -= 0.2f * U.widget_unit;
+
+  /* No outline. */
   wtb.draw_outline = false;
-  round_box_edges(&wtb, 0, rect, 0.0f);
+  const float rad = wcol->roundness * BLI_rcti_size_y(rect);
+  round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
 
   widgetbase_draw(&wtb, wcol);
 }



More information about the Bf-blender-cvs mailing list