From bdf260a1b8f83373695fe8375f4a533e5f018549 Mon Sep 17 00:00:00 2001 From: Yevgeny Makarov Date: Wed, 15 Apr 2020 11:46:06 +0200 Subject: 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 --- .../windowmanager/intern/wm_splash_screen.c | 24 ++++------------------ 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'source/blender/windowmanager') 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); -- cgit v1.2.3