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
This commit is contained in:
thankyouverycool 2022-11-17 10:34:31 -05:00 committed by Andreas Kling
parent 24d299c9c8
commit 4aa608aa71
Notes: sideshowbarker 2024-07-17 04:18:47 +09:00
5 changed files with 8 additions and 9 deletions

View file

@ -78,9 +78,7 @@ private:
ErrorOr<void> try_initialize_graphical_elements()
{
m_slider_window = add<GUI::Window>(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<GUI::Frame>());
m_root_container->set_fill_with_background_color(true);

View file

@ -315,7 +315,8 @@ ErrorOr<int> 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();

View file

@ -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);

View file

@ -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);

View file

@ -37,10 +37,8 @@ ClockWidget::ClockWidget()
});
m_calendar_window = add<GUI::Window>(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<GUI::Frame>();
root_container.set_fill_with_background_color(true);