UI: Use decorator: text for close button

This commit is contained in:
Luke Street
2026-05-03 19:01:44 -06:00
parent 93e9767c9f
commit 6220990dc5
3 changed files with 3 additions and 7 deletions
+1 -1
+1 -3
View File
@@ -61,12 +61,10 @@ tab-bar[closable] close {
font-family: "Material Symbols Rounded";
font-weight: normal;
font-size: 24dp;
line-height: 48dp;
text-align: center;
text-transform: none;
color: rgba(224, 219, 200, 70%);
backdrop-filter: blur(2dp);
border-radius: 6dp;
decorator: text("" center center);
transition: color background-color 0.12s linear-in-out;
cursor: pointer;
}
+1 -3
View File
@@ -41,9 +41,7 @@ TabBar::TabBar(Rml::Element* parent, Props props)
: FluentComponent(createRoot(parent)), mProps(std::move(props)) {
if (mProps.onClose) {
mRoot->SetAttribute("closable", "");
auto& closeButton =
add_child<Button>(Button::Props{}, "close").on_pressed([this] { mProps.onClose(); });
closeButton.root()->SetInnerRML("&#xe5cd;");
add_child<Button>(Button::Props{}, "close").on_pressed([this] { mProps.onClose(); });
mEndSpacer = append(mRoot, "tab-end-spacer");
}