TextEditor: Move the "find" and "replace" widget containers to JSON GUI

This commit is contained in:
Andreas Kling 2020-09-14 13:01:32 +02:00
parent 6590eb8eb7
commit 8a7935a29f
Notes: sideshowbarker 2024-07-19 02:25:33 +09:00
2 changed files with 27 additions and 11 deletions

View file

@ -40,7 +40,31 @@
"layout": {
"class": "GUI::VerticalBoxLayout",
"margins": [ 2, 2, 2, 4 ]
}
},
"children": [
{
"class": "GUI::Widget",
"name": "find_widget",
"fill_with_background_color": true,
"horizontal_size_policy": "Fill",
"vertical_size_policy": "Fixed",
"preferred_height": 22,
"layout": {
"class": "GUI::HorizontalBoxLayout"
}
},
{
"class": "GUI::Widget",
"name": "replace_widget",
"fill_with_background_color": true,
"horizontal_size_policy": "Fill",
"vertical_size_policy": "Fixed",
"preferred_height": 22,
"layout": {
"class": "GUI::HorizontalBoxLayout"
}
}
]
},
{
"class": "GUI::StatusBar",

View file

@ -105,18 +105,10 @@ TextEditorWidget::TextEditorWidget()
m_find_replace_widget = *find_descendant_by_name("find_replace_widget");
m_find_replace_widget->set_visible(false);
m_find_widget = m_find_replace_widget->add<GUI::Widget>();
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_preferred_size(0, 22);
m_find_widget->set_layout<GUI::HorizontalBoxLayout>();
m_find_widget = *find_descendant_by_name("find_widget");
m_find_widget->set_visible(false);
m_replace_widget = m_find_replace_widget->add<GUI::Widget>();
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_preferred_size(0, 22);
m_replace_widget->set_layout<GUI::HorizontalBoxLayout>();
m_replace_widget = *find_descendant_by_name("replace_widget");
m_replace_widget->set_visible(false);
m_find_textbox = m_find_widget->add<GUI::TextBox>();