mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
TextEditor: Move the find/replace buttons to JSON GUI
This commit is contained in:
parent
093de0e323
commit
119a0c5dee
Notes:
sideshowbarker
2024-07-19 02:25:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/119a0c5deee
@ -53,7 +53,25 @@
|
||||
"preferred_height": 22,
|
||||
"layout": {
|
||||
"class": "GUI::HorizontalBoxLayout"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"class": "GUI::Button",
|
||||
"name": "find_previous_button",
|
||||
"text": "Find previous",
|
||||
"horizontal_size_policy": "Fixed",
|
||||
"vertical_size_policy": "Fill",
|
||||
"preferred_width": 150
|
||||
},
|
||||
{
|
||||
"class": "GUI::Button",
|
||||
"name": "find_next_button",
|
||||
"text": "Find next",
|
||||
"horizontal_size_policy": "Fixed",
|
||||
"vertical_size_policy": "Fill",
|
||||
"preferred_width": 150
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"class": "GUI::Widget",
|
||||
@ -64,7 +82,33 @@
|
||||
"preferred_height": 22,
|
||||
"layout": {
|
||||
"class": "GUI::HorizontalBoxLayout"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"class": "GUI::Button",
|
||||
"name": "replace_previous_button",
|
||||
"text": "Replace previous",
|
||||
"horizontal_size_policy": "Fixed",
|
||||
"vertical_size_policy": "Fill",
|
||||
"preferred_width": 100
|
||||
},
|
||||
{
|
||||
"class": "GUI::Button",
|
||||
"name": "replace_next_button",
|
||||
"text": "Replace next",
|
||||
"horizontal_size_policy": "Fixed",
|
||||
"vertical_size_policy": "Fill",
|
||||
"preferred_width": 100
|
||||
},
|
||||
{
|
||||
"class": "GUI::Button",
|
||||
"name": "replace_all_button",
|
||||
"text": "Replace all",
|
||||
"horizontal_size_policy": "Fixed",
|
||||
"vertical_size_policy": "Fill",
|
||||
"preferred_width": 100
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -213,14 +213,10 @@ TextEditorWidget::TextEditorWidget()
|
||||
}
|
||||
});
|
||||
|
||||
m_find_previous_button = m_find_widget->add<GUI::Button>("Find previous");
|
||||
m_find_previous_button->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
m_find_previous_button->set_preferred_size(150, 0);
|
||||
m_find_previous_button = static_cast<GUI::Button&>(*find_descendant_by_name("find_previous_button"));
|
||||
m_find_previous_button->set_action(*m_find_previous_action);
|
||||
|
||||
m_find_next_button = m_find_widget->add<GUI::Button>("Find next");
|
||||
m_find_next_button->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
m_find_next_button->set_preferred_size(150, 0);
|
||||
m_find_next_button = static_cast<GUI::Button&>(*find_descendant_by_name("find_next_button"));
|
||||
m_find_next_button->set_action(*m_find_next_action);
|
||||
|
||||
m_find_textbox->on_return_pressed = [this] {
|
||||
@ -232,19 +228,13 @@ TextEditorWidget::TextEditorWidget()
|
||||
m_editor->set_focus(true);
|
||||
};
|
||||
|
||||
m_replace_previous_button = m_replace_widget->add<GUI::Button>("Replace previous");
|
||||
m_replace_previous_button->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
m_replace_previous_button->set_preferred_size(100, 0);
|
||||
m_replace_previous_button = static_cast<GUI::Button&>(*find_descendant_by_name("replace_previous_button"));
|
||||
m_replace_previous_button->set_action(*m_replace_previous_action);
|
||||
|
||||
m_replace_next_button = m_replace_widget->add<GUI::Button>("Replace next");
|
||||
m_replace_next_button->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
m_replace_next_button->set_preferred_size(100, 0);
|
||||
m_replace_next_button = static_cast<GUI::Button&>(*find_descendant_by_name("replace_next_button"));
|
||||
m_replace_next_button->set_action(*m_replace_next_action);
|
||||
|
||||
m_replace_all_button = m_replace_widget->add<GUI::Button>("Replace all");
|
||||
m_replace_all_button->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||
m_replace_all_button->set_preferred_size(100, 0);
|
||||
m_replace_all_button = static_cast<GUI::Button&>(*find_descendant_by_name("replace_all_button"));
|
||||
m_replace_all_button->set_action(*m_replace_all_action);
|
||||
|
||||
m_replace_textbox->on_return_pressed = [this] {
|
||||
|
Loading…
Reference in New Issue
Block a user