mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
Assistant: Automatically compute Assistant's window dimensions
Disregarding minimum widget size was originally set as a quick fix when converting Assistant to a Popup window, but it's really much easier to let layout manage dynamic resizing instead of trying to add up pixels piecemeal.
This commit is contained in:
parent
518964e7c7
commit
65c5901e7c
Notes:
sideshowbarker
2024-07-17 05:58:46 +09:00
Author: https://github.com/thankyouverycool Commit: https://github.com/SerenityOS/serenity/commit/65c5901e7c Pull-request: https://github.com/SerenityOS/serenity/pull/16210
|
@ -226,9 +226,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
}
|
}
|
||||||
|
|
||||||
mark_selected_item();
|
mark_selected_item();
|
||||||
|
Core::deferred_invoke([&] { window->resize(GUI::Desktop::the().rect().width() / 3, {}); });
|
||||||
auto window_height = app_state.visible_result_count * 40 + text_box.height() + 28;
|
|
||||||
window->resize(GUI::Desktop::the().rect().width() / 3, window_height);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
db.on_new_results = [&](auto results) {
|
db.on_new_results = [&](auto results) {
|
||||||
|
@ -243,9 +241,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
};
|
};
|
||||||
|
|
||||||
window->set_window_type(GUI::WindowType::Popup);
|
window->set_window_type(GUI::WindowType::Popup);
|
||||||
window->set_obey_widget_min_size(false);
|
|
||||||
window->set_forced_shadow(true);
|
window->set_forced_shadow(true);
|
||||||
window->resize(GUI::Desktop::the().rect().width() / 3, 46);
|
window->resize(GUI::Desktop::the().rect().width() / 3, {});
|
||||||
window->center_on_screen();
|
window->center_on_screen();
|
||||||
window->move_to(window->x(), window->y() - (GUI::Desktop::the().rect().height() * 0.33));
|
window->move_to(window->x(), window->y() - (GUI::Desktop::the().rect().height() * 0.33));
|
||||||
window->show();
|
window->show();
|
||||||
|
|
Loading…
Reference in a new issue