1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 17:57:34 +00:00

LibGUI: Add GHBoxLayout and GVBoxLayout convenience classes

This commit is contained in:
Andreas Kling 2020-02-02 09:48:11 +01:00
parent 63364f8a5d
commit d67da8c101
50 changed files with 128 additions and 114 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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