diff options
author | Yevgeny Makarov <jenkm> | 2020-03-29 14:47:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-29 14:47:59 +0300 |
commit | a3d5b949d24b0f441926ae71be837a89e4c04ac0 (patch) | |
tree | b36c1a2f19426036ded723860767e52ec8a8063f | |
parent | c6143da27c68f128d5dd5f11abfa96b18e249124 (diff) |
UI: Fix text padding for labels without an icon
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 7 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_intern.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 7e6ef11518a..fa4a0a1e07d 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2520,6 +2520,13 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle, } } else if (but->drawflag & UI_BUT_TEXT_LEFT) { + + /* Reduce the left padding for labels without an icon. */ + if ((but->type == UI_BTYPE_LABEL) && !(but->flag & UI_HAS_ICON) && + !ui_block_is_menu(but->block)) { + text_padding /= 2; + } + rect->xmin += text_padding; } else if (but->drawflag & UI_BUT_TEXT_RIGHT) { diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 8c7c490b181..42439e88c96 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -271,7 +271,7 @@ extern const char *node_context_dir[]; #define NODE_SOCKDY (0.08f * U.widget_unit) #define NODE_WIDTH(node) (node->width * UI_DPI_FAC) #define NODE_HEIGHT(node) (node->height * UI_DPI_FAC) -#define NODE_MARGIN_X (0.75f * U.widget_unit) +#define NODE_MARGIN_X (0.95f * U.widget_unit) #define NODE_SOCKSIZE (0.25f * U.widget_unit) #define NODE_RESIZE_MARGIN (0.20f * U.widget_unit) #define NODE_LINK_RESOL 12 |