Fix compilation errors with applet feature

This commit is contained in:
Ian Douglas Scott 2023-08-15 13:44:06 -07:00 • committed by Ashley Wulber
parent c1495d07e5
commit 9f36d33e34

View file

@ -104,7 +104,7 @@ impl CosmicAppletHelper {
let (width, height) = self.suggested_size(); let (width, height) = self.suggested_size();
let width = u32::from(width); let width = u32::from(width);
let height = u32::from(height); let height = u32::from(height);
let settings = super::Settings::default() let mut settings = super::Settings::default()
.size((width + APPLET_PADDING * 2, height + APPLET_PADDING * 2)) .size((width + APPLET_PADDING * 2, height + APPLET_PADDING * 2))
.size_limits( .size_limits(
Limits::NONE Limits::NONE
@ -118,7 +118,7 @@ impl CosmicAppletHelper {
.default_font(crate::font::FONT) .default_font(crate::font::FONT)
.transparent(true); .transparent(true);
if let Some(theme) = self.theme() { if let Some(theme) = self.theme() {
settings.theme(theme); settings = settings.theme(theme);
} }
settings settings
} }
@ -204,8 +204,8 @@ impl CosmicAppletHelper {
#[must_use] #[must_use]
pub fn theme(&self) -> Option<theme::Theme> { pub fn theme(&self) -> Option<theme::Theme> {
match self.background { match self.background {
CosmicPanelBackground::Dark => theme::Theme::dark(), CosmicPanelBackground::Dark => Some(theme::Theme::dark()),
CosmicPanelBackground::Light => theme::Theme::light(), CosmicPanelBackground::Light => Some(theme::Theme::light()),
_ => None, _ => None,
} }
} }