52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
# fluffy-pancake Plymouth-Theme (script-Plugin).
|
|
# API-Stand: verifiziert gegen funktionierende Referenz-Themes
|
|
# (nur Image.Text, Sprite/SetPosition/SetImage/SetOpacity,
|
|
# Window.GetWidth/GetHeight/SetBackground*, Plymouth.Set*Function).
|
|
# Dunkler Hintergrund (Noctalia-nah), zentrierter Schriftzug,
|
|
# Boot-Meldungen unten links.
|
|
|
|
Window.SetBackgroundTopColor (0.101, 0.105, 0.149);
|
|
Window.SetBackgroundBottomColor (0.101, 0.105, 0.149);
|
|
|
|
title.sprite = Sprite ();
|
|
status.sprite = Sprite ();
|
|
|
|
global.layout_width = 0;
|
|
global.layout_height = 0;
|
|
|
|
fun layout () {
|
|
global.layout_width = Window.GetWidth ();
|
|
global.layout_height = Window.GetHeight ();
|
|
|
|
title.image = Image.Text ("fluffy-pancake", 1, 1, 1);
|
|
title.sprite.SetImage (title.image);
|
|
title.sprite.SetPosition (global.layout_width / 2 - title.image.GetWidth () / 2,
|
|
global.layout_height / 2 - title.image.GetHeight () / 2, 10);
|
|
status.sprite.SetPosition (10, global.layout_height - 40, 10000);
|
|
}
|
|
|
|
fun refresh_callback () {
|
|
# Displays koennen spaeter dazukommen (z.B. Docking-Monitor) -
|
|
# dann neu zentrieren.
|
|
if (Window.GetWidth () != global.layout_width || Window.GetHeight () != global.layout_height) {
|
|
layout ();
|
|
}
|
|
}
|
|
|
|
Plymouth.SetRefreshFunction (refresh_callback);
|
|
|
|
fun display_message_callback (text) {
|
|
message = Image.Text (text, 1, 1, 1);
|
|
status.sprite.SetImage (message);
|
|
status.sprite.SetOpacity (1);
|
|
}
|
|
|
|
fun hide_message_callback (text) {
|
|
status.sprite.SetOpacity (0);
|
|
}
|
|
|
|
Plymouth.SetDisplayMessageFunction (display_message_callback);
|
|
Plymouth.SetHideMessageFunction (hide_message_callback);
|
|
|
|
layout ();
|