From 4aa608aa717fdf35e0f7bf91077b79147d3f0253 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Thu, 17 Nov 2022 10:34:31 -0500 Subject: [PATCH] LibGUI+Taskbar+Applets+Applications: Set various windows as Popups Makes the Audio applet, Taskbar clock, CommandPalette, EmojiPicker, and Assistant work as Popup windows. Popups are frameless, unmovable, and unresizable by default, in addition to their preemptive function. Also sets Assistant not to obey widget min size so its search result area resizes correctly --- Userland/Applets/Audio/main.cpp | 4 +--- Userland/Applications/Assistant/main.cpp | 3 ++- Userland/Libraries/LibGUI/CommandPalette.cpp | 3 ++- Userland/Libraries/LibGUI/EmojiInputDialog.cpp | 3 ++- Userland/Services/Taskbar/ClockWidget.cpp | 4 +--- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Userland/Applets/Audio/main.cpp b/Userland/Applets/Audio/main.cpp index 6d4d7e3e000..aadf41d60b6 100644 --- a/Userland/Applets/Audio/main.cpp +++ b/Userland/Applets/Audio/main.cpp @@ -78,9 +78,7 @@ private: ErrorOr try_initialize_graphical_elements() { m_slider_window = add(window()); - m_slider_window->set_frameless(true); - m_slider_window->set_resizable(false); - m_slider_window->set_minimizable(false); + m_slider_window->set_window_type(GUI::WindowType::Popup); m_root_container = TRY(m_slider_window->try_set_main_widget()); m_root_container->set_fill_with_background_color(true); diff --git a/Userland/Applications/Assistant/main.cpp b/Userland/Applications/Assistant/main.cpp index d05a2d2efd8..69a4dcfdeff 100644 --- a/Userland/Applications/Assistant/main.cpp +++ b/Userland/Applications/Assistant/main.cpp @@ -315,7 +315,8 @@ ErrorOr serenity_main(Main::Arguments arguments) update_ui_timer->restart(); }; - window->set_frameless(true); + window->set_window_type(GUI::WindowType::Popup); + window->set_obey_widget_min_size(false); window->set_forced_shadow(true); window->resize(GUI::Desktop::the().rect().width() / 3, 46); window->center_on_screen(); diff --git a/Userland/Libraries/LibGUI/CommandPalette.cpp b/Userland/Libraries/LibGUI/CommandPalette.cpp index 380e0dc26ec..85d16dbf1f2 100644 --- a/Userland/Libraries/LibGUI/CommandPalette.cpp +++ b/Userland/Libraries/LibGUI/CommandPalette.cpp @@ -175,7 +175,8 @@ private: CommandPalette::CommandPalette(GUI::Window& parent_window, ScreenPosition screen_position) : GUI::Dialog(&parent_window, screen_position) { - set_frameless(true); + set_window_type(GUI::WindowType::Popup); + set_window_mode(GUI::WindowMode::Modeless); set_blocks_emoji_input(true); resize(450, 300); diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp index 4d2c2b011bf..36bf933f1e3 100644 --- a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp +++ b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp @@ -98,7 +98,8 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window) if (!main_widget.load_from_gml(emoji_input_dialog_gml)) VERIFY_NOT_REACHED(); - set_frameless(true); + set_window_type(GUI::WindowType::Popup); + set_window_mode(GUI::WindowMode::Modeless); set_blocks_emoji_input(true); resize(400, 300); diff --git a/Userland/Services/Taskbar/ClockWidget.cpp b/Userland/Services/Taskbar/ClockWidget.cpp index 28e4943ae29..8645b1cbe02 100644 --- a/Userland/Services/Taskbar/ClockWidget.cpp +++ b/Userland/Services/Taskbar/ClockWidget.cpp @@ -37,10 +37,8 @@ ClockWidget::ClockWidget() }); m_calendar_window = add(window()); + m_calendar_window->set_window_type(GUI::WindowType::Popup); m_calendar_window->resize(m_window_size.width(), m_window_size.height()); - m_calendar_window->set_frameless(true); - m_calendar_window->set_resizable(false); - m_calendar_window->set_minimizable(false); auto& root_container = m_calendar_window->set_main_widget(); root_container.set_fill_with_background_color(true);