From b5a6f810579c5397a801f21a9dfc5b45e95fcf2c Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Wed, 13 Sep 2023 15:41:38 +0200 Subject: [PATCH] chore(widget): use `push_maybe` in `settings::section` --- src/widget/settings/section.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/widget/settings/section.rs b/src/widget/settings/section.rs index 37e4af8d..9fde8131 100644 --- a/src/widget/settings/section.rs +++ b/src/widget/settings/section.rs @@ -1,6 +1,7 @@ // Copyright 2022 System76 // SPDX-License-Identifier: MPL-2.0 +use crate::ext::CollectionWidget; use crate::widget::{column, text, ListColumn}; use crate::Element; use std::borrow::Cow; @@ -32,7 +33,11 @@ impl<'a, Message: 'static> From> for Element<'a, Message> { fn from(data: Section<'a, Message>) -> Self { column::with_capacity(2) .spacing(8) - .push(text(data.title).font(crate::font::FONT_SEMIBOLD)) + .push_maybe(if data.title.is_empty() { + None + } else { + Some(text::heading(data.title)) + }) .push(data.children) .into() }