mirror of
https://github.com/RGBCube/serenity
synced 2025-07-29 14:27:35 +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
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue