]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Change text pulser to use space instead of line drawing characters to prevent
authorRay Strode <rstrode@redhat.com>
Wed, 25 Jun 2008 21:48:32 +0000 (17:48 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 25 Jun 2008 21:48:32 +0000 (17:48 -0400)
scramblage at font change

src/libplybootsplash/ply-text-pulser.c

index 3872d6082072f2444b59ba8b9d5fdbe83b14de53..d11b1dbdf9ee30664da1c6d80a6571c3eeddb25a 100644 (file)
 #define FRAMES_PER_SECOND 10
 #endif
 
-#ifndef INDICATOR_STRING
-#define INDICATOR_STRING "██████"
-#endif
-
 #define NUMBER_OF_INDICATOR_COLUMNS 6
 
 struct _ply_text_pulser
@@ -99,67 +95,25 @@ ply_text_pulser_free (ply_text_pulser_t *pulser)
   free (pulser);
 }
 
-static void
-draw_frame (ply_text_pulser_t *pulser,
-            int                column,
-            int                row)
-{
-  int i;
-
-  ply_window_set_text_cursor_position (pulser->window,
-                                       column, row);
-  /* Top of frame
-   */
-  write (STDOUT_FILENO, "┌", strlen ("┌"));
-  for (i = 0; i < pulser->number_of_columns - 2; i++)
-    write (STDOUT_FILENO, "─", strlen ("─"));
-  write (STDOUT_FILENO, "┐", strlen ("┐"));
-
-  ply_window_set_text_cursor_position (pulser->window,
-                                       column, row + 1);
-  /* Middle
-   */
-  write (STDOUT_FILENO, "│", strlen ("│"));
-
-  ply_window_set_text_cursor_position (pulser->window,
-                                       column + pulser->number_of_columns - 1,
-                                       row + 1);
-  write (STDOUT_FILENO, "│", strlen ("│"));
-
-  ply_window_set_text_cursor_position (pulser->window,
-                                       column, row + 2);
-  /* Bottom of frame
-   */
-  write (STDOUT_FILENO, "└", strlen ("└"));
-
-  for (i = 0; i < pulser->number_of_columns - 2; i++)
-    write (STDOUT_FILENO, "─", strlen ("─"));
-  write (STDOUT_FILENO, "┘", strlen ("┘"));
-}
-
-static void
-draw_indicator (ply_text_pulser_t *pulser)
-{
-  write (STDOUT_FILENO, INDICATOR_STRING, strlen (INDICATOR_STRING));
-}
-
 static void
 animate_at_time (ply_text_pulser_t *pulser,
                  double             time)
 {
   ply_window_set_mode (pulser->window, PLY_WINDOW_MODE_TEXT);
 
-  draw_frame (pulser, pulser->column, pulser->row);
-
   ply_window_set_text_cursor_position (pulser->window,
                                        pulser->column + pulser->spinner_position,
                                        pulser->row + 1);
+  ply_window_set_background_color (pulser->window, PLY_WINDOW_COLOR_DEFAULT);
   write (STDOUT_FILENO, "      ", strlen ("      "));
   pulser->spinner_position = ((pulser->number_of_columns - 2) - NUMBER_OF_INDICATOR_COLUMNS - 1)  * (.5 * sin (time) + .5) + 2;
   ply_window_set_text_cursor_position (pulser->window,
                                        pulser->column + pulser->spinner_position,
                                        pulser->row + 1);
-  draw_indicator (pulser);
+
+  ply_window_set_background_color (pulser->window, PLY_WINDOW_COLOR_WHITE);
+  write (STDOUT_FILENO, "      ", strlen ("      "));
+  ply_window_set_background_color (pulser->window, PLY_WINDOW_COLOR_DEFAULT);
 }
 
 static void