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:
authorCampbell Barton <ideasman42@gmail.com>2015-08-22 09:48:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-08-22 09:49:58 +0300
commit86690915f11ebfe959d8dfe5eb80e844754aa819 (patch)
tree86018fcb012382e1f60d90f685da0a6874ab192e /source/blender/editors/space_outliner
parenta22f3cccec367470ee0b72a8667f214e234e3fc8 (diff)
outliner: tweak GPLayer color button overlap
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index b3761336035..ac9e2e36ded 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1002,20 +1002,23 @@ static void tselem_draw_gp_icon_uibut(struct DrawIconArg *arg, ID *id, bGPDlayer
}
else {
PointerRNA ptr;
- float w = 0.85f * U.widget_unit;
+ const float eps = 0.001f;
+ const bool is_stroke_visible = (gpl->color[3] > eps);
+ const bool is_fill_visible = (gpl->fill[3] > eps);
+ float w = 0.5f * UI_UNIT_X;
float h = 0.85f * UI_UNIT_Y;
-
+
RNA_pointer_create(id, &RNA_GPencilLayer, gpl, &ptr);
-
+
UI_block_align_begin(arg->block);
- UI_block_emboss_set(arg->block, RNA_boolean_get(&ptr, "is_stroke_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
+ UI_block_emboss_set(arg->block, is_stroke_visible ? UI_EMBOSS : UI_EMBOSS_NONE);
uiDefButR(arg->block, UI_BTYPE_COLOR, 1, "", arg->xb, arg->yb, w, h,
&ptr, "color", -1,
0, 0, 0, 0, NULL);
- UI_block_emboss_set(arg->block, RNA_boolean_get(&ptr, "is_fill_visible") ? UI_EMBOSS : UI_EMBOSS_NONE);
- uiDefButR(arg->block, UI_BTYPE_COLOR, 1, "", arg->xb, arg->yb, w, h,
+ UI_block_emboss_set(arg->block, is_fill_visible ? UI_EMBOSS : UI_EMBOSS_NONE);
+ uiDefButR(arg->block, UI_BTYPE_COLOR, 1, "", arg->xb + w, arg->yb, w, h,
&ptr, "fill_color", -1,
0, 0, 0, 0, NULL);