]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
two-step: Center message text within labels if labels are centered
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Mon, 30 Mar 2020 10:52:39 +0000 (18:52 +0800)
committerRay Strode <halfline@gmail.com>
Mon, 6 Apr 2020 18:23:40 +0000 (18:23 +0000)
This makes a difference when you start rendering multiple lines in
a single label. For a single line label you won't see any difference.

Closes: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/99
src/plugins/splash/two-step/plugin.c

index d9749892812694823a29e8779c5ca0c6ed439758..2d7ee162e3c9589d5c45a5ebab4256ec1ca0f7f8 100644 (file)
@@ -1877,6 +1877,9 @@ view_show_message (view_t     *view,
         ply_boot_splash_plugin_t *plugin = view->plugin;
         int x, y, width, height;
 
+        if (plugin->message_below_animation)
+                ply_label_set_alignment (view->message_label, PLY_LABEL_ALIGN_CENTER);
+
         ply_label_set_text (view->message_label, message);
         width = ply_label_get_width (view->message_label);
         height = ply_label_get_height (view->message_label);