Update shutdown.py

feature: user clearly sees when the application is shutdown
main
EnsignMK 2023-08-08 22:04:29 +02:00 committed by GitHub
parent ed2d8a41b0
commit 04038c96dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -10,7 +10,20 @@ import os
js = """function close_window() {
if (confirm("Close the application?")) {
document.body.style.display = 'none';
var messageDiv = document.createElement('div');
messageDiv.textContent = 'You may close this window';
messageDiv.style.textAlign = 'center';
messageDiv.style.fontWeight = 'bold';
// Set the background color
document.body.style.backgroundColor = '#f2f2f2'; // Greyish background color
// Append the message div to the body
document.body.appendChild(messageDiv);
return true;
} else {
return false;
}