Skip to content

Commit

Permalink
plymouth: add support for message widget
Browse files Browse the repository at this point in the history
  • Loading branch information
0x5a4 committed Feb 9, 2025
1 parent 52d8c1a commit 7fef698
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
19 changes: 19 additions & 0 deletions modules/plymouth/theme.script
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
center_x = Window.GetWidth() / 2;
center_y = Window.GetHeight() / 2;
baseline_y = Window.GetHeight() * 0.9;
message_y = Window.GetHeight() * 0.75;


### BACKGROUND ###
Expand Down Expand Up @@ -116,6 +117,22 @@ fun question_callback(prompt_text, entry) {

Plymouth.SetDisplayQuestionFunction(question_callback);

### MESSAGE ###

message = null;

fun message_callback(text) {
message.image = Image.Text(text, %BASE05%);
message.sprite = Sprite(message.image);
message.sprite.SetPosition(
center_x - message.image.GetWidth() / 2,
message_y,
1
);
}

Plymouth.SetMessageFunction(message_callback);

### NORMAL ###

fun normal_callback() {
Expand All @@ -125,6 +142,8 @@ fun normal_callback() {
question = null;
answer = null;

message = null;

activate_spinner();
}

Expand Down
20 changes: 19 additions & 1 deletion modules/plymouth/theme_still.script
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
center_x = Window.GetWidth() / 2;
center_y = Window.GetHeight() / 2;
baseline_y = Window.GetHeight() * 0.9;
message_y = Window.GetHeight() * 0.75;


### BACKGROUND ###
Expand Down Expand Up @@ -78,6 +79,22 @@ fun question_callback(prompt_text, entry) {

Plymouth.SetDisplayQuestionFunction(question_callback);

### MESSAGE ###

message = null;

fun message_callback(text) {
message.image = Image.Text(text, %BASE05%);
message.sprite = Sprite(message.image);
message.sprite.SetPosition(
center_x - message.image.GetWidth() / 2,
message_y,
1
);
}

Plymouth.SetMessageFunction(message_callback);

### NORMAL ###

fun normal_callback() {
Expand All @@ -86,11 +103,12 @@ fun normal_callback() {

question = null;
answer = null;

message = null;
}

Plymouth.SetDisplayNormalFunction(normal_callback);


### QUIT ###

fun quit_callback() {
Expand Down

0 comments on commit 7fef698

Please sign in to comment.