[Bf-blender-cvs] [45477efd0e2] blender2.8: UI: increase spacing between icon and text.

Brecht Van Lommel noreply at git.blender.org
Thu Oct 11 14:20:47 CEST 2018


Commit: 45477efd0e25293be8721bf949409b44f7ce0cc8
Author: Brecht Van Lommel
Date:   Thu Oct 11 12:28:05 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB45477efd0e25293be8721bf949409b44f7ce0cc8

UI: increase spacing between icon and text.

To avoid the icon and text blending together too much, which happens with
the new monochrome and slightly bigger icons.

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

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

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

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index fba43afb609..92f5ad08f89 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2079,6 +2079,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
 		const BIFIconID icon = (but->flag & UI_HAS_ICON) ? but->icon + but->iconadd : ICON_NONE;
 		int icon_size_init = is_tool ? ICON_DEFAULT_HEIGHT_TOOLBAR : ICON_DEFAULT_HEIGHT;
 		const float icon_size = icon_size_init / (but->block->aspect / UI_DPI_FAC);
+		const float icon_padding = 2 * UI_DPI_FAC;
 
 #ifdef USE_UI_TOOLBAR_HACK
 		if (is_tool) {
@@ -2110,7 +2111,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
 		but->block->aspect = aspect_orig;
 #endif
 
-		rect->xmin += icon_size;
+		rect->xmin += icon_size + icon_padding;
 	}
 
 	if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) {
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 5cbe39773c1..1c45dc24108 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1696,7 +1696,7 @@ static void outliner_draw_tree_element(
 
 		if (!(ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, TSE_ID_BASE))) {
 			tselem_draw_icon(block, xmax, (float)startx + offsx, (float)*starty, tselem, te, alpha_fac, true);
-			offsx += UI_UNIT_X + 2 * ufac;
+			offsx += UI_UNIT_X + 4 * ufac;
 		}
 		else
 			offsx += 2 * ufac;
@@ -1717,13 +1717,13 @@ static void outliner_draw_tree_element(
 				        (float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT,
 				        alpha_fac);
 			}
-			offsx += UI_UNIT_X + 2 * ufac;
+			offsx += UI_UNIT_X + 4 * ufac;
 		}
 		else if (ELEM(tselem->type, 0, TSE_LAYER_COLLECTION) && ID_IS_STATIC_OVERRIDE(tselem->id)) {
 			UI_icon_draw_alpha(
 			        (float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_OVERRIDE,
 			        alpha_fac);
-			offsx += UI_UNIT_X + 2 * ufac;
+			offsx += UI_UNIT_X + 4 * ufac;
 		}
 		GPU_blend(false);



More information about the Bf-blender-cvs mailing list