[Bf-blender-cvs] [80840750e8f] greasepencil-object: GP Color Picker - Make the highlight cover the names of each color too
Joshua Leung
noreply at git.blender.org
Fri Mar 16 07:33:19 CET 2018
Commit: 80840750e8f1ace50ad2125e0dd3caa91d450b12
Author: Joshua Leung
Date: Fri Mar 16 19:33:12 2018 +1300
Branches: greasepencil-object
https://developer.blender.org/rB80840750e8f1ace50ad2125e0dd3caa91d450b12
GP Color Picker - Make the highlight cover the names of each color too
This makes it more consistent with the normal big-icon popup menus
===================================================================
M source/blender/editors/gpencil/gpencil_colorpick.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_colorpick.c b/source/blender/editors/gpencil/gpencil_colorpick.c
index 0c3a273334b..a97dc66a444 100644
--- a/source/blender/editors/gpencil/gpencil_colorpick.c
+++ b/source/blender/editors/gpencil/gpencil_colorpick.c
@@ -80,6 +80,7 @@
#define GP_BOX_SIZE (32 * U.ui_scale)
#define GP_BOX_GAP (24 * U.ui_scale)
+#define GP_PICK_NAME_HEIGHT ((GP_BOX_GAP / 2) - (3 * U.ui_scale))
/* Representation of a color displayed in the picker */
typedef struct tGPDpickColor {
@@ -140,7 +141,7 @@ static void gp_draw_color_name(tGPDpick *tgpk, tGPDpickColor *col, const uiFontS
/* color name */
BLI_strncpy(drawstr, col->name, sizeof(drawstr));
UI_text_clip_middle_ex((uiFontStyle *)fstyle, drawstr, okwidth, minwidth, max_len, '\0');
- UI_fontstyle_draw_simple(fstyle, col->rect.xmin, col->rect.ymin - (GP_BOX_GAP / 2) - (3 * U.ui_scale),
+ UI_fontstyle_draw_simple(fstyle, col->rect.xmin, col->rect.ymin - GP_PICK_NAME_HEIGHT,
drawstr, text_col);
}
@@ -230,7 +231,7 @@ static void gpencil_draw_color_table(const bContext *C, tGPDpick *tgpk)
/* TODO: How to get the menu gradient shading? */
rcti *cbox = &col->full_rect;
UI_draw_roundbox_4fv(true,
- cbox->xmin, cbox->ymin,
+ cbox->xmin, cbox->ymin - GP_PICK_NAME_HEIGHT,
cbox->xmax, cbox->ymax,
0, selcolor);
}
More information about the Bf-blender-cvs
mailing list