diff options
author | Yevgeny Makarov <jenkm> | 2020-04-15 12:46:06 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-04-15 12:49:25 +0300 |
commit | bdf260a1b8f83373695fe8375f4a533e5f018549 (patch) | |
tree | 4b429107cd064d41e93aa0b862e9e1cb924f9190 /source | |
parent | 04828b7d9909b22061e24ca7e339132cf9459bdc (diff) |
UI: Avoid manual right-alignment of text in splash screen
Can use existing layout features for right-alignment instead.
Differential Revision: https://developer.blender.org/D6549
Reviewed by: William Reynish, Julian Eisel
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_splash_screen.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/source/blender/windowmanager/intern/wm_splash_screen.c b/source/blender/windowmanager/intern/wm_splash_screen.c index f953cc6707c..613ac5938bd 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.c +++ b/source/blender/windowmanager/intern/wm_splash_screen.c @@ -83,28 +83,12 @@ static void wm_block_splash_add_label(uiBlock *block, const char *label, int x, return; } - const uiStyle *style = UI_style_get(); - - BLF_size(style->widgetlabel.uifont_id, style->widgetlabel.points, U.pixelsize * U.dpi); - int label_width = BLF_width(style->widgetlabel.uifont_id, label, strlen(label)); - label_width = label_width + U.widget_unit; - UI_block_emboss_set(block, UI_EMBOSS_NONE); - uiBut *but = uiDefBut(block, - UI_BTYPE_LABEL, - 0, - label, - x - label_width, - *y, - label_width, - UI_UNIT_Y, - NULL, - 0, - 0, - 0, - 0, - NULL); + uiBut *but = uiDefBut( + block, UI_BTYPE_LABEL, 0, label, 0, *y, x, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + UI_but_drawflag_disable(but, UI_BUT_TEXT_LEFT); + UI_but_drawflag_enable(but, UI_BUT_TEXT_RIGHT); /* 1 = UI_SELECT, internal flag to draw in white. */ UI_but_flag_enable(but, 1); |