Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-12-05 02:04:16 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-12-10 22:33:27 +0300
commit35b5888b157d05d378df3acc899d28856a9eb9a4 (patch)
tree5bed7451a88a7872c392148c734607377748534c /source/blender/editors/interface/interface_widgets.c
parent4fa774b53346a1533c6c0c62ddbd220979adb6c2 (diff)
Fix menu buttons not displaying down arrow with emboss=False
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r--source/blender/editors/interface/interface_widgets.c69
1 files changed, 48 insertions, 21 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 9e0d34e386d..d313310bfa1 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -3495,6 +3495,50 @@ static void widget_numbut(uiWidgetColors *wcol, rcti *rect, int state, int round
widget_numbut_draw(wcol, rect, state, roundboxalign, false);
}
+static void widget_menubut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
+{
+ uiWidgetBase wtb;
+ float rad;
+
+ widget_init(&wtb);
+
+ rad = wcol->roundness * U.widget_unit;
+ round_box_edges(&wtb, roundboxalign, rect, rad);
+
+ /* decoration */
+ shape_preset_trias_from_rect_menu(&wtb.tria1, rect);
+ /* copy size and center to 2nd tria */
+ wtb.tria2 = wtb.tria1;
+
+ widgetbase_draw(&wtb, wcol);
+
+ /* text space, arrows are about 0.6 height of button */
+ rect->xmax -= (6 * BLI_rcti_size_y(rect)) / 10;
+}
+
+/**
+ * Draw menu buttons still with triangles when field is not embossed
+ */
+static void widget_menubut_embossn(uiBut *UNUSED(but),
+ uiWidgetColors *wcol,
+ rcti *rect,
+ int UNUSED(state),
+ int UNUSED(roundboxalign))
+{
+ uiWidgetBase wtb;
+
+ widget_init(&wtb);
+ wtb.draw_inner = false;
+ wtb.draw_outline = false;
+
+ /* decoration */
+ shape_preset_trias_from_rect_menu(&wtb.tria1, rect);
+ /* copy size and center to 2nd tria */
+ wtb.tria2 = wtb.tria1;
+
+ widgetbase_draw(&wtb, wcol);
+}
+
/**
* Draw number buttons still with triangles when field is not embossed
*/
@@ -3931,6 +3975,10 @@ static void widget_icon_has_anim(
* triangles when field is not embossed */
widget_numbut_embossn(but, wcol, rect, state, roundboxalign);
}
+ else if (but->type == UI_BTYPE_MENU) {
+ /* Draw menu buttons still with down arrow. */
+ widget_menubut_embossn(but, wcol, rect, state, roundboxalign);
+ }
}
static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
@@ -3950,27 +3998,6 @@ static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roun
widgetbase_draw(&wtb, wcol);
}
-static void widget_menubut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
-{
- uiWidgetBase wtb;
- float rad;
-
- widget_init(&wtb);
-
- rad = wcol->roundness * U.widget_unit;
- round_box_edges(&wtb, roundboxalign, rect, rad);
-
- /* decoration */
- shape_preset_trias_from_rect_menu(&wtb.tria1, rect);
- /* copy size and center to 2nd tria */
- wtb.tria2 = wtb.tria1;
-
- widgetbase_draw(&wtb, wcol);
-
- /* text space, arrows are about 0.6 height of button */
- rect->xmax -= (6 * BLI_rcti_size_y(rect)) / 10;
-}
-
static void widget_menuiconbut(uiWidgetColors *wcol,
rcti *rect,
int UNUSED(state),