1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:37:35 +00:00

ShutdownDialog: refresh system theme on instantiation.

Whilst SystemMenu maintains a constant WindowServer connection, there
isn't always a Window active on that connection to listen for theme
changes - this causes the current theme in this process to fall out of
sync with the rest of the system. This fixes this problem by
re-requesting an UpdateSystemTheme message when the dialog is
instantiated.
This commit is contained in:
Nick Vella 2021-01-16 16:03:38 +11:00 committed by Andreas Kling
parent fcf50af53d
commit 60e580fa3e

View file

@ -68,6 +68,9 @@ ShutdownDialog::ShutdownDialog()
set_title("SerenityOS");
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/power.png"));
// Request WindowServer to re-update us on the current theme as we might've not been alive for the last notification.
refresh_system_theme();
auto& main = set_main_widget<GUI::Widget>();
main.set_layout<GUI::VerticalBoxLayout>();
main.layout()->set_margins({ 8, 8, 8, 8 });