diff options
50 files changed, 128 insertions, 114 deletions
diff --git a/Applications/About/main.cpp b/Applications/About/main.cpp index 55753b3b17..a391e63073 100644 --- a/Applications/About/main.cpp +++ b/Applications/About/main.cpp @@ -64,7 +64,7 @@ int main(int argc, char** argv) auto widget = GWidget::construct(); window->set_main_widget(widget); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->layout()->set_margins({ 0, 8, 0, 8 }); widget->layout()->set_spacing(8); diff --git a/Applications/Browser/InspectorWidget.cpp b/Applications/Browser/InspectorWidget.cpp index 0093ee60bb..b0cc359bf5 100644 --- a/Applications/Browser/InspectorWidget.cpp +++ b/Applications/Browser/InspectorWidget.cpp @@ -38,7 +38,7 @@ InspectorWidget::InspectorWidget(GWidget* parent) : GWidget(parent) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); auto splitter = GSplitter::construct(Orientation::Vertical, this); m_dom_tree_view = GTreeView::construct(splitter); m_dom_tree_view->on_selection = [this](auto& index) { diff --git a/Applications/Browser/main.cpp b/Applications/Browser/main.cpp index b61d7ab5d0..514128c758 100644 --- a/Applications/Browser/main.cpp +++ b/Applications/Browser/main.cpp @@ -77,7 +77,7 @@ int main(int argc, char** argv) auto widget = GWidget::construct(); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->layout()->set_spacing(0); auto toolbar = GToolBar::construct(widget); diff --git a/Applications/ChanViewer/main.cpp b/Applications/ChanViewer/main.cpp index 4a7f8ee439..05700e7b4a 100644 --- a/Applications/ChanViewer/main.cpp +++ b/Applications/ChanViewer/main.cpp @@ -60,7 +60,7 @@ int main(int argc, char** argv) auto widget = GWidget::construct(); window->set_main_widget(widget); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); auto board_combo = GComboBox::construct(widget); board_combo->set_only_allow_values_from_model(true); diff --git a/Applications/DisplayProperties/DisplayProperties.cpp b/Applications/DisplayProperties/DisplayProperties.cpp index b911fc854b..b3544fa3be 100644 --- a/Applications/DisplayProperties/DisplayProperties.cpp +++ b/Applications/DisplayProperties/DisplayProperties.cpp @@ -101,7 +101,7 @@ void DisplayPropertiesWidget::create_resolution_list() void DisplayPropertiesWidget::create_root_widget() { m_root_widget = GWidget::construct(); - m_root_widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + m_root_widget->set_layout(make<GVBoxLayout>()); m_root_widget->set_fill_with_background_color(true); m_root_widget->layout()->set_margins({ 4, 4, 4, 16 }); } @@ -130,7 +130,7 @@ void DisplayPropertiesWidget::create_frame() tab_widget->add_widget("Wallpaper", background_splitter); auto background_content = GWidget::construct(background_splitter.ptr()); - background_content->set_layout(make<GBoxLayout>(Orientation::Vertical)); + background_content->set_layout(make<GVBoxLayout>()); background_content->layout()->set_margins({ 4, 4, 4, 4 }); m_wallpaper_preview = GLabel::construct(background_splitter); @@ -160,7 +160,7 @@ void DisplayPropertiesWidget::create_frame() tab_widget->add_widget("Settings", settings_splitter); auto settings_content = GWidget::construct(settings_splitter.ptr()); - settings_content->set_layout(make<GBoxLayout>(Orientation::Vertical)); + settings_content->set_layout(make<GVBoxLayout>()); settings_content->layout()->set_margins({ 4, 4, 4, 4 }); auto resolution_list = GListView::construct(settings_content); @@ -182,7 +182,7 @@ void DisplayPropertiesWidget::create_frame() // Add the apply and cancel buttons auto bottom_widget = GWidget::construct(m_root_widget.ptr()); - bottom_widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + bottom_widget->set_layout(make<GHBoxLayout>()); bottom_widget->layout()->add_spacer(); bottom_widget->set_size_policy(Orientation::Vertical, SizePolicy::Fixed); bottom_widget->set_preferred_size(1, 22); diff --git a/Applications/FileManager/PropertiesDialog.cpp b/Applications/FileManager/PropertiesDialog.cpp index dccb3da3c9..1ce9cc0060 100644 --- a/Applications/FileManager/PropertiesDialog.cpp +++ b/Applications/FileManager/PropertiesDialog.cpp @@ -43,7 +43,7 @@ PropertiesDialog::PropertiesDialog(GFileSystemModel& model, String path, bool di ASSERT(file_path.is_valid()); auto main_widget = GWidget::construct(); - main_widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + main_widget->set_layout(make<GVBoxLayout>()); main_widget->layout()->set_margins({ 4, 4, 4, 4 }); main_widget->set_fill_with_background_color(true); @@ -54,7 +54,7 @@ PropertiesDialog::PropertiesDialog(GFileSystemModel& model, String path, bool di auto tab_widget = GTabWidget::construct(main_widget); auto general_tab = GWidget::construct(tab_widget.ptr()); - general_tab->set_layout(make<GBoxLayout>(Orientation::Vertical)); + general_tab->set_layout(make<GVBoxLayout>()); general_tab->layout()->set_margins({ 12, 8, 12, 8 }); general_tab->layout()->set_spacing(10); tab_widget->add_widget("General", general_tab); @@ -62,7 +62,7 @@ PropertiesDialog::PropertiesDialog(GFileSystemModel& model, String path, bool di general_tab->layout()->add_spacer(); auto file_container = GWidget::construct(general_tab.ptr()); - file_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + file_container->set_layout(make<GHBoxLayout>()); file_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); file_container->layout()->set_spacing(20); file_container->set_preferred_size(0, 34); @@ -132,7 +132,7 @@ PropertiesDialog::PropertiesDialog(GFileSystemModel& model, String path, bool di general_tab->layout()->add_spacer(); auto button_widget = GWidget::construct(main_widget.ptr()); - button_widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + button_widget->set_layout(make<GHBoxLayout>()); button_widget->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); button_widget->set_preferred_size(0, 24); button_widget->layout()->set_spacing(5); @@ -212,7 +212,7 @@ bool PropertiesDialog::apply_changes() void PropertiesDialog::make_permission_checkboxes(NonnullRefPtr<GWidget>& parent, PermissionMasks masks, String label_string, mode_t mode) { auto widget = GWidget::construct(parent.ptr()); - widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + widget->set_layout(make<GHBoxLayout>()); widget->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); widget->set_preferred_size(0, 16); widget->layout()->set_spacing(10); @@ -241,7 +241,7 @@ void PropertiesDialog::make_property_value_pairs(const Vector<PropertyValuePair> property_labels.ensure_capacity(pairs.size()); for (auto pair : pairs) { auto label_container = GWidget::construct(parent.ptr()); - label_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + label_container->set_layout(make<GHBoxLayout>()); label_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); label_container->set_preferred_size(0, 14); label_container->layout()->set_spacing(12); diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 2a067e6832..27bbecd2c2 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -91,7 +91,7 @@ int main(int argc, char** argv) window->set_rect({ left, top, width, heigth }); auto widget = GWidget::construct(); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->layout()->set_spacing(0); auto main_toolbar = GToolBar::construct(widget); diff --git a/Applications/Help/main.cpp b/Applications/Help/main.cpp index 5b626fc4a3..a6d615fa8e 100644 --- a/Applications/Help/main.cpp +++ b/Applications/Help/main.cpp @@ -79,7 +79,7 @@ int main(int argc, char* argv[]) window->set_rect(300, 200, 570, 500); auto widget = GWidget::construct(); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->layout()->set_spacing(0); auto toolbar = GToolBar::construct(widget); diff --git a/Applications/HexEditor/HexEditorWidget.cpp b/Applications/HexEditor/HexEditorWidget.cpp index 1426856f5d..f8e620310f 100644 --- a/Applications/HexEditor/HexEditorWidget.cpp +++ b/Applications/HexEditor/HexEditorWidget.cpp @@ -46,7 +46,7 @@ HexEditorWidget::HexEditorWidget() { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_spacing(0); m_editor = HexEditor::construct(this); diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp index 9c99edb50e..354498038d 100644 --- a/Applications/IRCClient/IRCAppWindow.cpp +++ b/Applications/IRCClient/IRCAppWindow.cpp @@ -182,7 +182,7 @@ void IRCAppWindow::setup_widgets() auto widget = GWidget::construct(); set_main_widget(widget); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->layout()->set_spacing(0); auto toolbar = GToolBar::construct(widget); @@ -197,7 +197,7 @@ void IRCAppWindow::setup_widgets() toolbar->add_action(*m_close_query_action); auto outer_container = GWidget::construct(widget.ptr()); - outer_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + outer_container->set_layout(make<GVBoxLayout>()); outer_container->layout()->set_margins({ 2, 0, 2, 2 }); auto horizontal_container = GSplitter::construct(Orientation::Horizontal, outer_container); diff --git a/Applications/IRCClient/IRCWindow.cpp b/Applications/IRCClient/IRCWindow.cpp index 0223246d9d..6d8a090016 100644 --- a/Applications/IRCClient/IRCWindow.cpp +++ b/Applications/IRCClient/IRCWindow.cpp @@ -42,7 +42,7 @@ IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& na , m_type(type) , m_name(name) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); // Make a container for the log buffer view + (optional) member list. auto container = GSplitter::construct(Orientation::Horizontal, this); diff --git a/Applications/PaintBrush/PaletteWidget.cpp b/Applications/PaintBrush/PaletteWidget.cpp index e49fc2e0a1..2aa0157b00 100644 --- a/Applications/PaintBrush/PaletteWidget.cpp +++ b/Applications/PaintBrush/PaletteWidget.cpp @@ -111,15 +111,15 @@ PaletteWidget::PaletteWidget(PaintableWidget& paintable_widget, GWidget* parent) auto color_container = GWidget::construct(this); color_container->set_relative_rect(m_secondary_color_widget->relative_rect().right() + 2, 2, 500, 32); - color_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + color_container->set_layout(make<GVBoxLayout>()); color_container->layout()->set_spacing(1); auto top_color_container = GWidget::construct(color_container.ptr()); - top_color_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + top_color_container->set_layout(make<GHBoxLayout>()); top_color_container->layout()->set_spacing(1); auto bottom_color_container = GWidget::construct(color_container.ptr()); - bottom_color_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + bottom_color_container->set_layout(make<GHBoxLayout>()); bottom_color_container->layout()->set_spacing(1); auto add_color_widget = [&](GWidget* container, Color color) { diff --git a/Applications/PaintBrush/ToolboxWidget.cpp b/Applications/PaintBrush/ToolboxWidget.cpp index d66b42ccc2..94d1e607ad 100644 --- a/Applications/PaintBrush/ToolboxWidget.cpp +++ b/Applications/PaintBrush/ToolboxWidget.cpp @@ -73,7 +73,7 @@ ToolboxWidget::ToolboxWidget(GWidget* parent) set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); set_preferred_size(48, 0); - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_margins({ 4, 4, 4, 4 }); auto add_tool = [&](const StringView& name, const StringView& icon_name, OwnPtr<Tool>&& tool) { diff --git a/Applications/PaintBrush/main.cpp b/Applications/PaintBrush/main.cpp index d7719dd48f..20ed47eca4 100644 --- a/Applications/PaintBrush/main.cpp +++ b/Applications/PaintBrush/main.cpp @@ -60,13 +60,13 @@ int main(int argc, char** argv) auto horizontal_container = GWidget::construct(); window->set_main_widget(horizontal_container); - horizontal_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + horizontal_container->set_layout(make<GHBoxLayout>()); horizontal_container->layout()->set_spacing(0); new ToolboxWidget(horizontal_container); auto vertical_container = GWidget::construct(horizontal_container.ptr()); - vertical_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + vertical_container->set_layout(make<GVBoxLayout>()); vertical_container->layout()->set_spacing(0); auto paintable_widget = PaintableWidget::construct(vertical_container); diff --git a/Applications/Piano/KnobsWidget.cpp b/Applications/Piano/KnobsWidget.cpp index 0a55467b5f..6130545241 100644 --- a/Applications/Piano/KnobsWidget.cpp +++ b/Applications/Piano/KnobsWidget.cpp @@ -40,11 +40,11 @@ KnobsWidget::KnobsWidget(GWidget* parent, AudioEngine& audio_engine, MainWidget& set_frame_thickness(2); set_frame_shadow(FrameShadow::Sunken); set_frame_shape(FrameShape::Container); - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); set_fill_with_background_color(true); m_labels_container = GWidget::construct(this); - m_labels_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + m_labels_container->set_layout(make<GHBoxLayout>()); m_labels_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); m_labels_container->set_preferred_size(0, 20); @@ -54,7 +54,7 @@ KnobsWidget::KnobsWidget(GWidget* parent, AudioEngine& audio_engine, MainWidget& m_delay_label = GLabel::construct("Delay", m_labels_container); m_values_container = GWidget::construct(this); - m_values_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + m_values_container->set_layout(make<GHBoxLayout>()); m_values_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); m_values_container->set_preferred_size(0, 10); @@ -64,7 +64,7 @@ KnobsWidget::KnobsWidget(GWidget* parent, AudioEngine& audio_engine, MainWidget& m_delay_value = GLabel::construct(String::number(m_audio_engine.delay() / m_audio_engine.tick()), m_values_container); m_knobs_container = GWidget::construct(this); - m_knobs_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + m_knobs_container->set_layout(make<GHBoxLayout>()); // FIXME: Implement vertical flipping in GSlider, not here. diff --git a/Applications/Piano/MainWidget.cpp b/Applications/Piano/MainWidget.cpp index 5a8c006ae7..044992a43e 100644 --- a/Applications/Piano/MainWidget.cpp +++ b/Applications/Piano/MainWidget.cpp @@ -36,7 +36,7 @@ MainWidget::MainWidget(AudioEngine& audio_engine) : m_audio_engine(audio_engine) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_spacing(2); layout()->set_margins({ 2, 2, 2, 2 }); set_fill_with_background_color(true); @@ -50,7 +50,7 @@ MainWidget::MainWidget(AudioEngine& audio_engine) m_roll_widget->set_preferred_size(0, 300); m_keys_and_knobs_container = GWidget::construct(this); - m_keys_and_knobs_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + m_keys_and_knobs_container->set_layout(make<GHBoxLayout>()); m_keys_and_knobs_container->layout()->set_spacing(2); m_keys_and_knobs_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); m_keys_and_knobs_container->set_preferred_size(0, 100); diff --git a/Applications/SoundPlayer/SoundPlayerWidget.cpp b/Applications/SoundPlayer/SoundPlayerWidget.cpp index 8640116af2..6709411bed 100644 --- a/Applications/SoundPlayer/SoundPlayerWidget.cpp +++ b/Applications/SoundPlayer/SoundPlayerWidget.cpp @@ -38,12 +38,12 @@ SoundPlayerWidget::SoundPlayerWidget(GWindow& window, NonnullRefPtr<AClientConne , m_manager(connection) { set_fill_with_background_color(true); - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_margins({ 2, 2, 2, 2 }); auto status_widget = GWidget::construct(this); status_widget->set_fill_with_background_color(true); - status_widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + status_widget->set_layout(make<GHBoxLayout>()); m_elapsed = GLabel::construct(status_widget); m_elapsed->set_frame_shape(FrameShape::Container); @@ -53,7 +53,7 @@ SoundPlayerWidget::SoundPlayerWidget(GWindow& window, NonnullRefPtr<AClientConne m_elapsed->set_preferred_size(80, 0); auto sample_widget_container = GWidget::construct(status_widget.ptr()); - sample_widget_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + sample_widget_container->set_layout(make<GHBoxLayout>()); sample_widget_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fill); m_sample_widget = SampleWidget::construct(sample_widget_container); @@ -72,7 +72,7 @@ SoundPlayerWidget::SoundPlayerWidget(GWindow& window, NonnullRefPtr<AClientConne auto control_widget = GWidget::construct(this); control_widget->set_fill_with_background_color(true); - control_widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + control_widget->set_layout(make<GHBoxLayout>()); control_widget->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); control_widget->set_preferred_size(0, 30); control_widget->layout()->set_margins({ 10, 2, 10, 2 }); diff --git a/Applications/SystemMonitor/MemoryStatsWidget.cpp b/Applications/SystemMonitor/MemoryStatsWidget.cpp index 350a7aea8d..696c88ed59 100644 --- a/Applications/SystemMonitor/MemoryStatsWidget.cpp +++ b/Applications/SystemMonitor/MemoryStatsWidget.cpp @@ -52,13 +52,13 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph, GWidget* parent) set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); set_preferred_size(0, 72); - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_margins({ 0, 8, 0, 0 }); layout()->set_spacing(3); auto build_widgets_for_label = [this](const String& description) -> RefPtr<GLabel> { auto container = GWidget::construct(this); - container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + container->set_layout(make<GHBoxLayout>()); container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); container->set_preferred_size(275, 12); auto description_label = GLabel::construct(description, container); diff --git a/Applications/SystemMonitor/NetworkStatisticsWidget.cpp b/Applications/SystemMonitor/NetworkStatisticsWidget.cpp index aeece6395a..8e269b3c44 100644 --- a/Applications/SystemMonitor/NetworkStatisticsWidget.cpp +++ b/Applications/SystemMonitor/NetworkStatisticsWidget.cpp @@ -34,12 +34,12 @@ NetworkStatisticsWidget::NetworkStatisticsWidget(GWidget* parent) : GLazyWidget(parent) { on_first_show = [this](auto&) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_margins({ 4, 4, 4, 4 }); set_fill_with_background_color(true); auto adapters_group_box = GGroupBox::construct("Adapters", this); - adapters_group_box->set_layout(make<GBoxLayout>(Orientation::Vertical)); + adapters_group_box->set_layout(make<GVBoxLayout>()); adapters_group_box->layout()->set_margins({ 6, 16, 6, 6 }); adapters_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); adapters_group_box->set_preferred_size(0, 120); @@ -59,7 +59,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget(GWidget* parent) m_adapter_table_view->set_model(GJsonArrayModel::create("/proc/net/adapters", move(net_adapters_fields))); auto sockets_group_box = GGroupBox::construct("Sockets", this); - sockets_group_box->set_layout(make<GBoxLayout>(Orientation::Vertical)); + sockets_group_box->set_layout(make<GVBoxLayout>()); sockets_group_box->layout()->set_margins({ 6, 16, 6, 6 }); sockets_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fill); sockets_group_box->set_preferred_size(0, 0); diff --git a/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp b/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp index a4ec79fd08..9f4e68913d 100644 --- a/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp +++ b/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp @@ -32,7 +32,7 @@ ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget(GWidget* parent) : GWidget(parent) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_margins({ 4, 4, 4, 4 }); m_table_view = GTableView::construct(this); m_table_view->set_size_columns_to_fit_content(true); diff --git a/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp b/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp index a8b3f02aa9..fe431b66b3 100644 --- a/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp +++ b/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp @@ -34,7 +34,7 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget(GWidget* parent) : GWidget(parent) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_margins({ 4, 4, 4, 4 }); m_table_view = GTableView::construct(this); m_table_view->set_size_columns_to_fit_content(true); diff --git a/Applications/SystemMonitor/ProcessStacksWidget.cpp b/Applications/SystemMonitor/ProcessStacksWidget.cpp index 795fa9efa3..637a252205 100644 --- a/Applications/SystemMonitor/ProcessStacksWidget.cpp +++ b/Applications/SystemMonitor/ProcessStacksWidget.cpp @@ -32,7 +32,7 @@ ProcessStacksWidget::ProcessStacksWidget(GWidget* parent) : GWidget(parent) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_margins({ 4, 4, 4, 4 }); m_stacks_editor = GTextEditor::construct(GTextEditor::Type::MultiLine, this); m_stacks_editor->set_readonly(true); diff --git a/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp b/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp index 174e753469..bf6acabfc2 100644 --- a/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp +++ b/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp @@ -32,7 +32,7 @@ ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget(GWidget* parent) : GWidget(parent) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_margins({ 4, 4, 4, 4 }); m_table_view = GTableView::construct(this); m_table_view->set_size_columns_to_fit_content(true); diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp index 726788a2fd..c300083a14 100644 --- a/Applications/SystemMonitor/main.cpp +++ b/Applications/SystemMonitor/main.cpp @@ -116,7 +116,7 @@ int main(int argc, char** argv) auto keeper = GWidget::construct(); window->set_main_widget(keeper); - keeper->set_layout(make<GBoxLayout>(Orientation::Vertical)); + keeper->set_layout(make<GVBoxLayout>()); keeper->set_fill_with_background_color(true); keeper->layout()->set_margins({ 4, 4, 4, 4 }); @@ -138,7 +138,7 @@ int main(int argc, char** argv) auto network_stats_widget = NetworkStatisticsWidget::construct(nullptr); tabwidget->add_widget("Network", network_stats_widget); - process_table_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + process_table_container->set_layout(make<GVBoxLayout>()); process_table_container->layout()->set_margins({ 4, 0, 4, 4 }); process_table_container->layout()->set_spacing(0); @@ -279,7 +279,7 @@ RefPtr<GWidget> build_file_systems_tab() auto fs_widget = GLazyWidget::construct(); fs_widget->on_first_show = [](auto& self) { - self.set_layout(make<GBoxLayout>(Orientation::Vertical)); + self.set_layout(make<GVBoxLayout>()); self.layout()->set_margins({ 4, 4, 4, 4 }); auto fs_table_view = GTableView::construct(&self); fs_table_view->set_size_columns_to_fit_content(true); @@ -368,7 +368,7 @@ RefPtr<GWidget> build_pci_devices_tab() auto pci_widget = GLazyWidget::construct(); pci_widget->on_first_show = [](auto& self) { - self.set_layout(make<GBoxLayout>(Orientation::Vertical)); + self.set_layout(make<GVBoxLayout>()); self.layout()->set_margins({ 4, 4, 4, 4 }); auto pci_table_view = GTableView::construct(&self); pci_table_view->set_size_columns_to_fit_content(true); @@ -426,7 +426,7 @@ RefPtr<GWidget> build_devices_tab() auto devices_widget = GLazyWidget::construct(); devices_widget->on_first_show = [](auto& self) { - self.set_layout(make<GBoxLayout>(Orientation::Vertical)); + self.set_layout(make<GVBoxLayout>()); self.layout()->set_margins({ 4, 4, 4, 4 }); auto devices_table_view = GTableView::construct(&self); @@ -445,11 +445,11 @@ NonnullRefPtr<GWidget> build_graphs_tab() graphs_container->on_first_show = [](auto& self) { self.set_fill_with_background_color(true); self.set_background_role(ColorRole::Button); - self.set_layout(make<GBoxLayout>(Orientation::Vertical)); + self.set_layout(make<GVBoxLayout>()); self.layout()->set_margins({ 4, 4, 4, 4 }); auto cpu_graph_group_box = GGroupBox::construct("CPU usage", &self); - cpu_graph_group_box->set_layout(make<GBoxLayout>(Orientation::Vertical)); + cpu_graph_group_box->set_layout(make<GVBoxLayout>()); cpu_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 }); cpu_graph_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); cpu_graph_group_box->set_preferred_size(0, 120); @@ -466,7 +466,7 @@ NonnullRefPtr<GWidget> build_graphs_tab() }; auto memory_graph_group_box = GGroupBox::construct("Memory usage", &self); - memory_graph_group_box->set_layout(make<GBoxLayout>(Orientation::Vertical)); + memory_graph_group_box->set_layout(make<GVBoxLayout>()); memory_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 }); memory_graph_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); memory_graph_group_box->set_preferred_size(0, 120); diff --git a/Applications/Taskbar/TaskbarWindow.cpp b/Applications/Taskbar/TaskbarWindow.cpp index e755182a4e..558770f732 100644 --- a/Applications/Taskbar/TaskbarWindow.cpp +++ b/Applications/Taskbar/TaskbarWindow.cpp @@ -48,7 +48,7 @@ TaskbarWindow::TaskbarWindow() auto widget = GFrame::construct(); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + widget->set_layout(make<GHBoxLayout>()); widget->layout()->set_margins({ 3, 2, 3, 2 }); widget->layout()->set_spacing(3); widget->set_frame_thickness(1); @@ -71,7 +71,7 @@ void TaskbarWindow::create_quick_launch_bar() { auto quick_launch_bar = GFrame::construct(main_widget()); quick_launch_bar->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); - quick_launch_bar->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + quick_launch_bar->set_layout(make<GHBoxLayout>()); quick_launch_bar->layout()->set_spacing(3); quick_launch_bar->layout()->set_margins({ 3, 0, 3, 0 }); quick_launch_bar->set_frame_thickness(1); diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index d45a83da8f..ba450e5c89 100644 --- a/Applications/Terminal/main.cpp +++ b/Applications/Terminal/main.cpp @@ -135,11 +135,11 @@ RefPtr<GWindow> create_settings_window(TerminalWidget& terminal, RefPtr<CConfigF window->set_main_widget(settings); settings->set_fill_with_background_color(true); settings->set_background_role(ColorRole::Button); - settings->set_layout(make<GBoxLayout>(Orientation::Vertical)); + settings->set_layout(make<GVBoxLayout>()); settings->layout()->set_margins({ 4, 4, 4, 4 }); auto radio_container = GGroupBox::construct("Bell Mode", settings); - radio_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + radio_container->set_layout(make<GVBoxLayout>()); radio_container->layout()->set_margins({ 6, 16, 6, 6 }); radio_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); radio_container->set_preferred_size(100, 70); @@ -153,7 +153,7 @@ RefPtr<GWindow> create_settings_window(TerminalWidget& terminal, RefPtr<CConfigF }; auto slider_container = GGroupBox::construct("Background Opacity", settings); - slider_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + slider_container->set_layout(make<GVBoxLayout>()); slider_container->layout()->set_margins({ 6, 16, 6, 6 }); slider_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); slider_container->set_preferred_size(100, 50); diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp index fd53e7c3cc..c1538f60de 100644 --- a/Applications/TextEditor/TextEditorWidget.cpp +++ b/Applications/TextEditor/TextEditorWidget.cpp @@ -45,7 +45,7 @@ TextEditorWidget::TextEditorWidget() { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); layout()->set_spacing(0); auto toolbar = GToolBar::construct(this); @@ -71,7 +71,7 @@ TextEditorWidget::TextEditorWidget() m_find_replace_widget->set_fill_with_background_color(true); m_find_replace_widget->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); m_find_replace_widget->set_preferred_size(0, 48); - m_find_replace_widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + m_find_replace_widget->set_layout(make<GVBoxLayout>()); m_find_replace_widget->layout()->set_margins({ 2, 2, 2, 4 }); m_find_replace_widget->set_visible(false); @@ -79,14 +79,14 @@ TextEditorWidget::TextEditorWidget() m_find_widget->set_fill_with_background_color(true); m_find_widget->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); m_find_widget->set_preferred_size(0, 22); - m_find_widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + m_find_widget->set_layout(make<GHBoxLayout>()); m_find_widget->set_visible(false); m_replace_widget = GWidget::construct(m_find_replace_widget); m_replace_widget->set_fill_with_background_color(true); m_replace_widget->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); m_replace_widget->set_preferred_size(0, 22); - m_replace_widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + m_replace_widget->set_layout(make<GHBoxLayout>()); m_replace_widget->set_visible(false); m_find_textbox = GTextBox::construct(m_find_widget); diff --git a/Applications/Welcome/main.cpp b/Applications/Welcome/main.cpp index 129dca173c..3f909a8ab2 100644 --- a/Applications/Welcome/main.cpp +++ b/Applications/Welcome/main.cpp @@ -98,7 +98,7 @@ int main(int argc, char** argv) auto background = GLabel::construct(); window->set_main_widget(background); background->set_fill_with_background_color(true); - background->set_layout(make<GBoxLayout>(Orientation::Vertical)); + background->set_layout(make<GVBoxLayout>()); background->layout()->set_margins({ 8, 8, 8, 8 }); background->layout()->set_spacing(8); background->set_icon(load_png_from_memory((const u8*)&_binary_background_png_start, (size_t)&_binary_background_png_size)); @@ -121,13 +121,13 @@ int main(int argc, char** argv) // auto main_section = GWidget::construct(background.ptr()); - main_section->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + main_section->set_layout(make<GHBoxLayout>()); main_section->layout()->set_margins({ 0, 0, 0, 0 }); main_section->layout()->set_spacing(8); main_section->set_size_policy(SizePolicy::Fill, SizePolicy::Fill); auto menu = GWidget::construct(main_section.ptr()); - menu->set_layout(make<GBoxLayout>(Orientation::Vertical)); + menu->set_layout(make<GVBoxLayout>()); menu->layout()->set_margins({ 0, 0, 0, 0 }); menu->layout()->set_spacing(8); menu->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); @@ -138,7 +138,7 @@ int main(int argc, char** argv) for (auto& page : pages) { auto content = GWidget::construct(stack.ptr()); - content->set_layout(make<GBoxLayout>(Orientation::Vertical)); + content->set_layout(make<GVBoxLayout>()); content->layout()->set_margins({ 0, 0, 0, 0 }); content->layout()->set_spacing(8); content->set_size_policy(SizePolicy::Fill, SizePolicy::Fill); diff --git a/Demos/HelloWorld/main.cpp b/Demos/HelloWorld/main.cpp index 84f47ff944..84b8d460f9 100644 --- a/Demos/HelloWorld/main.cpp +++ b/Demos/HelloWorld/main.cpp @@ -43,7 +43,7 @@ int main(int argc, char** argv) window->set_main_widget(main_widget); main_widget->set_fill_with_background_color(true); main_widget->set_background_color(Color::White); - main_widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + main_widget->set_layout(make<GVBoxLayout>()); main_widget->layout()->set_margins({ 4, 4, 4, 4 }); auto label = GLabel::construct(main_widget); diff --git a/Demos/WidgetGallery/main.cpp b/Demos/WidgetGallery/main.cpp index b4dd1bcb95..a04a57daa9 100644 --- a/Demos/WidgetGallery/main.cpp +++ b/Demos/WidgetGallery/main.cpp @@ -51,7 +51,7 @@ int main(int argc, char** argv) auto main_widget = GWidget::construct(); window->set_main_widget(main_widget); main_widget->set_fill_with_background_color(true); - main_widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + main_widget->set_layout(make<GVBoxLayout>()); main_widget->layout()->set_margins({ 4, 4, 4, 4 }); auto checkbox1 = GCheckBox::construct("GCheckBox 1", main_widget); @@ -95,7 +95,7 @@ int main(int argc, char** argv) auto vertical_slider_container = GWidget::construct(main_widget.ptr()); vertical_slider_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); vertical_slider_container->set_preferred_size(0, 100); - vertical_slider_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + vertical_slider_container->set_layout(make<GHBoxLayout>()); auto vslider1 = GSlider::construct(Orientation::Vertical, vertical_slider_container); (void)vslider1; auto vslider2 = GSlider::construct(Orientation::Vertical, vertical_slider_container); diff --git a/DevTools/HackStudio/EditorWrapper.cpp b/DevTools/HackStudio/EditorWrapper.cpp index 5bdd140dd6..c9c920c27e 100644 --- a/DevTools/HackStudio/EditorWrapper.cpp +++ b/DevTools/HackStudio/EditorWrapper.cpp @@ -36,13 +36,13 @@ extern RefPtr<EditorWrapper> g_current_editor_wrapper; EditorWrapper::EditorWrapper(GWidget* parent) : GWidget(parent) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); auto label_wrapper = GWidget::construct(this); label_wrapper->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); label_wrapper->set_preferred_size(0, 14); label_wrapper->set_fill_with_background_color(true); - label_wrapper->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + label_wrapper->set_layout(make<GHBoxLayout>()); label_wrapper->layout()->set_margins({ 2, 0, 2, 0 }); m_filename_label = GLabel::construct("(Untitled)", label_wrapper); diff --git a/DevTools/HackStudio/FindInFilesWidget.cpp b/DevTools/HackStudio/FindInFilesWidget.cpp index e41893f1fa..1c70410f00 100644 --- a/DevTools/HackStudio/FindInFilesWidget.cpp +++ b/DevTools/HackStudio/FindInFilesWidget.cpp @@ -130,7 +130,7 @@ static RefPtr<SearchResultsModel> find_in_files(const StringView& text) FindInFilesWidget::FindInFilesWidget(GWidget* parent) : GWidget(parent) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); m_textbox = GTextBox::construct(this); m_textbox->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); m_textbox->set_preferred_size(0, 20); diff --git a/DevTools/HackStudio/Locator.cpp b/DevTools/HackStudio/Locator.cpp index 7a57f78077..888425c80a 100644 --- a/DevTools/HackStudio/Locator.cpp +++ b/DevTools/HackStudio/Locator.cpp @@ -107,7 +107,7 @@ Locator::Locator(GWidget* parent) s_header_icon = GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-header.png"); } - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); set_preferred_size(0, 20); m_textbox = LocatorTextBox::construct(this); diff --git a/DevTools/HackStudio/ProcessStateWidget.cpp b/DevTools/HackStudio/ProcessStateWidget.cpp index ad82e1a9a9..00dd7172e7 100644 --- a/DevTools/HackStudio/ProcessStateWidget.cpp +++ b/DevTools/HackStudio/ProcessStateWidget.cpp @@ -38,7 +38,7 @@ ProcessStateWidget::ProcessStateWidget(GWidget* parent) set_preferred_size(0, 20); set_visible(false); - set_layout(make<GBoxLayout>(Orientation::Horizontal)); + set_layout(make<GHBoxLayout>()); auto pid_label_label = GLabel::construct("Process:", this); pid_label_label->set_font(Font::default_bold_font()); diff --git a/DevTools/HackStudio/TerminalWrapper.cpp b/DevTools/HackStudio/TerminalWrapper.cpp index 9b12508851..1b43870aa9 100644 --- a/DevTools/HackStudio/TerminalWrapper.cpp +++ b/DevTools/HackStudio/TerminalWrapper.cpp @@ -161,7 +161,7 @@ void TerminalWrapper::kill_running_command() TerminalWrapper::TerminalWrapper(GWidget* parent) : GWidget(parent) { - set_layout(make<GBoxLayout>(Orientation::Vertical)); + set_layout(make<GVBoxLayout>()); RefPtr<CConfigFile> config = CConfigFile::get_for_app("Terminal"); m_terminal_widget = TerminalWidget::construct(-1, false, config); diff --git a/DevTools/HackStudio/main.cpp b/DevTools/HackStudio/main.cpp index 53b85b3fc4..55b0ddfc44 100644 --- a/DevTools/HackStudio/main.cpp +++ b/DevTools/HackStudio/main.cpp @@ -145,7 +145,7 @@ int main(int argc, char** argv) g_window->set_main_widget(widget); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->layout()->set_spacing(0); StringBuilder path; @@ -266,7 +266,7 @@ int main(int argc, char** argv) g_right_hand_stack = GStackWidget::construct(outer_splitter); g_form_inner_container = GWidget::construct(g_right_hand_stack); - g_form_inner_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + g_form_inner_container->set_layout(make<GHBoxLayout>()); auto form_widgets_toolbar = GToolBar::construct(Orientation::Vertical, 26, g_form_inner_container); form_widgets_toolbar->set_preferred_size(38, 0); @@ -303,11 +303,11 @@ int main(int argc, char** argv) auto form_editing_pane_container = GSplitter::construct(Orientation::Vertical, form_editor_inner_splitter); form_editing_pane_container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); form_editing_pane_container->set_preferred_size(190, 0); - form_editing_pane_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + form_editing_pane_container->set_layout(make<GVBoxLayout>()); auto add_properties_pane = [&](auto& text, auto pane_widget) { auto wrapper = GWidget::construct(form_editing_pane_container.ptr()); - wrapper->set_layout(make<GBoxLayout>(Orientation::Vertical)); + wrapper->set_layout(make<GVBoxLayout>()); auto label = GLabel::construct(text, wrapper); label->set_fill_with_background_color(true); label->set_text_alignment(TextAlignment::CenterLeft); diff --git a/DevTools/Inspector/main.cpp b/DevTools/Inspector/main.cpp index 66e350ac1a..99548c5724 100644 --- a/DevTools/Inspector/main.cpp +++ b/DevTools/Inspector/main.cpp @@ -61,7 +61,7 @@ int main(int argc, char** argv) auto widget = GWidget::construct(); window->set_main_widget(widget); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); auto splitter = GSplitter::construct(Orientation::Horizontal, widget); diff --git a/DevTools/ProfileViewer/main.cpp b/DevTools/ProfileViewer/main.cpp index 4912cce5a7..dc3aaf8bf1 100644 --- a/DevTools/ProfileViewer/main.cpp +++ b/DevTools/ProfileViewer/main.cpp @@ -59,7 +59,7 @@ int main(int argc, char** argv) auto main_widget = GWidget::construct(); window->set_main_widget(main_widget); main_widget->set_fill_with_background_color(true); - main_widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + main_widget->set_layout(make<GVBoxLayout>()); auto timeline_widget = ProfileTimelineWidget::construct(*profile, main_widget); diff --git a/DevTools/VisualBuilder/VBForm.cpp b/DevTools/VisualBuilder/VBForm.cpp index cb844cfa9f..e829840f1d 100644 --- a/DevTools/VisualBuilder/VBForm.cpp +++ b/DevTools/VisualBuilder/VBForm.cpp @@ -66,13 +66,13 @@ VBForm::VBForm(const String& name, GWidget* parent) m_context_menu->add_action(GAction::create("Lay out horizontally", load_png("/res/icons/16x16/layout-horizontally.png"), [this](auto&) { if (auto* widget = single_selected_widget()) { dbg() << "Giving " << *widget->gwidget() << " a horizontal box layout"; - widget->gwidget()->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + widget->gwidget()->set_layout(make<GHBoxLayout>()); } })); m_context_menu->add_action(GAction::create("Lay out vertically", load_png("/res/icons/16x16/layout-vertically.png"), [this](auto&) { if (auto* widget = single_selected_widget()) { dbg() << "Giving " << *widget->gwidget() << " a vertical box layout"; - widget->gwidget()->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->gwidget()->set_layout(make<GVBoxLayout>()); } })); m_context_menu->add_separator(); diff --git a/DevTools/VisualBuilder/VBPropertiesWindow.cpp b/DevTools/VisualBuilder/VBPropertiesWindow.cpp index 6965e31b38..08da65f082 100644 --- a/DevTools/VisualBuilder/VBPropertiesWindow.cpp +++ b/DevTools/VisualBuilder/VBPropertiesWindow.cpp @@ -83,7 +83,7 @@ VBPropertiesWindow::VBPropertiesWindow() auto widget = GWidget::construct(); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->layout()->set_margins({ 2, 2, 2, 2 }); set_main_widget(widget); diff --git a/DevTools/VisualBuilder/main.cpp b/DevTools/VisualBuilder/main.cpp index 4f26773a98..fc971c2189 100644 --- a/DevTools/VisualBuilder/main.cpp +++ b/DevTools/VisualBuilder/main.cpp @@ -108,7 +108,7 @@ RefPtr<GWindow> make_toolbox_window() auto widget = GWidget::construct(); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->layout()->set_spacing(0); window->set_main_widget(widget); diff --git a/Games/Minesweeper/main.cpp b/Games/Minesweeper/main.cpp index 50c1acfc18..1a1dd29b5f 100644 --- a/Games/Minesweeper/main.cpp +++ b/Games/Minesweeper/main.cpp @@ -60,14 +60,14 @@ int main(int argc, char** argv) auto widget = GWidget::construct(); window->set_main_widget(widget); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->layout()->set_spacing(0); auto container = GWidget::construct(widget.ptr()); container->set_fill_with_background_color(true); container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); container->set_preferred_size(0, 36); - container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + container->set_layout(make<GHBoxLayout>()); auto flag_icon_label = GLabel::construct(container); flag_icon_label->set_icon(GraphicsBitmap::load_from_file("/res/icons/minesweeper/flag.png")); auto flag_label = GLabel::construct(container); diff --git a/Libraries/LibGUI/GAboutDialog.cpp b/Libraries/LibGUI/GAboutDialog.cpp index c37684192a..37878d5e3c 100644 --- a/Libraries/LibGUI/GAboutDialog.cpp +++ b/Libraries/LibGUI/GAboutDialog.cpp @@ -42,12 +42,12 @@ GAboutDialog::GAboutDialog(const StringView& name, const GraphicsBitmap* icon, C auto widget = GWidget::construct(); set_main_widget(widget); widget->set_fill_with_background_color(true); - widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + widget->set_layout(make<GHBoxLayout>()); auto left_container = GWidget::construct(widget.ptr()); left_container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); left_container->set_preferred_size(48, 0); - left_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + left_container->set_layout(make<GVBoxLayout>()); auto icon_label = GLabel::construct(left_container); icon_label->set_icon(m_icon); icon_label->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); @@ -55,7 +55,7 @@ GAboutDialog::GAboutDialog(const StringView& name, const GraphicsBitmap* icon, C left_container->layout()->add_spacer(); auto right_container = GWidget::construct(widget.ptr()); - right_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + right_container->set_layout(make<GVBoxLayout>()); right_container->layout()->set_margins({ 0, 4, 4, 4 }); auto make_label = [&](const StringView& text, bool bold = false) { @@ -75,7 +75,7 @@ GAboutDialog::GAboutDialog(const StringView& name, const GraphicsBitmap* icon, C auto button_container = GWidget::construct(right_container.ptr()); button_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); button_container->set_preferred_size(0, 20); - button_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + button_container->set_layout(make<GHBoxLayout>()); button_container->layout()->add_spacer(); auto ok_button = GButton::construct("OK", button_container); ok_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); diff --git a/Libraries/LibGUI/GBoxLayout.cpp b/Libraries/LibGUI/GBoxLayout.cpp index 9192f2030b..c803f47e58 100644 --- a/Libraries/LibGUI/GBoxLayout.cpp +++ b/Libraries/LibGUI/GBoxLayout.cpp @@ -35,10 +35,6 @@ GBoxLayout::GBoxLayout(Orientation orientation) { } -GBoxLayout::~GBoxLayout() -{ -} - void GBoxLayout::run(GWidget& widget) { bool should_log = false; diff --git a/Libraries/LibGUI/GBoxLayout.h b/Libraries/LibGUI/GBoxLayout.h index e68bb9ee17..26998b685d 100644 --- a/Libraries/LibGUI/GBoxLayout.h +++ b/Libraries/LibGUI/GBoxLayout.h @@ -29,10 +29,10 @@ #include <LibGUI/GLayout.h> #include <LibGUI/GWidget.h> -class GBoxLayout final : public GLayout { +class GBoxLayout : public GLayout { public: explicit GBoxLayout(Orientation); - virtual ~GBoxLayout() override; + virtual ~GBoxLayout() override {} Orientation orientation() const { return m_orientation; } @@ -41,3 +41,21 @@ public: private: Orientation m_orientation; }; + +class GVBoxLayout final : public GBoxLayout { +public: + explicit GVBoxLayout() + : GBoxLayout(Orientation::Vertical) + { + } + virtual ~GVBoxLayout() override {} +}; + +class GHBoxLayout final : public GBoxLayout { +public: + explicit GHBoxLayout() + : GBoxLayout(Orientation::Horizontal) + { + } + virtual ~GHBoxLayout() override {} +}; diff --git a/Libraries/LibGUI/GColorPicker.cpp b/Libraries/LibGUI/GColorPicker.cpp index bbb80728be..50318b97be 100644 --- a/Libraries/LibGUI/GColorPicker.cpp +++ b/Libraries/LibGUI/GColorPicker.cpp @@ -47,15 +47,15 @@ void GColorPicker::build() { auto horizontal_container = GWidget::construct(); horizontal_container->set_fill_with_background_color(true); - horizontal_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + horizontal_container->set_layout(make<GHBoxLayout>()); horizontal_container->layout()->set_margins({ 4, 4, 4, 4 }); set_main_widget(horizontal_container); auto left_vertical_container = GWidget::construct(horizontal_container.ptr()); - left_vertical_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + left_vertical_container->set_layout(make<GVBoxLayout>()); auto right_vertical_container = GWidget::construct(horizontal_container.ptr()); - right_vertical_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + right_vertical_container->set_layout(make<GVBoxLayout>()); enum RGBComponent { Red, diff --git a/Libraries/LibGUI/GFilePicker.cpp b/Libraries/LibGUI/GFilePicker.cpp index 971302d857..ab4a538da0 100644 --- a/Libraries/LibGUI/GFilePicker.cpp +++ b/Libraries/LibGUI/GFilePicker.cpp @@ -81,16 +81,16 @@ GFilePicker::GFilePicker(Mode mode, const StringView& file_name, const StringVie set_rect(200, 200, 700, 400); auto horizontal_container = GWidget::construct(); set_main_widget(horizontal_container); - horizontal_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + horizontal_container->set_layout(make<GHBoxLayout>()); horizontal_container->layout()->set_margins({ 4, 4, 4, 4 }); horizontal_container->set_fill_with_background_color(true); auto vertical_container = GWidget::construct(horizontal_container.ptr()); - vertical_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + vertical_container->set_layout(make<GVBoxLayout>()); vertical_container->layout()->set_spacing(4); auto upper_container = GWidget::construct(vertical_container.ptr()); - upper_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + upper_container->set_layout(make<GHBoxLayout>()); upper_container->layout()->set_spacing(4); upper_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); upper_container->set_preferred_size(0, 26); @@ -148,7 +148,7 @@ GFilePicker::GFilePicker(Mode mode, const StringView& file_name, const StringVie toolbar->add_action(*mkdir_action); auto lower_container = GWidget::construct(vertical_container.ptr()); - lower_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + lower_container->set_layout(make<GVBoxLayout>()); lower_container->layout()->set_spacing(4); lower_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); lower_container->set_preferred_size(0, 60); @@ -156,7 +156,7 @@ GFilePicker::GFilePicker(Mode mode, const StringView& file_name, const StringVie auto filename_container = GWidget::construct(lower_container.ptr()); filename_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); filename_container->set_preferred_size(0, 20); - filename_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + filename_container->set_layout(make<GHBoxLayout>()); auto filename_label = GLabel::construct("File name:", filename_container); filename_label->set_text_alignment(TextAlignment::CenterLeft); filename_label->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); @@ -187,7 +187,7 @@ GFilePicker::GFilePicker(Mode mode, const StringView& file_name, const StringVie auto button_container = GWidget::construct(lower_container.ptr()); button_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); button_container->set_preferred_size(0, 20); - button_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + button_container->set_layout(make<GHBoxLayout>()); button_container->layout()->set_spacing(4); button_container->layout()->add_spacer(); @@ -227,7 +227,7 @@ GFilePicker::GFilePicker(Mode mode, const StringView& file_name, const StringVie preview_container->set_frame_shape(FrameShape::Container); preview_container->set_frame_shadow(FrameShadow::Sunken); preview_container->set_frame_thickness(2); - preview_container->set_layout(make<GBoxLayout>(Orientation::Vertical)); + preview_container->set_layout(make<GVBoxLayout>()); preview_container->layout()->set_margins({ 8, 8, 8, 8 }); m_preview_image_label = GLabel::construct(preview_container); diff --git a/Libraries/LibGUI/GInputBox.cpp b/Libraries/LibGUI/GInputBox.cpp index e583912bdd..e43e4d0dac 100644 --- a/Libraries/LibGUI/GInputBox.cpp +++ b/Libraries/LibGUI/GInputBox.cpp @@ -54,7 +54,7 @@ void GInputBox::build() set_rect(x(), y(), max_width + 80, 80); - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->set_fill_with_background_color(true); widget->layout()->set_margins({ 8, 8, 8, 8 }); @@ -71,10 +71,10 @@ void GInputBox::build() auto button_container_outer = GWidget::construct(widget.ptr()); button_container_outer->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); button_container_outer->set_preferred_size(0, 20); - button_container_outer->set_layout(make<GBoxLayout>(Orientation::Vertical)); + button_container_outer->set_layout(make<GVBoxLayout>()); auto button_container_inner = GWidget::construct(button_container_outer.ptr()); - button_container_inner->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + button_container_inner->set_layout(make<GHBoxLayout>()); button_container_inner->layout()->set_spacing(8); m_cancel_button = GButton::construct(button_container_inner); diff --git a/Libraries/LibGUI/GMessageBox.cpp b/Libraries/LibGUI/GMessageBox.cpp index 8ded7f26b7..9a38040fa7 100644 --- a/Libraries/LibGUI/GMessageBox.cpp +++ b/Libraries/LibGUI/GMessageBox.cpp @@ -82,7 +82,7 @@ void GMessageBox::build() int text_width = widget->font().width(m_text); int icon_width = 0; - widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); + widget->set_layout(make<GVBoxLayout>()); widget->set_fill_with_background_color(true); widget->layout()->set_margins({ 0, 15, 0, 15 }); @@ -91,7 +91,7 @@ void GMessageBox::build() RefPtr<GWidget> message_container = widget; if (m_type != Type::None) { message_container = GWidget::construct(widget.ptr()); - message_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + message_container->set_layout(make<GHBoxLayout>()); message_container->layout()->set_margins({ 8, 0, 8, 0 }); message_container->layout()->set_spacing(8); @@ -107,7 +107,7 @@ void GMessageBox::build() label->set_preferred_size(text_width, 16); auto button_container = GWidget::construct(widget.ptr()); - button_container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); + button_container->set_layout(make<GHBoxLayout>()); button_container->layout()->set_spacing(5); button_container->layout()->set_margins({ 15, 0, 15, 0 }); diff --git a/Libraries/LibGUI/GStatusBar.cpp b/Libraries/LibGUI/GStatusBar.cpp index 1e5a086c34..6eddbf7d62 100644 --- a/Libraries/LibGUI/GStatusBar.cpp +++ b/Libraries/LibGUI/GStatusBar.cpp @@ -41,7 +41,7 @@ GStatusBar::GStatusBar(int label_count, GWidget* parent) { set_size_policy(SizePolicy::Fill, SizePolicy::Fixed); set_preferred_size(0, 20); - set_layout(make<GBoxLayout>(Orientation::Horizontal)); + set_layout(make<GHBoxLayout>()); layout()->set_margins({ 2, 2, 2, 2 }); layout()->set_spacing(2); |