1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

ClockSettings+Taskbar: Add settings for taskbar clock format

This commit is contained in:
cflip 2022-04-03 17:13:52 -06:00 committed by Andreas Kling
parent 36b6356ce5
commit 5bb0b6ba7a
13 changed files with 334 additions and 179 deletions

View file

@ -85,7 +85,7 @@ TaskbarWindow::TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu)
m_applet_area_container->set_frame_shape(Gfx::FrameShape::Box);
m_applet_area_container->set_frame_shadow(Gfx::FrameShadow::Sunken);
main_widget.add<Taskbar::ClockWidget>();
m_clock_widget = main_widget.add<Taskbar::ClockWidget>();
m_show_desktop_button = GUI::Button::construct();
m_show_desktop_button->set_tooltip("Show Desktop");
@ -99,6 +99,15 @@ TaskbarWindow::TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu)
m_assistant_app_file = Desktop::AppFile::open(af_path);
}
void TaskbarWindow::config_string_did_change(String const& domain, String const& group, String const& key, String const& value)
{
VERIFY(domain == "Taskbar");
if (group == "Clock" && key == "TimeFormat") {
m_clock_widget->update_format(value);
update_applet_area();
}
}
void TaskbarWindow::show_desktop_button_clicked(unsigned)
{
GUI::ConnectionToWindowMangerServer::the().async_toggle_show_desktop();