mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:27:34 +00:00
Taskbar: Add show desktop button to toggle showing of the desktop
This commit is contained in:
parent
271840ca22
commit
cefa2e3dd2
2 changed files with 13 additions and 0 deletions
|
@ -88,6 +88,12 @@ TaskbarWindow::TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu)
|
||||||
|
|
||||||
main_widget.add<Taskbar::ClockWidget>();
|
main_widget.add<Taskbar::ClockWidget>();
|
||||||
|
|
||||||
|
m_show_desktop_button = GUI::Button::construct();
|
||||||
|
m_show_desktop_button->set_tooltip("Show Desktop");
|
||||||
|
m_show_desktop_button->set_fixed_size(12, 21);
|
||||||
|
m_show_desktop_button->on_click = TaskbarWindow::show_desktop_button_clicked;
|
||||||
|
main_widget.add_child(*m_show_desktop_button);
|
||||||
|
|
||||||
auto af_path = String::formatted("{}/{}", Desktop::AppFile::APP_FILES_DIRECTORY, "Assistant.af");
|
auto af_path = String::formatted("{}/{}", Desktop::AppFile::APP_FILES_DIRECTORY, "Assistant.af");
|
||||||
m_assistant_app_file = Desktop::AppFile::open(af_path);
|
m_assistant_app_file = Desktop::AppFile::open(af_path);
|
||||||
}
|
}
|
||||||
|
@ -96,6 +102,11 @@ TaskbarWindow::~TaskbarWindow()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TaskbarWindow::show_desktop_button_clicked(unsigned)
|
||||||
|
{
|
||||||
|
GUI::WindowManagerServerConnection::the().async_toggle_show_desktop();
|
||||||
|
}
|
||||||
|
|
||||||
void TaskbarWindow::create_quick_launch_bar()
|
void TaskbarWindow::create_quick_launch_bar()
|
||||||
{
|
{
|
||||||
auto& quick_launch_bar = main_widget()->add<GUI::Frame>();
|
auto& quick_launch_bar = main_widget()->add<GUI::Frame>();
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu);
|
explicit TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu);
|
||||||
|
static void show_desktop_button_clicked(unsigned);
|
||||||
void create_quick_launch_bar();
|
void create_quick_launch_bar();
|
||||||
void on_screen_rects_change(const Vector<Gfx::IntRect, 4>&, size_t);
|
void on_screen_rects_change(const Vector<Gfx::IntRect, 4>&, size_t);
|
||||||
NonnullRefPtr<GUI::Button> create_button(const WindowIdentifier&);
|
NonnullRefPtr<GUI::Button> create_button(const WindowIdentifier&);
|
||||||
|
@ -44,6 +45,7 @@ private:
|
||||||
Gfx::IntSize m_applet_area_size;
|
Gfx::IntSize m_applet_area_size;
|
||||||
RefPtr<GUI::Frame> m_applet_area_container;
|
RefPtr<GUI::Frame> m_applet_area_container;
|
||||||
RefPtr<GUI::Button> m_start_button;
|
RefPtr<GUI::Button> m_start_button;
|
||||||
|
RefPtr<GUI::Button> m_show_desktop_button;
|
||||||
|
|
||||||
RefPtr<Desktop::AppFile> m_assistant_app_file;
|
RefPtr<Desktop::AppFile> m_assistant_app_file;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue