1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

ThemeEditor: Store tab title in PropertyTabs as StringView

Removes a hop that creates a deprecated string.

We cannot store the title directly as a String, because we would have to
find a way to propagate the errors during constructing global static
objects.
This commit is contained in:
Karol Kosek 2023-03-10 21:20:56 +01:00 committed by Andreas Kling
parent 66402b0666
commit 6c6af8ae4e
2 changed files with 6 additions and 6 deletions

View file

@ -36,7 +36,7 @@
namespace ThemeEditor {
static const PropertyTab window_tab {
"Windows",
"Windows"sv,
{
{ "General",
{ { Gfx::FlagRole::IsDark },
@ -92,7 +92,7 @@ static const PropertyTab window_tab {
};
static const PropertyTab widgets_tab {
"Widgets",
"Widgets"sv,
{
{ "General",
{ { Gfx::ColorRole::Accent },
@ -161,7 +161,7 @@ static const PropertyTab widgets_tab {
};
static const PropertyTab syntax_highlighting_tab {
"Syntax Highlighting",
"Syntax Highlighting"sv,
{
{ "General",
{ { Gfx::ColorRole::SyntaxComment },
@ -185,7 +185,7 @@ static const PropertyTab syntax_highlighting_tab {
};
static const PropertyTab color_scheme_tab {
"Color Scheme",
"Color Scheme"sv,
{
{ "General",
{ { Gfx::FlagRole::BoldTextAsBright },
@ -435,7 +435,7 @@ void MainWidget::build_override_controls()
ErrorOr<void> MainWidget::add_property_tab(PropertyTab const& property_tab)
{
auto scrollable_container = TRY(m_property_tabs->try_add_tab<GUI::ScrollableContainerWidget>(TRY(String::from_deprecated_string(property_tab.title))));
auto scrollable_container = TRY(m_property_tabs->try_add_tab<GUI::ScrollableContainerWidget>(TRY(String::from_utf8(property_tab.title))));
scrollable_container->set_should_hide_unnecessary_scrollbars(true);
auto properties_list = TRY(GUI::Widget::try_create());