login-app: give some precision to student after login

This commit is contained in:
nemunaire 2021-02-16 22:24:44 +01:00
commit 1d8146d8ad

View file

@ -14,7 +14,7 @@ func CreateRebootDialog(title, login string) *RebootDialog {
dlg := new(RebootDialog)
sWidth, sHeight := ui.ScreenSize()
wWidth, wHeight := 50, 10
wWidth, wHeight := 48, 10
dlg.View = ui.AddWindow(sWidth/2-wWidth/2, sHeight/2-wHeight/2, wWidth, wHeight, title)
ui.WindowManager().BeginUpdate()
defer ui.WindowManager().EndUpdate()
@ -28,15 +28,26 @@ func CreateRebootDialog(title, login string) *RebootDialog {
textfrm.SetPaddings(1, 1)
textfrm.SetPack(ui.Vertical)
textfrm.SetGaps(2, 1)
ui.CreateLabel(textfrm, ui.AutoSize, ui.AutoSize, "You are now successfully logged in as:", ui.Fixed)
ui.CreateLabel(textfrm, ui.AutoSize, ui.AutoSize, login, ui.Fixed)
ui.CreateLabel(textfrm, ui.AutoSize, ui.AutoSize, "Your computer will automatically", ui.Fixed)
ui.CreateLabel(textfrm, ui.AutoSize, ui.AutoSize, "reboot in a few seconds...", ui.Fixed)
lbl1 := ui.CreateLabel(textfrm, ui.AutoSize, ui.AutoSize, " You are now successfully logged in as:", ui.Fixed)
lbl1.SetTextColor(ui.ColorWhiteBold)
progress := ui.CreateProgressBar(textfrm, ui.AutoSize, ui.AutoSize, 1)
for i := 0; i <= wWidth/2-len(login)/2; i += 1 {
login = " " + login
}
lbl2 := ui.CreateLabel(textfrm, ui.AutoSize, ui.AutoSize, login, 1)
lbl2.SetTextColor(ui.ColorGreenBold)
lbl3 := ui.CreateLabel(textfrm, 40, 2, " Your computer will automatically\n reboot in a few seconds...", ui.Fixed)
lbl3.SetMultiline(true)
progress := ui.CreateProgressBar(textfrm, ui.AutoSize, ui.AutoSize, ui.Fixed)
progress.SetLimits(0, 100)
lbl4 := ui.CreateLabel(textfrm, 40, 4, "\nThe challenge begins right after the reboot. Good luck!", ui.Fixed)
lbl4.SetTextColor(ui.ColorWhiteBold)
lbl4.SetMultiline(true)
go func() {
for i := 0; i < 100; i += 1 {
progress.SetValue(i)