mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +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:
parent
66402b0666
commit
6c6af8ae4e
2 changed files with 6 additions and 6 deletions
|
@ -36,7 +36,7 @@
|
||||||
namespace ThemeEditor {
|
namespace ThemeEditor {
|
||||||
|
|
||||||
static const PropertyTab window_tab {
|
static const PropertyTab window_tab {
|
||||||
"Windows",
|
"Windows"sv,
|
||||||
{
|
{
|
||||||
{ "General",
|
{ "General",
|
||||||
{ { Gfx::FlagRole::IsDark },
|
{ { Gfx::FlagRole::IsDark },
|
||||||
|
@ -92,7 +92,7 @@ static const PropertyTab window_tab {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PropertyTab widgets_tab {
|
static const PropertyTab widgets_tab {
|
||||||
"Widgets",
|
"Widgets"sv,
|
||||||
{
|
{
|
||||||
{ "General",
|
{ "General",
|
||||||
{ { Gfx::ColorRole::Accent },
|
{ { Gfx::ColorRole::Accent },
|
||||||
|
@ -161,7 +161,7 @@ static const PropertyTab widgets_tab {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PropertyTab syntax_highlighting_tab {
|
static const PropertyTab syntax_highlighting_tab {
|
||||||
"Syntax Highlighting",
|
"Syntax Highlighting"sv,
|
||||||
{
|
{
|
||||||
{ "General",
|
{ "General",
|
||||||
{ { Gfx::ColorRole::SyntaxComment },
|
{ { Gfx::ColorRole::SyntaxComment },
|
||||||
|
@ -185,7 +185,7 @@ static const PropertyTab syntax_highlighting_tab {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const PropertyTab color_scheme_tab {
|
static const PropertyTab color_scheme_tab {
|
||||||
"Color Scheme",
|
"Color Scheme"sv,
|
||||||
{
|
{
|
||||||
{ "General",
|
{ "General",
|
||||||
{ { Gfx::FlagRole::BoldTextAsBright },
|
{ { Gfx::FlagRole::BoldTextAsBright },
|
||||||
|
@ -435,7 +435,7 @@ void MainWidget::build_override_controls()
|
||||||
|
|
||||||
ErrorOr<void> MainWidget::add_property_tab(PropertyTab const& property_tab)
|
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);
|
scrollable_container->set_should_hide_unnecessary_scrollbars(true);
|
||||||
|
|
||||||
auto properties_list = TRY(GUI::Widget::try_create());
|
auto properties_list = TRY(GUI::Widget::try_create());
|
||||||
|
|
|
@ -72,7 +72,7 @@ struct PropertyGroup {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PropertyTab {
|
struct PropertyTab {
|
||||||
DeprecatedString title;
|
StringView title;
|
||||||
Vector<PropertyGroup> property_groups;
|
Vector<PropertyGroup> property_groups;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue