mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibGUI: Remove Widget::try_set_layout<T>()
And fall back to the infallible set_layout<T>(). Work towards #20557.
This commit is contained in:
parent
341626e2ea
commit
8322b31b97
Notes:
sideshowbarker
2024-07-17 00:37:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8322b31b97 Pull-request: https://github.com/SerenityOS/serenity/pull/20571
52 changed files with 127 additions and 135 deletions
|
@ -237,7 +237,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto& tab_widget = *widget->find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
|
||||
|
||||
auto backtrace_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Backtrace"_string));
|
||||
TRY(backtrace_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
backtrace_tab->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
|
||||
auto backtrace_label = TRY(backtrace_tab->try_add<GUI::Label>("A backtrace for each thread alive during the crash is listed below:"_string));
|
||||
backtrace_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -257,7 +257,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
cpu_registers_tab_widget->set_tab_position(GUI::TabWidget::TabPosition::Bottom);
|
||||
|
||||
auto environment_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Environment"_string));
|
||||
TRY(environment_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
environment_tab->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
|
||||
auto environment_text_editor = TRY(environment_tab->try_add<GUI::TextEditor>());
|
||||
environment_text_editor->set_text(DeprecatedString::join('\n', environment));
|
||||
|
@ -266,7 +266,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
environment_text_editor->set_should_hide_unnecessary_scrollbars(true);
|
||||
|
||||
auto memory_regions_tab = TRY(tab_widget.try_add_tab<GUI::Widget>("Memory Regions"_string));
|
||||
TRY(memory_regions_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
memory_regions_tab->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
|
||||
auto memory_regions_text_editor = TRY(memory_regions_tab->try_add<GUI::TextEditor>());
|
||||
memory_regions_text_editor->set_text(DeprecatedString::join('\n', memory_regions));
|
||||
|
@ -331,7 +331,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
[&](auto results) -> ErrorOr<void> {
|
||||
for (auto& backtrace : results.thread_backtraces) {
|
||||
auto container = TRY(backtrace_tab_widget->try_add_tab<GUI::Widget>(TRY(String::from_deprecated_string(backtrace.title))));
|
||||
TRY(container->template try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
container->template set_layout<GUI::VerticalBoxLayout>(4);
|
||||
auto backtrace_text_editor = TRY(container->template try_add<GUI::TextEditor>());
|
||||
backtrace_text_editor->set_text(backtrace.text);
|
||||
backtrace_text_editor->set_mode(GUI::TextEditor::Mode::ReadOnly);
|
||||
|
@ -342,7 +342,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
for (auto& cpu_registers : results.thread_cpu_registers) {
|
||||
auto container = TRY(cpu_registers_tab_widget->try_add_tab<GUI::Widget>(TRY(String::from_deprecated_string(cpu_registers.title))));
|
||||
TRY(container->template try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
container->template set_layout<GUI::VerticalBoxLayout>(4);
|
||||
auto cpu_registers_text_editor = TRY(container->template try_add<GUI::TextEditor>());
|
||||
cpu_registers_text_editor->set_text(cpu_registers.text);
|
||||
cpu_registers_text_editor->set_mode(GUI::TextEditor::Mode::ReadOnly);
|
||||
|
|
|
@ -71,7 +71,7 @@ PropertiesWindow::PropertiesWindow(DeprecatedString const& path, Window* parent_
|
|||
ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
|
||||
{
|
||||
auto main_widget = TRY(set_main_widget<GUI::Widget>());
|
||||
TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(4, 6));
|
||||
main_widget->set_layout<GUI::VerticalBoxLayout>(4, 6);
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
|
||||
auto tab_widget = TRY(main_widget->try_add<GUI::TabWidget>());
|
||||
|
@ -79,7 +79,7 @@ ErrorOr<void> PropertiesWindow::create_widgets(bool disable_rename)
|
|||
TRY(create_file_type_specific_tabs(tab_widget));
|
||||
|
||||
auto button_widget = TRY(main_widget->try_add<GUI::Widget>());
|
||||
TRY(button_widget->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 5));
|
||||
button_widget->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 5);
|
||||
button_widget->set_fixed_height(22);
|
||||
|
||||
TRY(button_widget->add_spacer());
|
||||
|
|
|
@ -388,7 +388,7 @@ ErrorOr<int> run_in_desktop_mode()
|
|||
window->set_icon(desktop_icon);
|
||||
|
||||
auto desktop_widget = TRY(window->set_main_widget<FileManager::DesktopWidget>());
|
||||
TRY(desktop_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
desktop_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto directory_view = TRY(desktop_widget->try_add<DirectoryView>(DirectoryView::Mode::Desktop));
|
||||
directory_view->set_name("directory_view");
|
||||
|
|
|
@ -36,7 +36,7 @@ MainWidget::MainWidget(TrackManager& track_manager, AudioPlayerLoop& loop)
|
|||
|
||||
ErrorOr<void> MainWidget::initialize()
|
||||
{
|
||||
TRY(try_set_layout<GUI::VerticalBoxLayout>(2, 2));
|
||||
set_layout<GUI::VerticalBoxLayout>(2, 2);
|
||||
set_fill_with_background_color(true);
|
||||
|
||||
m_wave_widget = TRY(try_add<WaveWidget>(m_track_manager));
|
||||
|
@ -52,7 +52,7 @@ ErrorOr<void> MainWidget::initialize()
|
|||
m_player_widget = TRY(try_add<PlayerWidget>(m_track_manager, *this, m_audio_loop));
|
||||
|
||||
m_keys_and_knobs_container = TRY(try_add<GUI::Widget>());
|
||||
TRY(m_keys_and_knobs_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 2));
|
||||
m_keys_and_knobs_container->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 2);
|
||||
m_keys_and_knobs_container->set_fixed_height(130);
|
||||
m_keys_and_knobs_container->set_fill_with_background_color(true);
|
||||
|
||||
|
@ -60,7 +60,7 @@ ErrorOr<void> MainWidget::initialize()
|
|||
|
||||
m_octave_container = TRY(m_keys_and_knobs_container->try_add<GUI::Widget>());
|
||||
m_octave_container->set_preferred_width(GUI::SpecialDimension::Fit);
|
||||
TRY(m_octave_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
m_octave_container->set_layout<GUI::VerticalBoxLayout>();
|
||||
auto octave_label = TRY(m_octave_container->try_add<GUI::Label>("Octave"_string));
|
||||
octave_label->set_preferred_width(GUI::SpecialDimension::Fit);
|
||||
m_octave_value = TRY(m_octave_container->try_add<GUI::Label>(TRY(String::number(m_track_manager.keyboard()->virtual_keyboard_octave()))));
|
||||
|
|
|
@ -41,7 +41,7 @@ PlayerWidget::PlayerWidget(TrackManager& manager, MainWidget& main_widget, Audio
|
|||
|
||||
ErrorOr<void> PlayerWidget::initialize()
|
||||
{
|
||||
TRY(try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
set_layout<GUI::HorizontalBoxLayout>();
|
||||
set_fill_with_background_color(true);
|
||||
TRY(m_track_number_choices.try_append("1"));
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ ErrorOr<NonnullRefPtr<TrackControlsWidget>> TrackControlsWidget::try_create(Weak
|
|||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) TrackControlsWidget(move(track))));
|
||||
|
||||
TRY(widget->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
widget->set_layout<GUI::HorizontalBoxLayout>();
|
||||
widget->set_preferred_width(GUI::SpecialDimension::Grow);
|
||||
widget->set_fill_with_background_color(true);
|
||||
|
||||
auto mastering_parameters = TRY(widget->try_add<GUI::GroupBox>());
|
||||
TRY(mastering_parameters->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mastering_parameters->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto strong_track = widget->m_track.value();
|
||||
|
||||
|
@ -40,7 +40,7 @@ ErrorOr<NonnullRefPtr<TrackControlsWidget>> TrackControlsWidget::try_create(Weak
|
|||
|
||||
for (auto& processor : strong_track->processor_chain()) {
|
||||
auto processor_parameters = TRY(widget->try_add<GUI::GroupBox>());
|
||||
TRY(processor_parameters->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
processor_parameters->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
for (auto& parameter : processor->parameters())
|
||||
(void)TRY(processor_parameters->try_add<ProcessorParameterWidget>(parameter));
|
||||
|
|
|
@ -38,7 +38,7 @@ ErrorOr<RefPtr<GUI::Widget>> Bloom::get_settings_widget()
|
|||
{
|
||||
if (!m_settings_widget) {
|
||||
auto settings_widget = TRY(GUI::Widget::try_create());
|
||||
TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
settings_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>("Bloom Filter"_string));
|
||||
name_label->set_font_weight(Gfx::FontWeight::Bold);
|
||||
|
@ -47,7 +47,7 @@ ErrorOr<RefPtr<GUI::Widget>> Bloom::get_settings_widget()
|
|||
|
||||
auto luma_lower_container = TRY(settings_widget->try_add<GUI::Widget>());
|
||||
luma_lower_container->set_fixed_height(50);
|
||||
TRY(luma_lower_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
luma_lower_container->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 });
|
||||
|
||||
auto luma_lower_label = TRY(luma_lower_container->try_add<GUI::Label>("Luma lower bound:"_string));
|
||||
luma_lower_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -63,7 +63,7 @@ ErrorOr<RefPtr<GUI::Widget>> Bloom::get_settings_widget()
|
|||
|
||||
auto radius_container = TRY(settings_widget->try_add<GUI::Widget>());
|
||||
radius_container->set_fixed_height(50);
|
||||
TRY(radius_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
radius_container->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 });
|
||||
|
||||
auto radius_label = TRY(radius_container->try_add<GUI::Label>("Blur Radius:"_string));
|
||||
radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -40,7 +40,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
{
|
||||
if (!m_settings_widget) {
|
||||
auto settings_widget = TRY(GUI::Widget::try_create());
|
||||
TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
settings_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>("Fast Box Blur Filter"_string));
|
||||
name_label->set_font_weight(Gfx::FontWeight::Bold);
|
||||
|
@ -86,7 +86,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
|
||||
m_radius_container = TRY(settings_widget->try_add<GUI::Widget>());
|
||||
m_radius_container->set_fixed_height(20);
|
||||
TRY(m_radius_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
m_radius_container->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 });
|
||||
|
||||
auto radius_label = TRY(m_radius_container->try_add<GUI::Label>("Radius:"_string));
|
||||
radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -103,7 +103,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
m_asymmetric_radius_container = TRY(settings_widget->try_add<GUI::Widget>());
|
||||
m_asymmetric_radius_container->set_visible(false);
|
||||
m_asymmetric_radius_container->set_fixed_height(50);
|
||||
TRY(m_asymmetric_radius_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
m_asymmetric_radius_container->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 });
|
||||
|
||||
auto radius_x_container = TRY(m_asymmetric_radius_container->try_add<GUI::Widget>());
|
||||
radius_x_container->set_fixed_height(20);
|
||||
|
@ -123,7 +123,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
|
||||
auto radius_y_container = TRY(m_asymmetric_radius_container->try_add<GUI::Widget>());
|
||||
radius_y_container->set_fixed_height(20);
|
||||
TRY(radius_y_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
radius_y_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto radius_y_label = TRY(radius_y_container->try_add<GUI::Label>("Radius Y:"_string));
|
||||
radius_y_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -140,11 +140,11 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
m_vector_container = TRY(settings_widget->try_add<GUI::Widget>());
|
||||
m_vector_container->set_visible(false);
|
||||
m_vector_container->set_fixed_height(50);
|
||||
TRY(m_vector_container->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
m_vector_container->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 0, 4, 0 });
|
||||
|
||||
auto angle_container = TRY(m_vector_container->try_add<GUI::Widget>());
|
||||
angle_container->set_fixed_height(20);
|
||||
TRY(angle_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
angle_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto angle_label = TRY(angle_container->try_add<GUI::Label>("Angle:"_string));
|
||||
angle_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -160,7 +160,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
|
||||
auto magnitude_container = TRY(m_vector_container->try_add<GUI::Widget>());
|
||||
magnitude_container->set_fixed_height(20);
|
||||
TRY(magnitude_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
magnitude_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto magnitude_label = TRY(magnitude_container->try_add<GUI::Label>("Magnitude:"_string));
|
||||
magnitude_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -176,7 +176,7 @@ ErrorOr<RefPtr<GUI::Widget>> FastBoxBlur::get_settings_widget()
|
|||
|
||||
auto gaussian_container = TRY(settings_widget->try_add<GUI::Widget>());
|
||||
gaussian_container->set_fixed_height(20);
|
||||
TRY(gaussian_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
gaussian_container->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 });
|
||||
|
||||
m_gaussian_checkbox = TRY(gaussian_container->try_add<GUI::CheckBox>("Approximate Gaussian Blur"_string));
|
||||
m_gaussian_checkbox->set_checked(m_approximate_gauss);
|
||||
|
|
|
@ -26,7 +26,7 @@ ErrorOr<RefPtr<GUI::Widget>> Filter::get_settings_widget()
|
|||
{
|
||||
if (!m_settings_widget) {
|
||||
auto settings_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
settings_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>(TRY(String::from_utf8(filter_name()))));
|
||||
name_label->set_text_alignment(Gfx::TextAlignment::TopLeft);
|
||||
|
|
|
@ -31,7 +31,7 @@ ErrorOr<RefPtr<GUI::Widget>> HueAndSaturation::get_settings_widget()
|
|||
{
|
||||
if (!m_settings_widget) {
|
||||
auto settings_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
settings_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto add_slider = [&](auto name, int min, int max, auto member) -> ErrorOr<void> {
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>(TRY(String::from_utf8(name))));
|
||||
|
|
|
@ -21,7 +21,7 @@ ErrorOr<RefPtr<GUI::Widget>> Sepia::get_settings_widget()
|
|||
{
|
||||
if (!m_settings_widget) {
|
||||
auto settings_widget = TRY(GUI::Widget::try_create());
|
||||
TRY(settings_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
settings_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto name_label = TRY(settings_widget->try_add<GUI::Label>("Sepia Filter"_string));
|
||||
name_label->set_font_weight(Gfx::FontWeight::Bold);
|
||||
|
@ -30,7 +30,7 @@ ErrorOr<RefPtr<GUI::Widget>> Sepia::get_settings_widget()
|
|||
|
||||
auto amount_container = TRY(settings_widget->try_add<GUI::Widget>());
|
||||
amount_container->set_fixed_height(20);
|
||||
TRY(amount_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 }));
|
||||
amount_container->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 4, 0, 4, 0 });
|
||||
|
||||
auto amount_label = TRY(amount_container->try_add<GUI::Label>("Amount:"_string));
|
||||
amount_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -141,11 +141,11 @@ ErrorOr<GUI::Widget*> BrushTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto size_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
size_container->set_fixed_height(20);
|
||||
(void)TRY(size_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
size_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_string));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -165,7 +165,7 @@ ErrorOr<GUI::Widget*> BrushTool::get_properties_widget()
|
|||
|
||||
auto hardness_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
hardness_container->set_fixed_height(20);
|
||||
(void)TRY(hardness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
hardness_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>("Hardness:"_string));
|
||||
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -65,11 +65,11 @@ ErrorOr<GUI::Widget*> BucketTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto threshold_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
threshold_container->set_fixed_height(20);
|
||||
(void)TRY(threshold_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
threshold_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto threshold_label = TRY(threshold_container->try_add<GUI::Label>("Threshold:"_string));
|
||||
threshold_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -129,11 +129,11 @@ ErrorOr<GUI::Widget*> CloneTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto size_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
size_container->set_fixed_height(20);
|
||||
(void)TRY(size_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
size_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_string));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -152,7 +152,7 @@ ErrorOr<GUI::Widget*> CloneTool::get_properties_widget()
|
|||
|
||||
auto hardness_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
hardness_container->set_fixed_height(20);
|
||||
(void)TRY(hardness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
hardness_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>("Hardness:"_string));
|
||||
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -130,11 +130,11 @@ ErrorOr<GUI::Widget*> EllipseTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto thickness_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
thickness_container->set_fixed_height(20);
|
||||
(void)TRY(thickness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
thickness_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto thickness_label = TRY(thickness_container->try_add<GUI::Label>("Thickness:"_string));
|
||||
thickness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -151,12 +151,12 @@ ErrorOr<GUI::Widget*> EllipseTool::get_properties_widget()
|
|||
|
||||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(70);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_string));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
auto mode_radio_container = TRY(mode_container->try_add<GUI::Widget>());
|
||||
(void)TRY(mode_radio_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
mode_radio_container->set_layout<GUI::VerticalBoxLayout>();
|
||||
auto outline_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Outline"_string));
|
||||
auto fill_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Fill"_string));
|
||||
auto aa_enable_checkbox = TRY(mode_radio_container->try_add<GUI::CheckBox>("Anti-alias"_string));
|
||||
|
@ -178,7 +178,7 @@ ErrorOr<GUI::Widget*> EllipseTool::get_properties_widget()
|
|||
|
||||
auto aspect_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
aspect_container->set_fixed_height(20);
|
||||
(void)TRY(aspect_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
aspect_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto aspect_label = TRY(aspect_container->try_add<GUI::Label>("Aspect Ratio:"_string));
|
||||
aspect_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -58,11 +58,11 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto size_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
size_container->set_fixed_height(20);
|
||||
(void)TRY(size_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
size_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_string));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -80,7 +80,7 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
|
|||
|
||||
auto hardness_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
hardness_container->set_fixed_height(20);
|
||||
(void)TRY(hardness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
hardness_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto hardness_label = TRY(hardness_container->try_add<GUI::Label>("Hardness:"_string));
|
||||
hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -97,7 +97,7 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
|
|||
|
||||
auto secondary_color_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
secondary_color_container->set_fixed_height(20);
|
||||
(void)TRY(secondary_color_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
secondary_color_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto use_secondary_color_checkbox = TRY(secondary_color_container->try_add<GUI::CheckBox>());
|
||||
use_secondary_color_checkbox->set_checked(m_use_secondary_color);
|
||||
|
@ -108,13 +108,13 @@ ErrorOr<GUI::Widget*> EraseTool::get_properties_widget()
|
|||
|
||||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(46);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Draw Mode:"_string));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
||||
auto mode_radio_container = TRY(mode_container->try_add<GUI::Widget>());
|
||||
(void)TRY(mode_radio_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
mode_radio_container->set_layout<GUI::VerticalBoxLayout>();
|
||||
auto pencil_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Pencil"_string));
|
||||
auto brush_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Brush"_string));
|
||||
|
||||
|
|
|
@ -202,11 +202,11 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(20);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Gradient Type:"_string));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(80, 20);
|
||||
|
@ -235,7 +235,7 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
|
|||
|
||||
auto opacity_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
opacity_container->set_fixed_height(20);
|
||||
(void)TRY(opacity_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
opacity_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto opacity_label = TRY(opacity_container->try_add<GUI::Label>("Opacity:"_string));
|
||||
opacity_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -253,7 +253,7 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
|
|||
set_primary_slider(opacity_slider);
|
||||
|
||||
auto hardness_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
(void)TRY(hardness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
hardness_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
hardness_container->set_fixed_height(20);
|
||||
hardness_container->set_visible(m_mode == GradientMode::Radial);
|
||||
|
||||
|
@ -294,7 +294,7 @@ ErrorOr<GUI::Widget*> GradientTool::get_properties_widget()
|
|||
|
||||
auto button_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
button_container->set_fixed_height(22);
|
||||
TRY(button_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
button_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
button_container->add_spacer().release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
auto apply_button = TRY(button_container->try_add<GUI::DialogButton>("Apply"_string));
|
||||
|
|
|
@ -180,11 +180,11 @@ ErrorOr<GUI::Widget*> GuideTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto snapping_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
snapping_container->set_fixed_height(20);
|
||||
(void)TRY(snapping_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
snapping_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto snapping_label = TRY(snapping_container->try_add<GUI::Label>("Snap offset:"_string));
|
||||
snapping_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -161,11 +161,11 @@ ErrorOr<GUI::Widget*> LassoSelectTool::get_properties_widget()
|
|||
}
|
||||
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(20);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>());
|
||||
mode_label->set_text("Mode:"_string);
|
||||
|
|
|
@ -123,11 +123,11 @@ ErrorOr<GUI::Widget*> LineTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto thickness_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
thickness_container->set_fixed_height(20);
|
||||
(void)TRY(thickness_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
thickness_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto thickness_label = TRY(thickness_container->try_add<GUI::Label>("Thickness:"_string));
|
||||
thickness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -144,7 +144,7 @@ ErrorOr<GUI::Widget*> LineTool::get_properties_widget()
|
|||
|
||||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(20);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_string));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -293,17 +293,17 @@ ErrorOr<GUI::Widget*> MoveTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto selection_mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
(void)TRY(selection_mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
selection_mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
selection_mode_container->set_fixed_height(46);
|
||||
auto selection_mode_label = TRY(selection_mode_container->try_add<GUI::Label>("Selection Mode:"_string));
|
||||
selection_mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
selection_mode_label->set_fixed_size(80, 40);
|
||||
|
||||
auto mode_radio_container = TRY(selection_mode_container->try_add<GUI::Widget>());
|
||||
(void)TRY(mode_radio_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
mode_radio_container->set_layout<GUI::VerticalBoxLayout>();
|
||||
m_selection_mode_foreground = TRY(mode_radio_container->try_add<GUI::RadioButton>("Foreground"_string));
|
||||
|
||||
m_selection_mode_active = TRY(mode_radio_container->try_add<GUI::RadioButton>("Active Layer"_string));
|
||||
|
|
|
@ -39,11 +39,11 @@ ErrorOr<GUI::Widget*> PenTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto size_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
size_container->set_fixed_height(20);
|
||||
(void)TRY(size_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
size_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>("Thickness:"_string));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -45,7 +45,7 @@ ErrorOr<GUI::Widget*> PickerTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto sample_checkbox = TRY(properties_widget->try_add<GUI::CheckBox>("Sample all layers"_string));
|
||||
sample_checkbox->set_checked(m_sample_all_layers);
|
||||
|
|
|
@ -190,11 +190,11 @@ ErrorOr<GUI::Widget*> PolygonalSelectTool::get_properties_widget()
|
|||
return m_properties_widget.ptr();
|
||||
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(20);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>());
|
||||
mode_label->set_text("Mode:"_string);
|
||||
|
|
|
@ -158,11 +158,11 @@ ErrorOr<GUI::Widget*> RectangleSelectTool::get_properties_widget()
|
|||
}
|
||||
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto feather_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
feather_container->set_fixed_height(20);
|
||||
(void)TRY(feather_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
feather_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto feather_label = TRY(feather_container->try_add<GUI::Label>());
|
||||
feather_label->set_text("Feather:"_string);
|
||||
|
@ -181,7 +181,7 @@ ErrorOr<GUI::Widget*> RectangleSelectTool::get_properties_widget()
|
|||
|
||||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(20);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>());
|
||||
mode_label->set_text("Mode:"_string);
|
||||
|
|
|
@ -144,11 +144,11 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto thickness_or_radius_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
thickness_or_radius_container->set_fixed_height(20);
|
||||
(void)TRY(thickness_or_radius_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
thickness_or_radius_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto thickness_or_radius_label = TRY(thickness_or_radius_container->try_add<GUI::Label>());
|
||||
thickness_or_radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -180,13 +180,13 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
|
|||
|
||||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(90);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>("Mode:"_string));
|
||||
mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
mode_label->set_fixed_size(30, 20);
|
||||
|
||||
auto mode_radio_container = TRY(mode_container->try_add<GUI::Widget>());
|
||||
(void)TRY(mode_radio_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
mode_radio_container->set_layout<GUI::VerticalBoxLayout>();
|
||||
auto outline_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Outline"_string));
|
||||
auto fill_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Fill"_string));
|
||||
auto gradient_mode_radio = TRY(mode_radio_container->try_add<GUI::RadioButton>("Gradient"_string));
|
||||
|
@ -213,7 +213,7 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
|
|||
outline_mode_radio->set_checked(true);
|
||||
|
||||
auto mode_extras_container = TRY(mode_container->try_add<GUI::Widget>());
|
||||
(void)TRY(mode_extras_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
mode_extras_container->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto aa_enable_checkbox = TRY(mode_extras_container->try_add<GUI::CheckBox>("Anti-alias"_string));
|
||||
aa_enable_checkbox->on_checked = [this](bool checked) {
|
||||
|
@ -222,7 +222,7 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
|
|||
aa_enable_checkbox->set_checked(true);
|
||||
|
||||
auto aspect_container = TRY(mode_extras_container->try_add<GUI::Widget>());
|
||||
(void)TRY(aspect_container->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
aspect_container->set_layout<GUI::VerticalBoxLayout>();
|
||||
aspect_container->set_fixed_width(75);
|
||||
|
||||
auto aspect_label = TRY(aspect_container->try_add<GUI::Label>("Aspect Ratio:"_string));
|
||||
|
@ -231,7 +231,7 @@ ErrorOr<GUI::Widget*> RectangleTool::get_properties_widget()
|
|||
|
||||
auto aspect_fields_container = TRY(aspect_container->try_add<GUI::Widget>());
|
||||
aspect_fields_container->set_fixed_width(75);
|
||||
(void)TRY(aspect_fields_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
aspect_fields_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
m_aspect_w_textbox = TRY(aspect_fields_container->try_add<GUI::TextBox>());
|
||||
m_aspect_w_textbox->set_fixed_height(20);
|
||||
|
|
|
@ -94,11 +94,11 @@ ErrorOr<GUI::Widget*> SprayTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto size_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
size_container->set_fixed_height(20);
|
||||
(void)TRY(size_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
size_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto size_label = TRY(size_container->try_add<GUI::Label>("Size:"_string));
|
||||
size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -115,7 +115,7 @@ ErrorOr<GUI::Widget*> SprayTool::get_properties_widget()
|
|||
|
||||
auto density_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
density_container->set_fixed_height(20);
|
||||
(void)TRY(density_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
density_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto density_label = TRY(density_container->try_add<GUI::Label>("Density:"_string));
|
||||
density_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -109,7 +109,7 @@ ErrorOr<GUI::Widget*> TextTool::get_properties_widget()
|
|||
return m_properties_widget.ptr();
|
||||
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto font_header = TRY(properties_widget->try_add<GUI::Label>("Current Font:"_string));
|
||||
font_header->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -73,11 +73,11 @@ ErrorOr<GUI::Widget*> WandSelectTool::get_properties_widget()
|
|||
}
|
||||
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto threshold_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
threshold_container->set_fixed_height(20);
|
||||
(void)TRY(threshold_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
threshold_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto threshold_label = TRY(threshold_container->try_add<GUI::Label>("Threshold:"_string));
|
||||
threshold_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
@ -94,7 +94,7 @@ ErrorOr<GUI::Widget*> WandSelectTool::get_properties_widget()
|
|||
|
||||
auto mode_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
mode_container->set_fixed_height(20);
|
||||
(void)TRY(mode_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
mode_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto mode_label = TRY(mode_container->try_add<GUI::Label>());
|
||||
mode_label->set_text("Mode:"_string);
|
||||
|
|
|
@ -27,11 +27,11 @@ ErrorOr<GUI::Widget*> ZoomTool::get_properties_widget()
|
|||
{
|
||||
if (!m_properties_widget) {
|
||||
auto properties_widget = TRY(GUI::Widget::try_create());
|
||||
(void)TRY(properties_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
properties_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto sensitivity_container = TRY(properties_widget->try_add<GUI::Widget>());
|
||||
sensitivity_container->set_fixed_height(20);
|
||||
(void)TRY(sensitivity_container->try_set_layout<GUI::HorizontalBoxLayout>());
|
||||
sensitivity_container->set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto sensitivity_label = TRY(sensitivity_container->try_add<GUI::Label>("Sensitivity:"_string));
|
||||
sensitivity_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
|
|
@ -16,7 +16,7 @@ ErrorOr<NonnullRefPtr<ProgressWindow>> ProgressWindow::try_create(StringView tit
|
|||
|
||||
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
main_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto label = TRY(main_widget->try_add<GUI::Label>("Analyzing storage space..."_string));
|
||||
label->set_fixed_height(22);
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace SystemMonitor {
|
|||
ErrorOr<NonnullRefPtr<ProcessFileDescriptorMapWidget>> ProcessFileDescriptorMapWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ProcessFileDescriptorMapWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
|
||||
|
||||
Vector<GUI::JsonArrayModel::FieldSpec> pid_fds_fields;
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
ErrorOr<NonnullRefPtr<ProcessMemoryMapWidget>> ProcessMemoryMapWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ProcessMemoryMapWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
|
||||
|
||||
Vector<GUI::JsonArrayModel::FieldSpec> pid_vm_fields;
|
||||
|
|
|
@ -96,7 +96,7 @@ private:
|
|||
ErrorOr<NonnullRefPtr<ProcessStateWidget>> ProcessStateWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ProcessStateWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
|
||||
widget->m_table_view->set_model(TRY(try_make_ref_counted<ProcessStateModel>(ProcessModel::the(), 0)));
|
||||
widget->m_table_view->column_header().set_visible(false);
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace SystemMonitor {
|
|||
ErrorOr<NonnullRefPtr<ProcessUnveiledPathsWidget>> ProcessUnveiledPathsWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ProcessUnveiledPathsWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_table_view = TRY(widget->try_add<GUI::TableView>());
|
||||
|
||||
Vector<GUI::JsonArrayModel::FieldSpec> pid_unveil_fields;
|
||||
|
|
|
@ -74,7 +74,7 @@ private:
|
|||
ErrorOr<NonnullRefPtr<ThreadStackWidget>> ThreadStackWidget::try_create()
|
||||
{
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ThreadStackWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
widget->m_stack_table = TRY(widget->try_add<GUI::TableView>());
|
||||
widget->m_stack_table->set_model(TRY(try_make_ref_counted<ThreadStackModel>()));
|
||||
return widget;
|
||||
|
|
|
@ -578,7 +578,7 @@ ErrorOr<void> build_performance_tab(GUI::Widget& graphs_container)
|
|||
Vector<SystemMonitor::GraphWidget&> cpu_graphs;
|
||||
for (auto row = 0u; row < cpu_graph_rows; ++row) {
|
||||
auto cpu_graph_row = TRY(cpu_graph_group_box.try_add<GUI::Widget>());
|
||||
TRY(cpu_graph_row->try_set_layout<GUI::HorizontalBoxLayout>(6));
|
||||
cpu_graph_row->set_layout<GUI::HorizontalBoxLayout>(6);
|
||||
cpu_graph_row->set_fixed_height(108);
|
||||
for (auto i = 0u; i < cpu_graphs_per_row; ++i) {
|
||||
auto cpu_graph = TRY(cpu_graph_row->try_add<SystemMonitor::GraphWidget>());
|
||||
|
|
|
@ -167,10 +167,10 @@ static ErrorOr<NonnullRefPtr<GUI::Window>> create_find_window(VT::TerminalWidget
|
|||
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
main_widget->set_background_role(ColorRole::Button);
|
||||
TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
main_widget->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
|
||||
auto find = TRY(main_widget->try_add<GUI::Widget>());
|
||||
TRY(find->try_set_layout<GUI::HorizontalBoxLayout>(4));
|
||||
find->set_layout<GUI::HorizontalBoxLayout>(4);
|
||||
find->set_fixed_height(30);
|
||||
|
||||
auto find_textbox = TRY(find->try_add<GUI::TextBox>());
|
||||
|
|
|
@ -466,12 +466,12 @@ ErrorOr<void> MainWidget::add_property_tab(PropertyTab const& property_tab)
|
|||
|
||||
auto properties_list = TRY(GUI::Widget::try_create());
|
||||
scrollable_container->set_widget(properties_list);
|
||||
TRY(properties_list->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 8 }, 12));
|
||||
properties_list->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 8 }, 12);
|
||||
|
||||
for (auto const& group : property_tab.property_groups) {
|
||||
NonnullRefPtr<GUI::GroupBox> group_box = TRY(properties_list->try_add<GUI::GroupBox>(group.title));
|
||||
// 1px less on the left makes the text line up with the group title.
|
||||
TRY(group_box->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 8, 8, 8, 7 }, 12));
|
||||
group_box->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 8, 8, 8, 7 }, 12);
|
||||
group_box->set_preferred_height(GUI::SpecialDimension::Fit);
|
||||
|
||||
for (auto const& property : group.properties) {
|
||||
|
|
|
@ -42,7 +42,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto catdog_widget = TRY(CatDog::create());
|
||||
window->set_main_widget(catdog_widget);
|
||||
TRY(catdog_widget->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0));
|
||||
catdog_widget->set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0);
|
||||
|
||||
auto context_menu = TRY(GUI::Menu::try_create());
|
||||
TRY(context_menu->try_add_action(GUI::CommonActions::make_about_action("CatDog Demo", app_icon, window)));
|
||||
|
@ -62,7 +62,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
advice_window->set_alpha_hit_threshold(1.0f);
|
||||
|
||||
auto advice_widget = TRY(advice_window->set_main_widget<SpeechBubble>(catdog_widget));
|
||||
TRY(advice_widget->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0));
|
||||
advice_widget->set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0);
|
||||
|
||||
auto advice_timer = TRY(Core::Timer::create_single_shot(15'000, [&] {
|
||||
window->move_to_front();
|
||||
|
|
|
@ -13,7 +13,7 @@ GalleryWidget::GalleryWidget()
|
|||
set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto& inner_widget = add<GUI::Widget>();
|
||||
inner_widget.try_set_layout<GUI::VerticalBoxLayout>(4).release_value_but_fixme_should_propagate_errors();
|
||||
inner_widget.set_layout<GUI::VerticalBoxLayout>(4);
|
||||
|
||||
m_tab_widget = inner_widget.try_add<GUI::TabWidget>().release_value_but_fixme_should_propagate_errors();
|
||||
m_statusbar = add<GUI::Statusbar>();
|
||||
|
|
|
@ -132,7 +132,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto tab_widget = TRY(main_splitter->try_add<GUI::TabWidget>());
|
||||
|
||||
auto tree_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Call Tree"_string));
|
||||
TRY(tree_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
tree_tab->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
auto bottom_splitter = TRY(tree_tab->try_add<GUI::VerticalSplitter>());
|
||||
|
||||
auto tree_view = TRY(bottom_splitter->try_add<GUI::TreeView>());
|
||||
|
@ -181,7 +181,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
});
|
||||
|
||||
auto samples_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Samples"_string));
|
||||
TRY(samples_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
samples_tab->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
|
||||
auto samples_splitter = TRY(samples_tab->try_add<GUI::HorizontalSplitter>());
|
||||
auto samples_table_view = TRY(samples_splitter->try_add<GUI::TableView>());
|
||||
|
@ -195,7 +195,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
};
|
||||
|
||||
auto signposts_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Signposts"_string));
|
||||
TRY(signposts_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
signposts_tab->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
|
||||
auto signposts_splitter = TRY(signposts_tab->try_add<GUI::HorizontalSplitter>());
|
||||
auto signposts_table_view = TRY(signposts_splitter->try_add<GUI::TableView>());
|
||||
|
@ -209,7 +209,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
};
|
||||
|
||||
auto flamegraph_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Flame Graph"_string));
|
||||
TRY(flamegraph_tab->try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 4, 4, 4 }));
|
||||
flamegraph_tab->set_layout<GUI::VerticalBoxLayout>(GUI::Margins { 4, 4, 4, 4 });
|
||||
|
||||
auto flamegraph_view = TRY(flamegraph_tab->try_add<FlameGraphView>(profile->model(), ProfileModel::Column::StackFrame, ProfileModel::Column::SampleCount));
|
||||
|
||||
|
@ -257,7 +257,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
flamegraph_view->on_hover_change = [&] { statusbar_update(); };
|
||||
|
||||
auto filesystem_events_tab = TRY(tab_widget->try_add_tab<GUI::Widget>("Filesystem events"_string));
|
||||
TRY(filesystem_events_tab->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
filesystem_events_tab->set_layout<GUI::VerticalBoxLayout>(4);
|
||||
|
||||
auto filesystem_events_tree_view = TRY(filesystem_events_tab->try_add<GUI::TreeView>());
|
||||
filesystem_events_tree_view->set_should_fill_selected_rows(true);
|
||||
|
|
|
@ -60,7 +60,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
main_toolbar.layout()->set_margins({ 0, 6 });
|
||||
|
||||
auto& board_widget_container = *main_widget->find_descendant_of_type_named<GUI::Widget>("board_widget_container");
|
||||
TRY(board_widget_container.try_set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0));
|
||||
board_widget_container.set_layout<GUI::VerticalBoxLayout>(GUI::Margins {}, 0);
|
||||
auto board_widget = TRY(board_widget_container.try_add<BoardWidget>(board_rows, board_columns));
|
||||
board_widget->randomize_cells();
|
||||
|
||||
|
|
|
@ -128,12 +128,12 @@ void InputBox::on_done(ExecResult result)
|
|||
ErrorOr<void> InputBox::build()
|
||||
{
|
||||
auto main_widget = TRY(set_main_widget<Widget>());
|
||||
TRY(main_widget->try_set_layout<VerticalBoxLayout>(6, 6));
|
||||
main_widget->set_layout<VerticalBoxLayout>(6, 6);
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
|
||||
if (!m_prompt.is_empty()) {
|
||||
auto prompt_container = TRY(main_widget->try_add<Widget>());
|
||||
TRY(prompt_container->try_set_layout<HorizontalBoxLayout>(0, 8));
|
||||
prompt_container->set_layout<HorizontalBoxLayout>(0, 8);
|
||||
if (m_icon) {
|
||||
auto image_widget = TRY(prompt_container->try_add<ImageWidget>());
|
||||
image_widget->set_bitmap(m_icon);
|
||||
|
@ -158,7 +158,7 @@ ErrorOr<void> InputBox::build()
|
|||
}
|
||||
|
||||
auto button_container = TRY(main_widget->try_add<Widget>());
|
||||
TRY(button_container->try_set_layout<HorizontalBoxLayout>(0, 6));
|
||||
button_container->set_layout<HorizontalBoxLayout>(0, 6);
|
||||
TRY(button_container->add_spacer());
|
||||
|
||||
m_ok_button = TRY(button_container->try_add<DialogButton>("OK"_string));
|
||||
|
|
|
@ -152,11 +152,11 @@ ErrorOr<void> MessageBox::build()
|
|||
{
|
||||
auto main_widget = TRY(set_main_widget<Widget>());
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
TRY(main_widget->try_set_layout<VerticalBoxLayout>(8, 6));
|
||||
main_widget->set_layout<VerticalBoxLayout>(8, 6);
|
||||
|
||||
auto message_container = TRY(main_widget->try_add<Widget>());
|
||||
auto message_margins = Margins { 8, m_type != Type::None ? 8 : 0 };
|
||||
TRY(message_container->try_set_layout<HorizontalBoxLayout>(message_margins, 8));
|
||||
message_container->set_layout<HorizontalBoxLayout>(message_margins, 8);
|
||||
|
||||
if (auto icon = TRY(this->icon()); icon && m_type != Type::None) {
|
||||
auto image_widget = TRY(message_container->try_add<ImageWidget>());
|
||||
|
@ -170,7 +170,7 @@ ErrorOr<void> MessageBox::build()
|
|||
m_text_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||
|
||||
auto button_container = TRY(main_widget->try_add<Widget>());
|
||||
TRY(button_container->try_set_layout<HorizontalBoxLayout>(Margins {}, 8));
|
||||
button_container->set_layout<HorizontalBoxLayout>(Margins {}, 8);
|
||||
|
||||
auto add_button = [&](String text, ExecResult result) -> ErrorOr<NonnullRefPtr<Button>> {
|
||||
auto button = TRY(button_container->try_add<DialogButton>());
|
||||
|
|
|
@ -27,7 +27,7 @@ ErrorOr<NonnullRefPtr<PathBreadcrumbbar>> PathBreadcrumbbar::try_create()
|
|||
auto breadcrumbbar = TRY(Breadcrumbbar::try_create());
|
||||
|
||||
auto path_breadcrumbbar = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) PathBreadcrumbbar(*location_text_box, *breadcrumbbar)));
|
||||
(void)TRY(path_breadcrumbbar->try_set_layout<GUI::VerticalBoxLayout>());
|
||||
path_breadcrumbbar->set_layout<GUI::VerticalBoxLayout>();
|
||||
TRY(path_breadcrumbbar->try_add_child(location_text_box));
|
||||
TRY(path_breadcrumbbar->try_add_child(breadcrumbbar));
|
||||
|
||||
|
|
|
@ -34,13 +34,13 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString t
|
|||
|
||||
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
TRY(main_widget->try_set_layout<GUI::VerticalBoxLayout>(4, 6));
|
||||
main_widget->set_layout<GUI::VerticalBoxLayout>(4, 6);
|
||||
|
||||
window->m_tab_widget = TRY(main_widget->try_add<GUI::TabWidget>());
|
||||
|
||||
auto button_container = TRY(main_widget->try_add<GUI::Widget>());
|
||||
button_container->set_preferred_size({ SpecialDimension::Grow, SpecialDimension::Fit });
|
||||
TRY(button_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 6));
|
||||
button_container->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 6);
|
||||
|
||||
if (show_defaults_button == ShowDefaultsButton::Yes) {
|
||||
window->m_reset_button = TRY(button_container->try_add<GUI::DialogButton>("Defaults"_string));
|
||||
|
|
|
@ -80,14 +80,6 @@ public:
|
|||
Layout const* layout() const { return m_layout.ptr(); }
|
||||
void set_layout(NonnullRefPtr<Layout>);
|
||||
|
||||
template<class T, class... Args>
|
||||
ErrorOr<void> try_set_layout(Args&&... args)
|
||||
{
|
||||
auto layout = TRY(T::try_create(forward<Args>(args)...));
|
||||
set_layout(*layout);
|
||||
return {};
|
||||
}
|
||||
|
||||
template<class T, class... Args>
|
||||
inline void set_layout(Args&&... args)
|
||||
{
|
||||
|
|
|
@ -24,13 +24,13 @@ ErrorOr<void> CoverWizardPage::build(String title, String subtitle)
|
|||
{
|
||||
set_fill_with_background_color(true);
|
||||
set_background_role(Gfx::ColorRole::Base);
|
||||
TRY(try_set_layout<HorizontalBoxLayout>());
|
||||
set_layout<HorizontalBoxLayout>();
|
||||
m_banner_image_widget = TRY(try_add<ImageWidget>());
|
||||
m_banner_image_widget->set_fixed_size(160, 315);
|
||||
m_banner_image_widget->load_from_file("/res/graphics/wizard-banner-simple.png"sv);
|
||||
|
||||
m_content_widget = TRY(try_add<Widget>());
|
||||
TRY(m_content_widget->try_set_layout<VerticalBoxLayout>(20));
|
||||
m_content_widget->set_layout<VerticalBoxLayout>(20);
|
||||
|
||||
m_header_label = TRY(m_content_widget->try_add<Label>(move(title)));
|
||||
m_header_label->set_font(Gfx::FontDatabase::the().get("Pebbleton", 14, 700, Gfx::FontWidth::Normal, 0));
|
||||
|
|
|
@ -27,17 +27,17 @@ ErrorOr<void> WizardDialog::build()
|
|||
{
|
||||
auto main_widget = TRY(set_main_widget<Widget>());
|
||||
main_widget->set_fill_with_background_color(true);
|
||||
TRY(main_widget->try_set_layout<VerticalBoxLayout>(Margins {}, 0));
|
||||
main_widget->set_layout<VerticalBoxLayout>(Margins {}, 0);
|
||||
|
||||
m_page_container_widget = TRY(main_widget->try_add<Widget>());
|
||||
m_page_container_widget->set_fixed_size(500, 315);
|
||||
TRY(m_page_container_widget->try_set_layout<VerticalBoxLayout>());
|
||||
m_page_container_widget->set_layout<VerticalBoxLayout>();
|
||||
|
||||
auto separator = TRY(main_widget->try_add<SeparatorWidget>(Gfx::Orientation::Horizontal));
|
||||
separator->set_fixed_height(2);
|
||||
|
||||
auto nav_container_widget = TRY(main_widget->try_add<Widget>());
|
||||
TRY(nav_container_widget->try_set_layout<HorizontalBoxLayout>(Margins { 0, 10 }, 0));
|
||||
nav_container_widget->set_layout<HorizontalBoxLayout>(Margins { 0, 10 }, 0);
|
||||
nav_container_widget->set_fixed_height(42);
|
||||
TRY(nav_container_widget->add_spacer());
|
||||
|
||||
|
|
|
@ -23,14 +23,14 @@ ErrorOr<NonnullRefPtr<WizardPage>> WizardPage::create(StringView title, StringVi
|
|||
|
||||
ErrorOr<void> WizardPage::build(String title, String subtitle)
|
||||
{
|
||||
TRY(try_set_layout<VerticalBoxLayout>(Margins {}, 0));
|
||||
set_layout<VerticalBoxLayout>(Margins {}, 0);
|
||||
|
||||
auto header_widget = TRY(try_add<Widget>());
|
||||
header_widget->set_fill_with_background_color(true);
|
||||
header_widget->set_background_role(Gfx::ColorRole::Base);
|
||||
header_widget->set_fixed_height(58);
|
||||
|
||||
TRY(header_widget->try_set_layout<VerticalBoxLayout>(Margins { 15, 30, 0 }));
|
||||
header_widget->set_layout<VerticalBoxLayout>(Margins { 15, 30, 0 });
|
||||
m_title_label = TRY(header_widget->try_add<Label>(move(title)));
|
||||
m_title_label->set_font(Gfx::FontDatabase::default_font().bold_variant());
|
||||
m_title_label->set_fixed_height(m_title_label->font().pixel_size_rounded_up() + 2);
|
||||
|
@ -45,7 +45,7 @@ ErrorOr<void> WizardPage::build(String title, String subtitle)
|
|||
separator->set_fixed_height(2);
|
||||
|
||||
m_body_widget = TRY(try_add<Widget>());
|
||||
TRY(m_body_widget->try_set_layout<VerticalBoxLayout>(20));
|
||||
m_body_widget->set_layout<VerticalBoxLayout>(20);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -73,13 +73,13 @@ TaskbarWindow::TaskbarWindow()
|
|||
ErrorOr<void> TaskbarWindow::populate_taskbar()
|
||||
{
|
||||
auto main_widget = TRY(set_main_widget<TaskbarWidget>());
|
||||
TRY(main_widget->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 2, 3, 0, 3 }));
|
||||
main_widget->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins { 2, 3, 0, 3 });
|
||||
|
||||
m_quick_launch = TRY(Taskbar::QuickLaunchWidget::create());
|
||||
TRY(main_widget->try_add_child(*m_quick_launch));
|
||||
|
||||
m_task_button_container = TRY(main_widget->try_add<GUI::Widget>());
|
||||
TRY(m_task_button_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 3));
|
||||
m_task_button_container->set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 3);
|
||||
|
||||
m_default_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/window.png"sv));
|
||||
|
||||
|
|
Loading…
Reference in a new issue