mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:28:13 +00:00
TextEditor: Set initial widget visibilities from JSON
This commit is contained in:
parent
6fc8dedd28
commit
89822c5ae7
2 changed files with 3 additions and 5 deletions
|
@ -26,13 +26,15 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"class": "Web::InProcessWebView",
|
"class": "Web::InProcessWebView",
|
||||||
"name": "webview"
|
"name": "webview",
|
||||||
|
"visible": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"class": "GUI::Widget",
|
"class": "GUI::Widget",
|
||||||
"name": "find_replace_widget",
|
"name": "find_replace_widget",
|
||||||
|
"visible": false,
|
||||||
"fill_with_background_color": true,
|
"fill_with_background_color": true,
|
||||||
"horizontal_size_policy": "Fill",
|
"horizontal_size_policy": "Fill",
|
||||||
"vertical_size_policy": "Fixed",
|
"vertical_size_policy": "Fixed",
|
||||||
|
|
|
@ -85,7 +85,6 @@ TextEditorWidget::TextEditorWidget()
|
||||||
};
|
};
|
||||||
|
|
||||||
m_page_view = static_cast<Web::InProcessWebView&>(*find_descendant_by_name("webview"));
|
m_page_view = static_cast<Web::InProcessWebView&>(*find_descendant_by_name("webview"));
|
||||||
m_page_view->set_visible(false);
|
|
||||||
m_page_view->on_link_hover = [this](auto& url) {
|
m_page_view->on_link_hover = [this](auto& url) {
|
||||||
if (url.is_valid())
|
if (url.is_valid())
|
||||||
m_statusbar->set_text(url.to_string());
|
m_statusbar->set_text(url.to_string());
|
||||||
|
@ -103,13 +102,10 @@ TextEditorWidget::TextEditorWidget()
|
||||||
};
|
};
|
||||||
|
|
||||||
m_find_replace_widget = *find_descendant_by_name("find_replace_widget");
|
m_find_replace_widget = *find_descendant_by_name("find_replace_widget");
|
||||||
m_find_replace_widget->set_visible(false);
|
|
||||||
|
|
||||||
m_find_widget = *find_descendant_by_name("find_widget");
|
m_find_widget = *find_descendant_by_name("find_widget");
|
||||||
m_find_widget->set_visible(false);
|
|
||||||
|
|
||||||
m_replace_widget = *find_descendant_by_name("replace_widget");
|
m_replace_widget = *find_descendant_by_name("replace_widget");
|
||||||
m_replace_widget->set_visible(false);
|
|
||||||
|
|
||||||
m_find_textbox = m_find_widget->add<GUI::TextBox>();
|
m_find_textbox = m_find_widget->add<GUI::TextBox>();
|
||||||
m_replace_textbox = m_replace_widget->add<GUI::TextBox>();
|
m_replace_textbox = m_replace_widget->add<GUI::TextBox>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue