mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:58:12 +00:00
LibGUI: Rename {H,V}BoxLayout => {Horizontal,Vertical}BoxLayout
This commit is contained in:
parent
dccf335d5b
commit
799b0a4fa8
49 changed files with 114 additions and 114 deletions
|
@ -64,7 +64,7 @@ int main(int argc, char** argv)
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
window->set_main_widget(widget);
|
window->set_main_widget(widget);
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
widget->layout()->set_margins({ 0, 8, 0, 8 });
|
widget->layout()->set_margins({ 0, 8, 0, 8 });
|
||||||
widget->layout()->set_spacing(8);
|
widget->layout()->set_spacing(8);
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
InspectorWidget::InspectorWidget(GUI::Widget* parent)
|
InspectorWidget::InspectorWidget(GUI::Widget* parent)
|
||||||
: GUI::Widget(parent)
|
: GUI::Widget(parent)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
auto splitter = GUI::VerticalSplitter::construct(this);
|
auto splitter = GUI::VerticalSplitter::construct(this);
|
||||||
m_dom_tree_view = GUI::TreeView::construct(splitter);
|
m_dom_tree_view = GUI::TreeView::construct(splitter);
|
||||||
m_dom_tree_view->on_selection = [this](auto& index) {
|
m_dom_tree_view->on_selection = [this](auto& index) {
|
||||||
|
|
|
@ -77,7 +77,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
widget->layout()->set_spacing(0);
|
widget->layout()->set_spacing(0);
|
||||||
|
|
||||||
auto toolbar = GUI::ToolBar::construct(widget);
|
auto toolbar = GUI::ToolBar::construct(widget);
|
||||||
|
|
|
@ -59,7 +59,7 @@ int main(int argc, char** argv)
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
window->set_main_widget(widget);
|
window->set_main_widget(widget);
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
|
|
||||||
auto board_combo = GUI::ComboBox::construct(widget);
|
auto board_combo = GUI::ComboBox::construct(widget);
|
||||||
board_combo->set_only_allow_values_from_model(true);
|
board_combo->set_only_allow_values_from_model(true);
|
||||||
|
|
|
@ -100,7 +100,7 @@ void DisplayPropertiesWidget::create_resolution_list()
|
||||||
void DisplayPropertiesWidget::create_root_widget()
|
void DisplayPropertiesWidget::create_root_widget()
|
||||||
{
|
{
|
||||||
m_root_widget = GUI::Widget::construct();
|
m_root_widget = GUI::Widget::construct();
|
||||||
m_root_widget->set_layout(make<GUI::VBoxLayout>());
|
m_root_widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
m_root_widget->set_fill_with_background_color(true);
|
m_root_widget->set_fill_with_background_color(true);
|
||||||
m_root_widget->layout()->set_margins({ 4, 4, 4, 16 });
|
m_root_widget->layout()->set_margins({ 4, 4, 4, 16 });
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ void DisplayPropertiesWidget::create_frame()
|
||||||
tab_widget->add_widget("Wallpaper", background_splitter);
|
tab_widget->add_widget("Wallpaper", background_splitter);
|
||||||
|
|
||||||
auto background_content = GUI::Widget::construct(background_splitter.ptr());
|
auto background_content = GUI::Widget::construct(background_splitter.ptr());
|
||||||
background_content->set_layout(make<GUI::VBoxLayout>());
|
background_content->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
background_content->layout()->set_margins({ 4, 4, 4, 4 });
|
background_content->layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
|
||||||
m_wallpaper_preview = GUI::Label::construct(background_splitter);
|
m_wallpaper_preview = GUI::Label::construct(background_splitter);
|
||||||
|
@ -159,7 +159,7 @@ void DisplayPropertiesWidget::create_frame()
|
||||||
tab_widget->add_widget("Settings", settings_splitter);
|
tab_widget->add_widget("Settings", settings_splitter);
|
||||||
|
|
||||||
auto settings_content = GUI::Widget::construct(settings_splitter.ptr());
|
auto settings_content = GUI::Widget::construct(settings_splitter.ptr());
|
||||||
settings_content->set_layout(make<GUI::VBoxLayout>());
|
settings_content->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
settings_content->layout()->set_margins({ 4, 4, 4, 4 });
|
settings_content->layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
|
||||||
auto resolution_list = GUI::ListView::construct(settings_content);
|
auto resolution_list = GUI::ListView::construct(settings_content);
|
||||||
|
@ -181,7 +181,7 @@ void DisplayPropertiesWidget::create_frame()
|
||||||
|
|
||||||
// Add the apply and cancel buttons
|
// Add the apply and cancel buttons
|
||||||
auto bottom_widget = GUI::Widget::construct(m_root_widget.ptr());
|
auto bottom_widget = GUI::Widget::construct(m_root_widget.ptr());
|
||||||
bottom_widget->set_layout(make<GUI::HBoxLayout>());
|
bottom_widget->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
bottom_widget->layout()->add_spacer();
|
bottom_widget->layout()->add_spacer();
|
||||||
bottom_widget->set_size_policy(Orientation::Vertical, GUI::SizePolicy::Fixed);
|
bottom_widget->set_size_policy(Orientation::Vertical, GUI::SizePolicy::Fixed);
|
||||||
bottom_widget->set_preferred_size(1, 22);
|
bottom_widget->set_preferred_size(1, 22);
|
||||||
|
|
|
@ -44,7 +44,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
|
||||||
ASSERT(file_path.is_valid());
|
ASSERT(file_path.is_valid());
|
||||||
|
|
||||||
auto main_widget = GUI::Widget::construct();
|
auto main_widget = GUI::Widget::construct();
|
||||||
main_widget->set_layout(make<GUI::VBoxLayout>());
|
main_widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
main_widget->layout()->set_margins({ 4, 4, 4, 4 });
|
main_widget->layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
main_widget->set_fill_with_background_color(true);
|
main_widget->set_fill_with_background_color(true);
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
|
||||||
auto tab_widget = GUI::TabWidget::construct(main_widget);
|
auto tab_widget = GUI::TabWidget::construct(main_widget);
|
||||||
|
|
||||||
auto general_tab = GUI::Widget::construct(tab_widget.ptr());
|
auto general_tab = GUI::Widget::construct(tab_widget.ptr());
|
||||||
general_tab->set_layout(make<GUI::VBoxLayout>());
|
general_tab->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
general_tab->layout()->set_margins({ 12, 8, 12, 8 });
|
general_tab->layout()->set_margins({ 12, 8, 12, 8 });
|
||||||
general_tab->layout()->set_spacing(10);
|
general_tab->layout()->set_spacing(10);
|
||||||
tab_widget->add_widget("General", general_tab);
|
tab_widget->add_widget("General", general_tab);
|
||||||
|
@ -63,7 +63,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
|
||||||
general_tab->layout()->add_spacer();
|
general_tab->layout()->add_spacer();
|
||||||
|
|
||||||
auto file_container = GUI::Widget::construct(general_tab.ptr());
|
auto file_container = GUI::Widget::construct(general_tab.ptr());
|
||||||
file_container->set_layout(make<GUI::HBoxLayout>());
|
file_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
file_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
file_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
file_container->layout()->set_spacing(20);
|
file_container->layout()->set_spacing(20);
|
||||||
file_container->set_preferred_size(0, 34);
|
file_container->set_preferred_size(0, 34);
|
||||||
|
@ -133,7 +133,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
|
||||||
general_tab->layout()->add_spacer();
|
general_tab->layout()->add_spacer();
|
||||||
|
|
||||||
auto button_widget = GUI::Widget::construct(main_widget.ptr());
|
auto button_widget = GUI::Widget::construct(main_widget.ptr());
|
||||||
button_widget->set_layout(make<GUI::HBoxLayout>());
|
button_widget->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
button_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
button_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
button_widget->set_preferred_size(0, 24);
|
button_widget->set_preferred_size(0, 24);
|
||||||
button_widget->layout()->set_spacing(5);
|
button_widget->layout()->set_spacing(5);
|
||||||
|
@ -213,7 +213,7 @@ bool PropertiesDialog::apply_changes()
|
||||||
void PropertiesDialog::make_permission_checkboxes(NonnullRefPtr<GUI::Widget>& parent, PermissionMasks masks, String label_string, mode_t mode)
|
void PropertiesDialog::make_permission_checkboxes(NonnullRefPtr<GUI::Widget>& parent, PermissionMasks masks, String label_string, mode_t mode)
|
||||||
{
|
{
|
||||||
auto widget = GUI::Widget::construct(parent.ptr());
|
auto widget = GUI::Widget::construct(parent.ptr());
|
||||||
widget->set_layout(make<GUI::HBoxLayout>());
|
widget->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
widget->set_preferred_size(0, 16);
|
widget->set_preferred_size(0, 16);
|
||||||
widget->layout()->set_spacing(10);
|
widget->layout()->set_spacing(10);
|
||||||
|
@ -242,7 +242,7 @@ void PropertiesDialog::make_property_value_pairs(const Vector<PropertyValuePair>
|
||||||
property_labels.ensure_capacity(pairs.size());
|
property_labels.ensure_capacity(pairs.size());
|
||||||
for (auto pair : pairs) {
|
for (auto pair : pairs) {
|
||||||
auto label_container = GUI::Widget::construct(parent.ptr());
|
auto label_container = GUI::Widget::construct(parent.ptr());
|
||||||
label_container->set_layout(make<GUI::HBoxLayout>());
|
label_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
label_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
label_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
label_container->set_preferred_size(0, 14);
|
label_container->set_preferred_size(0, 14);
|
||||||
label_container->layout()->set_spacing(12);
|
label_container->layout()->set_spacing(12);
|
||||||
|
|
|
@ -90,7 +90,7 @@ int main(int argc, char** argv)
|
||||||
window->set_rect({ left, top, width, heigth });
|
window->set_rect({ left, top, width, heigth });
|
||||||
|
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
widget->layout()->set_spacing(0);
|
widget->layout()->set_spacing(0);
|
||||||
|
|
||||||
auto main_toolbar = GUI::ToolBar::construct(widget);
|
auto main_toolbar = GUI::ToolBar::construct(widget);
|
||||||
|
|
|
@ -78,7 +78,7 @@ int main(int argc, char* argv[])
|
||||||
window->set_rect(300, 200, 570, 500);
|
window->set_rect(300, 200, 570, 500);
|
||||||
|
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
widget->layout()->set_spacing(0);
|
widget->layout()->set_spacing(0);
|
||||||
|
|
||||||
auto toolbar = GUI::ToolBar::construct(widget);
|
auto toolbar = GUI::ToolBar::construct(widget);
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
HexEditorWidget::HexEditorWidget()
|
HexEditorWidget::HexEditorWidget()
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_spacing(0);
|
layout()->set_spacing(0);
|
||||||
|
|
||||||
m_editor = HexEditor::construct(this);
|
m_editor = HexEditor::construct(this);
|
||||||
|
|
|
@ -181,7 +181,7 @@ void IRCAppWindow::setup_widgets()
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
set_main_widget(widget);
|
set_main_widget(widget);
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
widget->layout()->set_spacing(0);
|
widget->layout()->set_spacing(0);
|
||||||
|
|
||||||
auto toolbar = GUI::ToolBar::construct(widget);
|
auto toolbar = GUI::ToolBar::construct(widget);
|
||||||
|
@ -196,7 +196,7 @@ void IRCAppWindow::setup_widgets()
|
||||||
toolbar->add_action(*m_close_query_action);
|
toolbar->add_action(*m_close_query_action);
|
||||||
|
|
||||||
auto outer_container = GUI::Widget::construct(widget.ptr());
|
auto outer_container = GUI::Widget::construct(widget.ptr());
|
||||||
outer_container->set_layout(make<GUI::VBoxLayout>());
|
outer_container->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
outer_container->layout()->set_margins({ 2, 0, 2, 2 });
|
outer_container->layout()->set_margins({ 2, 0, 2, 2 });
|
||||||
|
|
||||||
auto horizontal_container = GUI::HorizontalSplitter::construct(outer_container);
|
auto horizontal_container = GUI::HorizontalSplitter::construct(outer_container);
|
||||||
|
|
|
@ -42,7 +42,7 @@ IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& na
|
||||||
, m_type(type)
|
, m_type(type)
|
||||||
, m_name(name)
|
, m_name(name)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
|
|
||||||
// Make a container for the log buffer view + (optional) member list.
|
// Make a container for the log buffer view + (optional) member list.
|
||||||
auto container = GUI::HorizontalSplitter::construct(this);
|
auto container = GUI::HorizontalSplitter::construct(this);
|
||||||
|
|
|
@ -111,15 +111,15 @@ PaletteWidget::PaletteWidget(PaintableWidget& paintable_widget, GUI::Widget* par
|
||||||
|
|
||||||
auto color_container = GUI::Widget::construct(this);
|
auto color_container = GUI::Widget::construct(this);
|
||||||
color_container->set_relative_rect(m_secondary_color_widget->relative_rect().right() + 2, 2, 500, 32);
|
color_container->set_relative_rect(m_secondary_color_widget->relative_rect().right() + 2, 2, 500, 32);
|
||||||
color_container->set_layout(make<GUI::VBoxLayout>());
|
color_container->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
color_container->layout()->set_spacing(1);
|
color_container->layout()->set_spacing(1);
|
||||||
|
|
||||||
auto top_color_container = GUI::Widget::construct(color_container.ptr());
|
auto top_color_container = GUI::Widget::construct(color_container.ptr());
|
||||||
top_color_container->set_layout(make<GUI::HBoxLayout>());
|
top_color_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
top_color_container->layout()->set_spacing(1);
|
top_color_container->layout()->set_spacing(1);
|
||||||
|
|
||||||
auto bottom_color_container = GUI::Widget::construct(color_container.ptr());
|
auto bottom_color_container = GUI::Widget::construct(color_container.ptr());
|
||||||
bottom_color_container->set_layout(make<GUI::HBoxLayout>());
|
bottom_color_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
bottom_color_container->layout()->set_spacing(1);
|
bottom_color_container->layout()->set_spacing(1);
|
||||||
|
|
||||||
auto add_color_widget = [&](GUI::Widget* container, Color color) {
|
auto add_color_widget = [&](GUI::Widget* container, Color color) {
|
||||||
|
|
|
@ -72,7 +72,7 @@ ToolboxWidget::ToolboxWidget(GUI::Widget* parent)
|
||||||
set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||||
set_preferred_size(48, 0);
|
set_preferred_size(48, 0);
|
||||||
|
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_margins({ 4, 4, 4, 4 });
|
layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
|
||||||
auto add_tool = [&](const StringView& name, const StringView& icon_name, OwnPtr<Tool>&& tool) {
|
auto add_tool = [&](const StringView& name, const StringView& icon_name, OwnPtr<Tool>&& tool) {
|
||||||
|
|
|
@ -59,13 +59,13 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
auto horizontal_container = GUI::Widget::construct();
|
auto horizontal_container = GUI::Widget::construct();
|
||||||
window->set_main_widget(horizontal_container);
|
window->set_main_widget(horizontal_container);
|
||||||
horizontal_container->set_layout(make<GUI::HBoxLayout>());
|
horizontal_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
horizontal_container->layout()->set_spacing(0);
|
horizontal_container->layout()->set_spacing(0);
|
||||||
|
|
||||||
new ToolboxWidget(horizontal_container);
|
new ToolboxWidget(horizontal_container);
|
||||||
|
|
||||||
auto vertical_container = GUI::Widget::construct(horizontal_container.ptr());
|
auto vertical_container = GUI::Widget::construct(horizontal_container.ptr());
|
||||||
vertical_container->set_layout(make<GUI::VBoxLayout>());
|
vertical_container->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
vertical_container->layout()->set_spacing(0);
|
vertical_container->layout()->set_spacing(0);
|
||||||
|
|
||||||
auto paintable_widget = PaintableWidget::construct(vertical_container);
|
auto paintable_widget = PaintableWidget::construct(vertical_container);
|
||||||
|
|
|
@ -40,11 +40,11 @@ KnobsWidget::KnobsWidget(GUI::Widget* parent, AudioEngine& audio_engine, MainWid
|
||||||
set_frame_thickness(2);
|
set_frame_thickness(2);
|
||||||
set_frame_shadow(Gfx::FrameShadow::Sunken);
|
set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||||
set_frame_shape(Gfx::FrameShape::Container);
|
set_frame_shape(Gfx::FrameShape::Container);
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
set_fill_with_background_color(true);
|
set_fill_with_background_color(true);
|
||||||
|
|
||||||
m_labels_container = GUI::Widget::construct(this);
|
m_labels_container = GUI::Widget::construct(this);
|
||||||
m_labels_container->set_layout(make<GUI::HBoxLayout>());
|
m_labels_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
m_labels_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
m_labels_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
m_labels_container->set_preferred_size(0, 20);
|
m_labels_container->set_preferred_size(0, 20);
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ KnobsWidget::KnobsWidget(GUI::Widget* parent, AudioEngine& audio_engine, MainWid
|
||||||
m_delay_label = GUI::Label::construct("Delay", m_labels_container);
|
m_delay_label = GUI::Label::construct("Delay", m_labels_container);
|
||||||
|
|
||||||
m_values_container = GUI::Widget::construct(this);
|
m_values_container = GUI::Widget::construct(this);
|
||||||
m_values_container->set_layout(make<GUI::HBoxLayout>());
|
m_values_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
m_values_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
m_values_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
m_values_container->set_preferred_size(0, 10);
|
m_values_container->set_preferred_size(0, 10);
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ KnobsWidget::KnobsWidget(GUI::Widget* parent, AudioEngine& audio_engine, MainWid
|
||||||
m_delay_value = GUI::Label::construct(String::number(m_audio_engine.delay() / m_audio_engine.tick()), m_values_container);
|
m_delay_value = GUI::Label::construct(String::number(m_audio_engine.delay() / m_audio_engine.tick()), m_values_container);
|
||||||
|
|
||||||
m_knobs_container = GUI::Widget::construct(this);
|
m_knobs_container = GUI::Widget::construct(this);
|
||||||
m_knobs_container->set_layout(make<GUI::HBoxLayout>());
|
m_knobs_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
|
|
||||||
// FIXME: Implement vertical flipping in GSlider, not here.
|
// FIXME: Implement vertical flipping in GSlider, not here.
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
MainWidget::MainWidget(AudioEngine& audio_engine)
|
MainWidget::MainWidget(AudioEngine& audio_engine)
|
||||||
: m_audio_engine(audio_engine)
|
: m_audio_engine(audio_engine)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_spacing(2);
|
layout()->set_spacing(2);
|
||||||
layout()->set_margins({ 2, 2, 2, 2 });
|
layout()->set_margins({ 2, 2, 2, 2 });
|
||||||
set_fill_with_background_color(true);
|
set_fill_with_background_color(true);
|
||||||
|
@ -50,7 +50,7 @@ MainWidget::MainWidget(AudioEngine& audio_engine)
|
||||||
m_roll_widget->set_preferred_size(0, 300);
|
m_roll_widget->set_preferred_size(0, 300);
|
||||||
|
|
||||||
m_keys_and_knobs_container = GUI::Widget::construct(this);
|
m_keys_and_knobs_container = GUI::Widget::construct(this);
|
||||||
m_keys_and_knobs_container->set_layout(make<GUI::HBoxLayout>());
|
m_keys_and_knobs_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
m_keys_and_knobs_container->layout()->set_spacing(2);
|
m_keys_and_knobs_container->layout()->set_spacing(2);
|
||||||
m_keys_and_knobs_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
m_keys_and_knobs_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
m_keys_and_knobs_container->set_preferred_size(0, 100);
|
m_keys_and_knobs_container->set_preferred_size(0, 100);
|
||||||
|
|
|
@ -38,12 +38,12 @@ SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr<Audio::C
|
||||||
, m_manager(connection)
|
, m_manager(connection)
|
||||||
{
|
{
|
||||||
set_fill_with_background_color(true);
|
set_fill_with_background_color(true);
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_margins({ 2, 2, 2, 2 });
|
layout()->set_margins({ 2, 2, 2, 2 });
|
||||||
|
|
||||||
auto status_widget = GUI::Widget::construct(this);
|
auto status_widget = GUI::Widget::construct(this);
|
||||||
status_widget->set_fill_with_background_color(true);
|
status_widget->set_fill_with_background_color(true);
|
||||||
status_widget->set_layout(make<GUI::HBoxLayout>());
|
status_widget->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
|
|
||||||
m_elapsed = GUI::Label::construct(status_widget);
|
m_elapsed = GUI::Label::construct(status_widget);
|
||||||
m_elapsed->set_frame_shape(Gfx::FrameShape::Container);
|
m_elapsed->set_frame_shape(Gfx::FrameShape::Container);
|
||||||
|
@ -53,7 +53,7 @@ SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr<Audio::C
|
||||||
m_elapsed->set_preferred_size(80, 0);
|
m_elapsed->set_preferred_size(80, 0);
|
||||||
|
|
||||||
auto sample_widget_container = GUI::Widget::construct(status_widget.ptr());
|
auto sample_widget_container = GUI::Widget::construct(status_widget.ptr());
|
||||||
sample_widget_container->set_layout(make<GUI::HBoxLayout>());
|
sample_widget_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
sample_widget_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
|
sample_widget_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
|
||||||
|
|
||||||
m_sample_widget = SampleWidget::construct(sample_widget_container);
|
m_sample_widget = SampleWidget::construct(sample_widget_container);
|
||||||
|
@ -72,7 +72,7 @@ SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr<Audio::C
|
||||||
|
|
||||||
auto control_widget = GUI::Widget::construct(this);
|
auto control_widget = GUI::Widget::construct(this);
|
||||||
control_widget->set_fill_with_background_color(true);
|
control_widget->set_fill_with_background_color(true);
|
||||||
control_widget->set_layout(make<GUI::HBoxLayout>());
|
control_widget->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
control_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
control_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
control_widget->set_preferred_size(0, 30);
|
control_widget->set_preferred_size(0, 30);
|
||||||
control_widget->layout()->set_margins({ 10, 2, 10, 2 });
|
control_widget->layout()->set_margins({ 10, 2, 10, 2 });
|
||||||
|
|
|
@ -52,13 +52,13 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget& graph, GUI::Widget* parent)
|
||||||
set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
set_preferred_size(0, 72);
|
set_preferred_size(0, 72);
|
||||||
|
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_margins({ 0, 8, 0, 0 });
|
layout()->set_margins({ 0, 8, 0, 0 });
|
||||||
layout()->set_spacing(3);
|
layout()->set_spacing(3);
|
||||||
|
|
||||||
auto build_widgets_for_label = [this](const String& description) -> RefPtr<GUI::Label> {
|
auto build_widgets_for_label = [this](const String& description) -> RefPtr<GUI::Label> {
|
||||||
auto container = GUI::Widget::construct(this);
|
auto container = GUI::Widget::construct(this);
|
||||||
container->set_layout(make<GUI::HBoxLayout>());
|
container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
container->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
|
container->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
|
||||||
container->set_preferred_size(275, 12);
|
container->set_preferred_size(275, 12);
|
||||||
auto description_label = GUI::Label::construct(description, container);
|
auto description_label = GUI::Label::construct(description, container);
|
||||||
|
|
|
@ -34,12 +34,12 @@ NetworkStatisticsWidget::NetworkStatisticsWidget(GUI::Widget* parent)
|
||||||
: GUI::LazyWidget(parent)
|
: GUI::LazyWidget(parent)
|
||||||
{
|
{
|
||||||
on_first_show = [this](auto&) {
|
on_first_show = [this](auto&) {
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_margins({ 4, 4, 4, 4 });
|
layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
set_fill_with_background_color(true);
|
set_fill_with_background_color(true);
|
||||||
|
|
||||||
auto adapters_group_box = GUI::GroupBox::construct("Adapters", this);
|
auto adapters_group_box = GUI::GroupBox::construct("Adapters", this);
|
||||||
adapters_group_box->set_layout(make<GUI::VBoxLayout>());
|
adapters_group_box->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
adapters_group_box->layout()->set_margins({ 6, 16, 6, 6 });
|
adapters_group_box->layout()->set_margins({ 6, 16, 6, 6 });
|
||||||
adapters_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
adapters_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
adapters_group_box->set_preferred_size(0, 120);
|
adapters_group_box->set_preferred_size(0, 120);
|
||||||
|
@ -59,7 +59,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget(GUI::Widget* parent)
|
||||||
m_adapter_table_view->set_model(GUI::JsonArrayModel::create("/proc/net/adapters", move(net_adapters_fields)));
|
m_adapter_table_view->set_model(GUI::JsonArrayModel::create("/proc/net/adapters", move(net_adapters_fields)));
|
||||||
|
|
||||||
auto sockets_group_box = GUI::GroupBox::construct("Sockets", this);
|
auto sockets_group_box = GUI::GroupBox::construct("Sockets", this);
|
||||||
sockets_group_box->set_layout(make<GUI::VBoxLayout>());
|
sockets_group_box->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
sockets_group_box->layout()->set_margins({ 6, 16, 6, 6 });
|
sockets_group_box->layout()->set_margins({ 6, 16, 6, 6 });
|
||||||
sockets_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
|
sockets_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
|
||||||
sockets_group_box->set_preferred_size(0, 0);
|
sockets_group_box->set_preferred_size(0, 0);
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget(GUI::Widget* parent)
|
ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget(GUI::Widget* parent)
|
||||||
: GUI::Widget(parent)
|
: GUI::Widget(parent)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_margins({ 4, 4, 4, 4 });
|
layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
m_table_view = GUI::TableView::construct(this);
|
m_table_view = GUI::TableView::construct(this);
|
||||||
m_table_view->set_size_columns_to_fit_content(true);
|
m_table_view->set_size_columns_to_fit_content(true);
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
ProcessMemoryMapWidget::ProcessMemoryMapWidget(GUI::Widget* parent)
|
ProcessMemoryMapWidget::ProcessMemoryMapWidget(GUI::Widget* parent)
|
||||||
: GUI::Widget(parent)
|
: GUI::Widget(parent)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_margins({ 4, 4, 4, 4 });
|
layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
m_table_view = GUI::TableView::construct(this);
|
m_table_view = GUI::TableView::construct(this);
|
||||||
m_table_view->set_size_columns_to_fit_content(true);
|
m_table_view->set_size_columns_to_fit_content(true);
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
ProcessStacksWidget::ProcessStacksWidget(GUI::Widget* parent)
|
ProcessStacksWidget::ProcessStacksWidget(GUI::Widget* parent)
|
||||||
: GUI::Widget(parent)
|
: GUI::Widget(parent)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_margins({ 4, 4, 4, 4 });
|
layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
m_stacks_editor = GUI::TextEditor::construct(GUI::TextEditor::Type::MultiLine, this);
|
m_stacks_editor = GUI::TextEditor::construct(GUI::TextEditor::Type::MultiLine, this);
|
||||||
m_stacks_editor->set_readonly(true);
|
m_stacks_editor->set_readonly(true);
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget(GUI::Widget* parent)
|
ProcessUnveiledPathsWidget::ProcessUnveiledPathsWidget(GUI::Widget* parent)
|
||||||
: GUI::Widget(parent)
|
: GUI::Widget(parent)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_margins({ 4, 4, 4, 4 });
|
layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
m_table_view = GUI::TableView::construct(this);
|
m_table_view = GUI::TableView::construct(this);
|
||||||
m_table_view->set_size_columns_to_fit_content(true);
|
m_table_view->set_size_columns_to_fit_content(true);
|
||||||
|
|
|
@ -115,7 +115,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
auto keeper = GUI::Widget::construct();
|
auto keeper = GUI::Widget::construct();
|
||||||
window->set_main_widget(keeper);
|
window->set_main_widget(keeper);
|
||||||
keeper->set_layout(make<GUI::VBoxLayout>());
|
keeper->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
keeper->set_fill_with_background_color(true);
|
keeper->set_fill_with_background_color(true);
|
||||||
keeper->layout()->set_margins({ 4, 4, 4, 4 });
|
keeper->layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ int main(int argc, char** argv)
|
||||||
auto network_stats_widget = NetworkStatisticsWidget::construct(nullptr);
|
auto network_stats_widget = NetworkStatisticsWidget::construct(nullptr);
|
||||||
tabwidget->add_widget("Network", network_stats_widget);
|
tabwidget->add_widget("Network", network_stats_widget);
|
||||||
|
|
||||||
process_table_container->set_layout(make<GUI::VBoxLayout>());
|
process_table_container->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
process_table_container->layout()->set_margins({ 4, 0, 4, 4 });
|
process_table_container->layout()->set_margins({ 4, 0, 4, 4 });
|
||||||
process_table_container->layout()->set_spacing(0);
|
process_table_container->layout()->set_spacing(0);
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ RefPtr<GUI::Widget> build_file_systems_tab()
|
||||||
auto fs_widget = GUI::LazyWidget::construct();
|
auto fs_widget = GUI::LazyWidget::construct();
|
||||||
|
|
||||||
fs_widget->on_first_show = [](auto& self) {
|
fs_widget->on_first_show = [](auto& self) {
|
||||||
self.set_layout(make<GUI::VBoxLayout>());
|
self.set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
self.layout()->set_margins({ 4, 4, 4, 4 });
|
self.layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
auto fs_table_view = GUI::TableView::construct(&self);
|
auto fs_table_view = GUI::TableView::construct(&self);
|
||||||
fs_table_view->set_size_columns_to_fit_content(true);
|
fs_table_view->set_size_columns_to_fit_content(true);
|
||||||
|
@ -367,7 +367,7 @@ RefPtr<GUI::Widget> build_pci_devices_tab()
|
||||||
auto pci_widget = GUI::LazyWidget::construct();
|
auto pci_widget = GUI::LazyWidget::construct();
|
||||||
|
|
||||||
pci_widget->on_first_show = [](auto& self) {
|
pci_widget->on_first_show = [](auto& self) {
|
||||||
self.set_layout(make<GUI::VBoxLayout>());
|
self.set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
self.layout()->set_margins({ 4, 4, 4, 4 });
|
self.layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
auto pci_table_view = GUI::TableView::construct(&self);
|
auto pci_table_view = GUI::TableView::construct(&self);
|
||||||
pci_table_view->set_size_columns_to_fit_content(true);
|
pci_table_view->set_size_columns_to_fit_content(true);
|
||||||
|
@ -425,7 +425,7 @@ RefPtr<GUI::Widget> build_devices_tab()
|
||||||
auto devices_widget = GUI::LazyWidget::construct();
|
auto devices_widget = GUI::LazyWidget::construct();
|
||||||
|
|
||||||
devices_widget->on_first_show = [](auto& self) {
|
devices_widget->on_first_show = [](auto& self) {
|
||||||
self.set_layout(make<GUI::VBoxLayout>());
|
self.set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
self.layout()->set_margins({ 4, 4, 4, 4 });
|
self.layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
|
||||||
auto devices_table_view = GUI::TableView::construct(&self);
|
auto devices_table_view = GUI::TableView::construct(&self);
|
||||||
|
@ -444,11 +444,11 @@ NonnullRefPtr<GUI::Widget> build_graphs_tab()
|
||||||
graphs_container->on_first_show = [](auto& self) {
|
graphs_container->on_first_show = [](auto& self) {
|
||||||
self.set_fill_with_background_color(true);
|
self.set_fill_with_background_color(true);
|
||||||
self.set_background_role(ColorRole::Button);
|
self.set_background_role(ColorRole::Button);
|
||||||
self.set_layout(make<GUI::VBoxLayout>());
|
self.set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
self.layout()->set_margins({ 4, 4, 4, 4 });
|
self.layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
|
||||||
auto cpu_graph_group_box = GUI::GroupBox::construct("CPU usage", &self);
|
auto cpu_graph_group_box = GUI::GroupBox::construct("CPU usage", &self);
|
||||||
cpu_graph_group_box->set_layout(make<GUI::VBoxLayout>());
|
cpu_graph_group_box->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
cpu_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 });
|
cpu_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 });
|
||||||
cpu_graph_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
cpu_graph_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
cpu_graph_group_box->set_preferred_size(0, 120);
|
cpu_graph_group_box->set_preferred_size(0, 120);
|
||||||
|
@ -465,7 +465,7 @@ NonnullRefPtr<GUI::Widget> build_graphs_tab()
|
||||||
};
|
};
|
||||||
|
|
||||||
auto memory_graph_group_box = GUI::GroupBox::construct("Memory usage", &self);
|
auto memory_graph_group_box = GUI::GroupBox::construct("Memory usage", &self);
|
||||||
memory_graph_group_box->set_layout(make<GUI::VBoxLayout>());
|
memory_graph_group_box->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
memory_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 });
|
memory_graph_group_box->layout()->set_margins({ 6, 16, 6, 6 });
|
||||||
memory_graph_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
memory_graph_group_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
memory_graph_group_box->set_preferred_size(0, 120);
|
memory_graph_group_box->set_preferred_size(0, 120);
|
||||||
|
|
|
@ -48,7 +48,7 @@ TaskbarWindow::TaskbarWindow()
|
||||||
|
|
||||||
auto widget = GUI::Frame::construct();
|
auto widget = GUI::Frame::construct();
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<GUI::HBoxLayout>());
|
widget->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
widget->layout()->set_margins({ 3, 2, 3, 2 });
|
widget->layout()->set_margins({ 3, 2, 3, 2 });
|
||||||
widget->layout()->set_spacing(3);
|
widget->layout()->set_spacing(3);
|
||||||
widget->set_frame_thickness(1);
|
widget->set_frame_thickness(1);
|
||||||
|
@ -71,7 +71,7 @@ void TaskbarWindow::create_quick_launch_bar()
|
||||||
{
|
{
|
||||||
auto quick_launch_bar = GUI::Frame::construct(main_widget());
|
auto quick_launch_bar = GUI::Frame::construct(main_widget());
|
||||||
quick_launch_bar->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
|
quick_launch_bar->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
|
||||||
quick_launch_bar->set_layout(make<GUI::HBoxLayout>());
|
quick_launch_bar->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
quick_launch_bar->layout()->set_spacing(3);
|
quick_launch_bar->layout()->set_spacing(3);
|
||||||
quick_launch_bar->layout()->set_margins({ 3, 0, 3, 0 });
|
quick_launch_bar->layout()->set_margins({ 3, 0, 3, 0 });
|
||||||
quick_launch_bar->set_frame_thickness(1);
|
quick_launch_bar->set_frame_thickness(1);
|
||||||
|
|
|
@ -134,11 +134,11 @@ RefPtr<GUI::Window> create_settings_window(TerminalWidget& terminal)
|
||||||
window->set_main_widget(settings);
|
window->set_main_widget(settings);
|
||||||
settings->set_fill_with_background_color(true);
|
settings->set_fill_with_background_color(true);
|
||||||
settings->set_background_role(ColorRole::Button);
|
settings->set_background_role(ColorRole::Button);
|
||||||
settings->set_layout(make<GUI::VBoxLayout>());
|
settings->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
settings->layout()->set_margins({ 4, 4, 4, 4 });
|
settings->layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
|
||||||
auto radio_container = GUI::GroupBox::construct("Bell Mode", settings);
|
auto radio_container = GUI::GroupBox::construct("Bell Mode", settings);
|
||||||
radio_container->set_layout(make<GUI::VBoxLayout>());
|
radio_container->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
radio_container->layout()->set_margins({ 6, 16, 6, 6 });
|
radio_container->layout()->set_margins({ 6, 16, 6, 6 });
|
||||||
radio_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
radio_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
radio_container->set_preferred_size(100, 70);
|
radio_container->set_preferred_size(100, 70);
|
||||||
|
@ -152,7 +152,7 @@ RefPtr<GUI::Window> create_settings_window(TerminalWidget& terminal)
|
||||||
};
|
};
|
||||||
|
|
||||||
auto slider_container = GUI::GroupBox::construct("Background Opacity", settings);
|
auto slider_container = GUI::GroupBox::construct("Background Opacity", settings);
|
||||||
slider_container->set_layout(make<GUI::VBoxLayout>());
|
slider_container->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
slider_container->layout()->set_margins({ 6, 16, 6, 6 });
|
slider_container->layout()->set_margins({ 6, 16, 6, 6 });
|
||||||
slider_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
slider_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
slider_container->set_preferred_size(100, 50);
|
slider_container->set_preferred_size(100, 50);
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
TextEditorWidget::TextEditorWidget()
|
TextEditorWidget::TextEditorWidget()
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
layout()->set_spacing(0);
|
layout()->set_spacing(0);
|
||||||
|
|
||||||
auto toolbar = GUI::ToolBar::construct(this);
|
auto toolbar = GUI::ToolBar::construct(this);
|
||||||
|
@ -70,7 +70,7 @@ TextEditorWidget::TextEditorWidget()
|
||||||
m_find_replace_widget->set_fill_with_background_color(true);
|
m_find_replace_widget->set_fill_with_background_color(true);
|
||||||
m_find_replace_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
m_find_replace_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
m_find_replace_widget->set_preferred_size(0, 48);
|
m_find_replace_widget->set_preferred_size(0, 48);
|
||||||
m_find_replace_widget->set_layout(make<GUI::VBoxLayout>());
|
m_find_replace_widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
m_find_replace_widget->layout()->set_margins({ 2, 2, 2, 4 });
|
m_find_replace_widget->layout()->set_margins({ 2, 2, 2, 4 });
|
||||||
m_find_replace_widget->set_visible(false);
|
m_find_replace_widget->set_visible(false);
|
||||||
|
|
||||||
|
@ -78,14 +78,14 @@ TextEditorWidget::TextEditorWidget()
|
||||||
m_find_widget->set_fill_with_background_color(true);
|
m_find_widget->set_fill_with_background_color(true);
|
||||||
m_find_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
m_find_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
m_find_widget->set_preferred_size(0, 22);
|
m_find_widget->set_preferred_size(0, 22);
|
||||||
m_find_widget->set_layout(make<GUI::HBoxLayout>());
|
m_find_widget->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
m_find_widget->set_visible(false);
|
m_find_widget->set_visible(false);
|
||||||
|
|
||||||
m_replace_widget = GUI::Widget::construct(m_find_replace_widget);
|
m_replace_widget = GUI::Widget::construct(m_find_replace_widget);
|
||||||
m_replace_widget->set_fill_with_background_color(true);
|
m_replace_widget->set_fill_with_background_color(true);
|
||||||
m_replace_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
m_replace_widget->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
m_replace_widget->set_preferred_size(0, 22);
|
m_replace_widget->set_preferred_size(0, 22);
|
||||||
m_replace_widget->set_layout(make<GUI::HBoxLayout>());
|
m_replace_widget->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
m_replace_widget->set_visible(false);
|
m_replace_widget->set_visible(false);
|
||||||
|
|
||||||
m_find_textbox = GUI::TextBox::construct(m_find_widget);
|
m_find_textbox = GUI::TextBox::construct(m_find_widget);
|
||||||
|
|
|
@ -98,7 +98,7 @@ int main(int argc, char** argv)
|
||||||
auto background = GUI::Label::construct();
|
auto background = GUI::Label::construct();
|
||||||
window->set_main_widget(background);
|
window->set_main_widget(background);
|
||||||
background->set_fill_with_background_color(true);
|
background->set_fill_with_background_color(true);
|
||||||
background->set_layout(make<GUI::VBoxLayout>());
|
background->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
background->layout()->set_margins({ 8, 8, 8, 8 });
|
background->layout()->set_margins({ 8, 8, 8, 8 });
|
||||||
background->layout()->set_spacing(8);
|
background->layout()->set_spacing(8);
|
||||||
background->set_icon(Gfx::load_png_from_memory((const u8*)&_binary_background_png_start, (size_t)&_binary_background_png_size));
|
background->set_icon(Gfx::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 = GUI::Widget::construct(background.ptr());
|
auto main_section = GUI::Widget::construct(background.ptr());
|
||||||
main_section->set_layout(make<GUI::HBoxLayout>());
|
main_section->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
main_section->layout()->set_margins({ 0, 0, 0, 0 });
|
main_section->layout()->set_margins({ 0, 0, 0, 0 });
|
||||||
main_section->layout()->set_spacing(8);
|
main_section->layout()->set_spacing(8);
|
||||||
main_section->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
|
main_section->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
|
||||||
|
|
||||||
auto menu = GUI::Widget::construct(main_section.ptr());
|
auto menu = GUI::Widget::construct(main_section.ptr());
|
||||||
menu->set_layout(make<GUI::VBoxLayout>());
|
menu->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
menu->layout()->set_margins({ 0, 0, 0, 0 });
|
menu->layout()->set_margins({ 0, 0, 0, 0 });
|
||||||
menu->layout()->set_spacing(8);
|
menu->layout()->set_spacing(8);
|
||||||
menu->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
menu->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||||
|
@ -138,7 +138,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
for (auto& page : pages) {
|
for (auto& page : pages) {
|
||||||
auto content = GUI::Widget::construct(stack.ptr());
|
auto content = GUI::Widget::construct(stack.ptr());
|
||||||
content->set_layout(make<GUI::VBoxLayout>());
|
content->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
content->layout()->set_margins({ 0, 0, 0, 0 });
|
content->layout()->set_margins({ 0, 0, 0, 0 });
|
||||||
content->layout()->set_spacing(8);
|
content->layout()->set_spacing(8);
|
||||||
content->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
|
content->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fill);
|
||||||
|
|
|
@ -43,7 +43,7 @@ int main(int argc, char** argv)
|
||||||
window->set_main_widget(main_widget);
|
window->set_main_widget(main_widget);
|
||||||
main_widget->set_fill_with_background_color(true);
|
main_widget->set_fill_with_background_color(true);
|
||||||
main_widget->set_background_color(Color::White);
|
main_widget->set_background_color(Color::White);
|
||||||
main_widget->set_layout(make<GUI::VBoxLayout>());
|
main_widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
main_widget->layout()->set_margins({ 4, 4, 4, 4 });
|
main_widget->layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
|
||||||
auto label = GUI::Label::construct(main_widget);
|
auto label = GUI::Label::construct(main_widget);
|
||||||
|
|
|
@ -51,7 +51,7 @@ int main(int argc, char** argv)
|
||||||
auto main_widget = GUI::Widget::construct();
|
auto main_widget = GUI::Widget::construct();
|
||||||
window->set_main_widget(main_widget);
|
window->set_main_widget(main_widget);
|
||||||
main_widget->set_fill_with_background_color(true);
|
main_widget->set_fill_with_background_color(true);
|
||||||
main_widget->set_layout(make<GUI::VBoxLayout>());
|
main_widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
main_widget->layout()->set_margins({ 4, 4, 4, 4 });
|
main_widget->layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
|
|
||||||
auto checkbox1 = GUI::CheckBox::construct("GCheckBox 1", main_widget);
|
auto checkbox1 = GUI::CheckBox::construct("GCheckBox 1", main_widget);
|
||||||
|
@ -95,7 +95,7 @@ int main(int argc, char** argv)
|
||||||
auto vertical_slider_container = GUI::Widget::construct(main_widget.ptr());
|
auto vertical_slider_container = GUI::Widget::construct(main_widget.ptr());
|
||||||
vertical_slider_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
vertical_slider_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
vertical_slider_container->set_preferred_size(0, 100);
|
vertical_slider_container->set_preferred_size(0, 100);
|
||||||
vertical_slider_container->set_layout(make<GUI::HBoxLayout>());
|
vertical_slider_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
auto vslider1 = GUI::VerticalSlider::construct(vertical_slider_container);
|
auto vslider1 = GUI::VerticalSlider::construct(vertical_slider_container);
|
||||||
(void)vslider1;
|
(void)vslider1;
|
||||||
auto vslider2 = GUI::VerticalSlider::construct(vertical_slider_container);
|
auto vslider2 = GUI::VerticalSlider::construct(vertical_slider_container);
|
||||||
|
|
|
@ -36,13 +36,13 @@ extern RefPtr<EditorWrapper> g_current_editor_wrapper;
|
||||||
EditorWrapper::EditorWrapper(GUI::Widget* parent)
|
EditorWrapper::EditorWrapper(GUI::Widget* parent)
|
||||||
: GUI::Widget(parent)
|
: GUI::Widget(parent)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
|
|
||||||
auto label_wrapper = GUI::Widget::construct(this);
|
auto label_wrapper = GUI::Widget::construct(this);
|
||||||
label_wrapper->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
label_wrapper->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
label_wrapper->set_preferred_size(0, 14);
|
label_wrapper->set_preferred_size(0, 14);
|
||||||
label_wrapper->set_fill_with_background_color(true);
|
label_wrapper->set_fill_with_background_color(true);
|
||||||
label_wrapper->set_layout(make<GUI::HBoxLayout>());
|
label_wrapper->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
label_wrapper->layout()->set_margins({ 2, 0, 2, 0 });
|
label_wrapper->layout()->set_margins({ 2, 0, 2, 0 });
|
||||||
|
|
||||||
m_filename_label = GUI::Label::construct("(Untitled)", label_wrapper);
|
m_filename_label = GUI::Label::construct("(Untitled)", label_wrapper);
|
||||||
|
|
|
@ -130,7 +130,7 @@ static RefPtr<SearchResultsModel> find_in_files(const StringView& text)
|
||||||
FindInFilesWidget::FindInFilesWidget(GUI::Widget* parent)
|
FindInFilesWidget::FindInFilesWidget(GUI::Widget* parent)
|
||||||
: GUI::Widget(parent)
|
: GUI::Widget(parent)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
m_textbox = GUI::TextBox::construct(this);
|
m_textbox = GUI::TextBox::construct(this);
|
||||||
m_textbox->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
m_textbox->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
m_textbox->set_preferred_size(0, 20);
|
m_textbox->set_preferred_size(0, 20);
|
||||||
|
|
|
@ -107,7 +107,7 @@ Locator::Locator(GUI::Widget* parent)
|
||||||
s_header_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-header.png");
|
s_header_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-header.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
set_preferred_size(0, 20);
|
set_preferred_size(0, 20);
|
||||||
m_textbox = LocatorTextBox::construct(this);
|
m_textbox = LocatorTextBox::construct(this);
|
||||||
|
|
|
@ -38,7 +38,7 @@ ProcessStateWidget::ProcessStateWidget(GUI::Widget* parent)
|
||||||
set_preferred_size(0, 20);
|
set_preferred_size(0, 20);
|
||||||
set_visible(false);
|
set_visible(false);
|
||||||
|
|
||||||
set_layout(make<GUI::HBoxLayout>());
|
set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
|
|
||||||
auto pid_label_label = GUI::Label::construct("Process:", this);
|
auto pid_label_label = GUI::Label::construct("Process:", this);
|
||||||
pid_label_label->set_font(Gfx::Font::default_bold_font());
|
pid_label_label->set_font(Gfx::Font::default_bold_font());
|
||||||
|
|
|
@ -169,7 +169,7 @@ void TerminalWrapper::kill_running_command()
|
||||||
TerminalWrapper::TerminalWrapper(GUI::Widget* parent)
|
TerminalWrapper::TerminalWrapper(GUI::Widget* parent)
|
||||||
: GUI::Widget(parent)
|
: GUI::Widget(parent)
|
||||||
{
|
{
|
||||||
set_layout(make<GUI::VBoxLayout>());
|
set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
|
|
||||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal");
|
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal");
|
||||||
m_terminal_widget = TerminalWidget::construct(-1, false, config);
|
m_terminal_widget = TerminalWidget::construct(-1, false, config);
|
||||||
|
|
|
@ -145,7 +145,7 @@ int main(int argc, char** argv)
|
||||||
g_window->set_main_widget(widget);
|
g_window->set_main_widget(widget);
|
||||||
|
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
widget->layout()->set_spacing(0);
|
widget->layout()->set_spacing(0);
|
||||||
|
|
||||||
StringBuilder path;
|
StringBuilder path;
|
||||||
|
@ -266,7 +266,7 @@ int main(int argc, char** argv)
|
||||||
g_right_hand_stack = GUI::StackWidget::construct(outer_splitter);
|
g_right_hand_stack = GUI::StackWidget::construct(outer_splitter);
|
||||||
|
|
||||||
g_form_inner_container = GUI::Widget::construct(g_right_hand_stack);
|
g_form_inner_container = GUI::Widget::construct(g_right_hand_stack);
|
||||||
g_form_inner_container->set_layout(make<GUI::HBoxLayout>());
|
g_form_inner_container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
auto form_widgets_toolbar = GUI::ToolBar::construct(Orientation::Vertical, 26, g_form_inner_container);
|
auto form_widgets_toolbar = GUI::ToolBar::construct(Orientation::Vertical, 26, g_form_inner_container);
|
||||||
form_widgets_toolbar->set_preferred_size(38, 0);
|
form_widgets_toolbar->set_preferred_size(38, 0);
|
||||||
|
|
||||||
|
@ -303,11 +303,11 @@ int main(int argc, char** argv)
|
||||||
auto form_editing_pane_container = GUI::VerticalSplitter::construct(form_editor_inner_splitter);
|
auto form_editing_pane_container = GUI::VerticalSplitter::construct(form_editor_inner_splitter);
|
||||||
form_editing_pane_container->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
form_editing_pane_container->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||||
form_editing_pane_container->set_preferred_size(190, 0);
|
form_editing_pane_container->set_preferred_size(190, 0);
|
||||||
form_editing_pane_container->set_layout(make<GUI::VBoxLayout>());
|
form_editing_pane_container->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
|
|
||||||
auto add_properties_pane = [&](auto& text, auto pane_widget) {
|
auto add_properties_pane = [&](auto& text, auto pane_widget) {
|
||||||
auto wrapper = GUI::Widget::construct(form_editing_pane_container.ptr());
|
auto wrapper = GUI::Widget::construct(form_editing_pane_container.ptr());
|
||||||
wrapper->set_layout(make<GUI::VBoxLayout>());
|
wrapper->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
auto label = GUI::Label::construct(text, wrapper);
|
auto label = GUI::Label::construct(text, wrapper);
|
||||||
label->set_fill_with_background_color(true);
|
label->set_fill_with_background_color(true);
|
||||||
label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||||
|
|
|
@ -61,7 +61,7 @@ int main(int argc, char** argv)
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
window->set_main_widget(widget);
|
window->set_main_widget(widget);
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
|
|
||||||
auto splitter = GUI::HorizontalSplitter::construct(widget);
|
auto splitter = GUI::HorizontalSplitter::construct(widget);
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ int main(int argc, char** argv)
|
||||||
auto main_widget = GUI::Widget::construct();
|
auto main_widget = GUI::Widget::construct();
|
||||||
window->set_main_widget(main_widget);
|
window->set_main_widget(main_widget);
|
||||||
main_widget->set_fill_with_background_color(true);
|
main_widget->set_fill_with_background_color(true);
|
||||||
main_widget->set_layout(make<GUI::VBoxLayout>());
|
main_widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
|
|
||||||
auto timeline_widget = ProfileTimelineWidget::construct(*profile, main_widget);
|
auto timeline_widget = ProfileTimelineWidget::construct(*profile, main_widget);
|
||||||
|
|
||||||
|
|
|
@ -65,13 +65,13 @@ VBForm::VBForm(const String& name, GUI::Widget* parent)
|
||||||
m_context_menu->add_action(GUI::Action::create("Lay out horizontally", Gfx::Bitmap::load_from_file("/res/icons/16x16/layout-horizontally.png"), [this](auto&) {
|
m_context_menu->add_action(GUI::Action::create("Lay out horizontally", Gfx::Bitmap::load_from_file("/res/icons/16x16/layout-horizontally.png"), [this](auto&) {
|
||||||
if (auto* widget = single_selected_widget()) {
|
if (auto* widget = single_selected_widget()) {
|
||||||
dbg() << "Giving " << *widget->gwidget() << " a horizontal box layout";
|
dbg() << "Giving " << *widget->gwidget() << " a horizontal box layout";
|
||||||
widget->gwidget()->set_layout(make<GUI::HBoxLayout>());
|
widget->gwidget()->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
m_context_menu->add_action(GUI::Action::create("Lay out vertically", Gfx::Bitmap::load_from_file("/res/icons/16x16/layout-vertically.png"), [this](auto&) {
|
m_context_menu->add_action(GUI::Action::create("Lay out vertically", Gfx::Bitmap::load_from_file("/res/icons/16x16/layout-vertically.png"), [this](auto&) {
|
||||||
if (auto* widget = single_selected_widget()) {
|
if (auto* widget = single_selected_widget()) {
|
||||||
dbg() << "Giving " << *widget->gwidget() << " a vertical box layout";
|
dbg() << "Giving " << *widget->gwidget() << " a vertical box layout";
|
||||||
widget->gwidget()->set_layout(make<GUI::VBoxLayout>());
|
widget->gwidget()->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
m_context_menu->add_separator();
|
m_context_menu->add_separator();
|
||||||
|
|
|
@ -83,7 +83,7 @@ VBPropertiesWindow::VBPropertiesWindow()
|
||||||
|
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
widget->layout()->set_margins({ 2, 2, 2, 2 });
|
widget->layout()->set_margins({ 2, 2, 2, 2 });
|
||||||
set_main_widget(widget);
|
set_main_widget(widget);
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ RefPtr<GUI::Window> make_toolbox_window()
|
||||||
|
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
widget->layout()->set_spacing(0);
|
widget->layout()->set_spacing(0);
|
||||||
window->set_main_widget(widget);
|
window->set_main_widget(widget);
|
||||||
|
|
||||||
|
|
|
@ -59,14 +59,14 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
auto widget = GUI::Widget::construct();
|
auto widget = GUI::Widget::construct();
|
||||||
window->set_main_widget(widget);
|
window->set_main_widget(widget);
|
||||||
widget->set_layout(make<GUI::VBoxLayout>());
|
widget->set_layout(make<GUI::VerticalBoxLayout>());
|
||||||
widget->layout()->set_spacing(0);
|
widget->layout()->set_spacing(0);
|
||||||
|
|
||||||
auto container = GUI::Widget::construct(widget.ptr());
|
auto container = GUI::Widget::construct(widget.ptr());
|
||||||
container->set_fill_with_background_color(true);
|
container->set_fill_with_background_color(true);
|
||||||
container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||||
container->set_preferred_size(0, 36);
|
container->set_preferred_size(0, 36);
|
||||||
container->set_layout(make<GUI::HBoxLayout>());
|
container->set_layout(make<GUI::HorizontalBoxLayout>());
|
||||||
auto flag_icon_label = GUI::Label::construct(container);
|
auto flag_icon_label = GUI::Label::construct(container);
|
||||||
flag_icon_label->set_icon(Gfx::Bitmap::load_from_file("/res/icons/minesweeper/flag.png"));
|
flag_icon_label->set_icon(Gfx::Bitmap::load_from_file("/res/icons/minesweeper/flag.png"));
|
||||||
auto flag_label = GUI::Label::construct(container);
|
auto flag_label = GUI::Label::construct(container);
|
||||||
|
|
|
@ -44,12 +44,12 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Core::
|
||||||
auto widget = Widget::construct();
|
auto widget = Widget::construct();
|
||||||
set_main_widget(widget);
|
set_main_widget(widget);
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
widget->set_layout(make<HBoxLayout>());
|
widget->set_layout(make<HorizontalBoxLayout>());
|
||||||
|
|
||||||
auto left_container = Widget::construct(widget.ptr());
|
auto left_container = Widget::construct(widget.ptr());
|
||||||
left_container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
|
left_container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
|
||||||
left_container->set_preferred_size(48, 0);
|
left_container->set_preferred_size(48, 0);
|
||||||
left_container->set_layout(make<VBoxLayout>());
|
left_container->set_layout(make<VerticalBoxLayout>());
|
||||||
auto icon_label = Label::construct(left_container);
|
auto icon_label = Label::construct(left_container);
|
||||||
icon_label->set_icon(m_icon);
|
icon_label->set_icon(m_icon);
|
||||||
icon_label->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
|
icon_label->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
|
||||||
|
@ -57,7 +57,7 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Core::
|
||||||
left_container->layout()->add_spacer();
|
left_container->layout()->add_spacer();
|
||||||
|
|
||||||
auto right_container = Widget::construct(widget.ptr());
|
auto right_container = Widget::construct(widget.ptr());
|
||||||
right_container->set_layout(make<VBoxLayout>());
|
right_container->set_layout(make<VerticalBoxLayout>());
|
||||||
right_container->layout()->set_margins({ 0, 4, 4, 4 });
|
right_container->layout()->set_margins({ 0, 4, 4, 4 });
|
||||||
|
|
||||||
auto make_label = [&](const StringView& text, bool bold = false) {
|
auto make_label = [&](const StringView& text, bool bold = false) {
|
||||||
|
@ -77,7 +77,7 @@ AboutDialog::AboutDialog(const StringView& name, const Gfx::Bitmap* icon, Core::
|
||||||
auto button_container = Widget::construct(right_container.ptr());
|
auto button_container = Widget::construct(right_container.ptr());
|
||||||
button_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
button_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||||
button_container->set_preferred_size(0, 20);
|
button_container->set_preferred_size(0, 20);
|
||||||
button_container->set_layout(make<HBoxLayout>());
|
button_container->set_layout(make<HorizontalBoxLayout>());
|
||||||
button_container->layout()->add_spacer();
|
button_container->layout()->add_spacer();
|
||||||
auto ok_button = Button::construct("OK", button_container);
|
auto ok_button = Button::construct("OK", button_container);
|
||||||
ok_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
|
ok_button->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed);
|
||||||
|
|
|
@ -44,22 +44,22 @@ private:
|
||||||
Orientation m_orientation;
|
Orientation m_orientation;
|
||||||
};
|
};
|
||||||
|
|
||||||
class VBoxLayout final : public BoxLayout {
|
class VerticalBoxLayout final : public BoxLayout {
|
||||||
public:
|
public:
|
||||||
explicit VBoxLayout()
|
explicit VerticalBoxLayout()
|
||||||
: BoxLayout(Orientation::Vertical)
|
: BoxLayout(Orientation::Vertical)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual ~VBoxLayout() override {}
|
virtual ~VerticalBoxLayout() override {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class HBoxLayout final : public BoxLayout {
|
class HorizontalBoxLayout final : public BoxLayout {
|
||||||
public:
|
public:
|
||||||
explicit HBoxLayout()
|
explicit HorizontalBoxLayout()
|
||||||
: BoxLayout(Orientation::Horizontal)
|
: BoxLayout(Orientation::Horizontal)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual ~HBoxLayout() override {}
|
virtual ~HorizontalBoxLayout() override {}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,15 +49,15 @@ void ColorPicker::build()
|
||||||
{
|
{
|
||||||
auto horizontal_container = Widget::construct();
|
auto horizontal_container = Widget::construct();
|
||||||
horizontal_container->set_fill_with_background_color(true);
|
horizontal_container->set_fill_with_background_color(true);
|
||||||
horizontal_container->set_layout(make<HBoxLayout>());
|
horizontal_container->set_layout(make<HorizontalBoxLayout>());
|
||||||
horizontal_container->layout()->set_margins({ 4, 4, 4, 4 });
|
horizontal_container->layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
set_main_widget(horizontal_container);
|
set_main_widget(horizontal_container);
|
||||||
|
|
||||||
auto left_vertical_container = Widget::construct(horizontal_container.ptr());
|
auto left_vertical_container = Widget::construct(horizontal_container.ptr());
|
||||||
left_vertical_container->set_layout(make<VBoxLayout>());
|
left_vertical_container->set_layout(make<VerticalBoxLayout>());
|
||||||
|
|
||||||
auto right_vertical_container = Widget::construct(horizontal_container.ptr());
|
auto right_vertical_container = Widget::construct(horizontal_container.ptr());
|
||||||
right_vertical_container->set_layout(make<VBoxLayout>());
|
right_vertical_container->set_layout(make<VerticalBoxLayout>());
|
||||||
|
|
||||||
enum RGBComponent {
|
enum RGBComponent {
|
||||||
Red,
|
Red,
|
||||||
|
|
|
@ -82,16 +82,16 @@ FilePicker::FilePicker(Mode mode, const StringView& file_name, const StringView&
|
||||||
set_rect(200, 200, 700, 400);
|
set_rect(200, 200, 700, 400);
|
||||||
auto horizontal_container = Widget::construct();
|
auto horizontal_container = Widget::construct();
|
||||||
set_main_widget(horizontal_container);
|
set_main_widget(horizontal_container);
|
||||||
horizontal_container->set_layout(make<HBoxLayout>());
|
horizontal_container->set_layout(make<HorizontalBoxLayout>());
|
||||||
horizontal_container->layout()->set_margins({ 4, 4, 4, 4 });
|
horizontal_container->layout()->set_margins({ 4, 4, 4, 4 });
|
||||||
horizontal_container->set_fill_with_background_color(true);
|
horizontal_container->set_fill_with_background_color(true);
|
||||||
|
|
||||||
auto vertical_container = Widget::construct(horizontal_container.ptr());
|
auto vertical_container = Widget::construct(horizontal_container.ptr());
|
||||||
vertical_container->set_layout(make<VBoxLayout>());
|
vertical_container->set_layout(make<VerticalBoxLayout>());
|
||||||
vertical_container->layout()->set_spacing(4);
|
vertical_container->layout()->set_spacing(4);
|
||||||
|
|
||||||
auto upper_container = Widget::construct(vertical_container.ptr());
|
auto upper_container = Widget::construct(vertical_container.ptr());
|
||||||
upper_container->set_layout(make<HBoxLayout>());
|
upper_container->set_layout(make<HorizontalBoxLayout>());
|
||||||
upper_container->layout()->set_spacing(4);
|
upper_container->layout()->set_spacing(4);
|
||||||
upper_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
upper_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||||
upper_container->set_preferred_size(0, 26);
|
upper_container->set_preferred_size(0, 26);
|
||||||
|
@ -149,7 +149,7 @@ FilePicker::FilePicker(Mode mode, const StringView& file_name, const StringView&
|
||||||
toolbar->add_action(*mkdir_action);
|
toolbar->add_action(*mkdir_action);
|
||||||
|
|
||||||
auto lower_container = Widget::construct(vertical_container.ptr());
|
auto lower_container = Widget::construct(vertical_container.ptr());
|
||||||
lower_container->set_layout(make<VBoxLayout>());
|
lower_container->set_layout(make<VerticalBoxLayout>());
|
||||||
lower_container->layout()->set_spacing(4);
|
lower_container->layout()->set_spacing(4);
|
||||||
lower_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
lower_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||||
lower_container->set_preferred_size(0, 60);
|
lower_container->set_preferred_size(0, 60);
|
||||||
|
@ -157,7 +157,7 @@ FilePicker::FilePicker(Mode mode, const StringView& file_name, const StringView&
|
||||||
auto filename_container = Widget::construct(lower_container.ptr());
|
auto filename_container = Widget::construct(lower_container.ptr());
|
||||||
filename_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
filename_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||||
filename_container->set_preferred_size(0, 20);
|
filename_container->set_preferred_size(0, 20);
|
||||||
filename_container->set_layout(make<HBoxLayout>());
|
filename_container->set_layout(make<HorizontalBoxLayout>());
|
||||||
auto filename_label = Label::construct("File name:", filename_container);
|
auto filename_label = Label::construct("File name:", filename_container);
|
||||||
filename_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
filename_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||||
filename_label->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
|
filename_label->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill);
|
||||||
|
@ -188,7 +188,7 @@ FilePicker::FilePicker(Mode mode, const StringView& file_name, const StringView&
|
||||||
auto button_container = Widget::construct(lower_container.ptr());
|
auto button_container = Widget::construct(lower_container.ptr());
|
||||||
button_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
button_container->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||||
button_container->set_preferred_size(0, 20);
|
button_container->set_preferred_size(0, 20);
|
||||||
button_container->set_layout(make<HBoxLayout>());
|
button_container->set_layout(make<HorizontalBoxLayout>());
|
||||||
button_container->layout()->set_spacing(4);
|
button_container->layout()->set_spacing(4);
|
||||||
button_container->layout()->add_spacer();
|
button_container->layout()->add_spacer();
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ FilePicker::FilePicker(Mode mode, const StringView& file_name, const StringView&
|
||||||
preview_container->set_frame_shape(Gfx::FrameShape::Container);
|
preview_container->set_frame_shape(Gfx::FrameShape::Container);
|
||||||
preview_container->set_frame_shadow(Gfx::FrameShadow::Sunken);
|
preview_container->set_frame_shadow(Gfx::FrameShadow::Sunken);
|
||||||
preview_container->set_frame_thickness(2);
|
preview_container->set_frame_thickness(2);
|
||||||
preview_container->set_layout(make<VBoxLayout>());
|
preview_container->set_layout(make<VerticalBoxLayout>());
|
||||||
preview_container->layout()->set_margins({ 8, 8, 8, 8 });
|
preview_container->layout()->set_margins({ 8, 8, 8, 8 });
|
||||||
|
|
||||||
m_preview_image_label = Label::construct(preview_container);
|
m_preview_image_label = Label::construct(preview_container);
|
||||||
|
|
|
@ -56,7 +56,7 @@ void InputBox::build()
|
||||||
|
|
||||||
set_rect(x(), y(), max_width + 80, 80);
|
set_rect(x(), y(), max_width + 80, 80);
|
||||||
|
|
||||||
widget->set_layout(make<VBoxLayout>());
|
widget->set_layout(make<VerticalBoxLayout>());
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
|
|
||||||
widget->layout()->set_margins({ 8, 8, 8, 8 });
|
widget->layout()->set_margins({ 8, 8, 8, 8 });
|
||||||
|
@ -73,10 +73,10 @@ void InputBox::build()
|
||||||
auto button_container_outer = Widget::construct(widget.ptr());
|
auto button_container_outer = Widget::construct(widget.ptr());
|
||||||
button_container_outer->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
button_container_outer->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||||
button_container_outer->set_preferred_size(0, 20);
|
button_container_outer->set_preferred_size(0, 20);
|
||||||
button_container_outer->set_layout(make<VBoxLayout>());
|
button_container_outer->set_layout(make<VerticalBoxLayout>());
|
||||||
|
|
||||||
auto button_container_inner = Widget::construct(button_container_outer.ptr());
|
auto button_container_inner = Widget::construct(button_container_outer.ptr());
|
||||||
button_container_inner->set_layout(make<HBoxLayout>());
|
button_container_inner->set_layout(make<HorizontalBoxLayout>());
|
||||||
button_container_inner->layout()->set_spacing(8);
|
button_container_inner->layout()->set_spacing(8);
|
||||||
|
|
||||||
m_cancel_button = Button::construct(button_container_inner);
|
m_cancel_button = Button::construct(button_container_inner);
|
||||||
|
|
|
@ -84,7 +84,7 @@ void MessageBox::build()
|
||||||
int text_width = widget->font().width(m_text);
|
int text_width = widget->font().width(m_text);
|
||||||
int icon_width = 0;
|
int icon_width = 0;
|
||||||
|
|
||||||
widget->set_layout(make<VBoxLayout>());
|
widget->set_layout(make<VerticalBoxLayout>());
|
||||||
widget->set_fill_with_background_color(true);
|
widget->set_fill_with_background_color(true);
|
||||||
|
|
||||||
widget->layout()->set_margins({ 0, 15, 0, 15 });
|
widget->layout()->set_margins({ 0, 15, 0, 15 });
|
||||||
|
@ -93,7 +93,7 @@ void MessageBox::build()
|
||||||
RefPtr<Widget> message_container = widget;
|
RefPtr<Widget> message_container = widget;
|
||||||
if (m_type != Type::None) {
|
if (m_type != Type::None) {
|
||||||
message_container = Widget::construct(widget.ptr());
|
message_container = Widget::construct(widget.ptr());
|
||||||
message_container->set_layout(make<HBoxLayout>());
|
message_container->set_layout(make<HorizontalBoxLayout>());
|
||||||
message_container->layout()->set_margins({ 8, 0, 8, 0 });
|
message_container->layout()->set_margins({ 8, 0, 8, 0 });
|
||||||
message_container->layout()->set_spacing(8);
|
message_container->layout()->set_spacing(8);
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ void MessageBox::build()
|
||||||
label->set_preferred_size(text_width, 16);
|
label->set_preferred_size(text_width, 16);
|
||||||
|
|
||||||
auto button_container = Widget::construct(widget.ptr());
|
auto button_container = Widget::construct(widget.ptr());
|
||||||
button_container->set_layout(make<HBoxLayout>());
|
button_container->set_layout(make<HorizontalBoxLayout>());
|
||||||
button_container->layout()->set_spacing(5);
|
button_container->layout()->set_spacing(5);
|
||||||
button_container->layout()->set_margins({ 15, 0, 15, 0 });
|
button_container->layout()->set_margins({ 15, 0, 15, 0 });
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ StatusBar::StatusBar(int label_count, Widget* parent)
|
||||||
{
|
{
|
||||||
set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
|
||||||
set_preferred_size(0, 20);
|
set_preferred_size(0, 20);
|
||||||
set_layout(make<HBoxLayout>());
|
set_layout(make<HorizontalBoxLayout>());
|
||||||
layout()->set_margins({ 2, 2, 2, 2 });
|
layout()->set_margins({ 2, 2, 2, 2 });
|
||||||
layout()->set_spacing(2);
|
layout()->set_spacing(2);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue