mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 07:48:03 +02:00
Merge branch 'two-step-diskunlockscreen-tweaks' into 'main'
two-step: 2 small disk unlock screen cosmetic tweaks See merge request plymouth/plymouth!357
This commit is contained in:
commit
d4cbf1fafd
1 changed files with 15 additions and 2 deletions
|
|
@ -998,8 +998,8 @@ view_show_prompt (view_t *view,
|
|||
unsigned long screen_width, screen_height, entry_width, entry_height;
|
||||
unsigned long keyboard_indicator_width, keyboard_indicator_height;
|
||||
bool show_keyboard_indicators = false;
|
||||
int x, y, prompt_len;
|
||||
long dialog_bottom;
|
||||
int x, y;
|
||||
|
||||
assert (view != NULL);
|
||||
|
||||
|
|
@ -1053,7 +1053,17 @@ view_show_prompt (view_t *view,
|
|||
|
||||
dialog_bottom = view->dialog_area.y + view->dialog_area.height;
|
||||
|
||||
if (prompt != NULL) {
|
||||
if (prompt != NULL && prompt[0]) {
|
||||
char buf[128];
|
||||
|
||||
/* Strip ':' at end of prompt since we show it below the text-entry */
|
||||
prompt_len = strlen (prompt);
|
||||
if (prompt[prompt_len - 1] == ':' && prompt_len < sizeof(buf)) {
|
||||
strcpy (buf, prompt);
|
||||
buf[prompt_len - 1] = 0;
|
||||
prompt = buf;
|
||||
}
|
||||
|
||||
ply_label_set_text (view->label, prompt);
|
||||
|
||||
/* We center the prompt in the middle and use 80% of the horizontal space */
|
||||
|
|
@ -1061,6 +1071,9 @@ view_show_prompt (view_t *view,
|
|||
ply_label_set_alignment (view->label, PLY_LABEL_ALIGN_CENTER);
|
||||
ply_label_set_width (view->label, label_width);
|
||||
|
||||
/* Add 10 pixels padding between text-entry field and prompt */
|
||||
dialog_bottom += 10;
|
||||
|
||||
x = (screen_width - label_width) / 2;
|
||||
y = dialog_bottom;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue