From 46b25d42182c3d08586f946354a2ef8b275289c2 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Fri, 19 Jun 2026 00:48:09 -0400 Subject: [PATCH] refactor: allow for transparent header --- src/app/mod.rs | 9 +++++++-- src/core.rs | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/mod.rs b/src/app/mod.rs index 99ea6e53..f757d5be 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -22,7 +22,7 @@ use crate::prelude::*; use crate::theme::THEME; use crate::widget::{container, id_container, menu, nav_bar, popover, space}; use apply::Apply; -use iced::{Length, Subscription, theme, window}; +use iced::{Color, Length, Subscription, theme, window}; pub use settings::Settings; use std::borrow::Cow; use std::cell::RefCell; @@ -625,6 +625,7 @@ impl ApplicationExt for App { let content_container = core.window.content_container; let show_context = core.window.show_context; let nav_bar_active = core.nav_bar_active(); + let transparent_header = core.window.transparent_header; let focused = core .focus_chain() .iter() @@ -833,7 +834,11 @@ impl ApplicationExt for App { let cosmic = theme.cosmic(); container::Style { background: Some(iced::Background::Color( - cosmic.background(theme.transparent).base.into(), + if transparent_header { + Color::TRANSPARENT + } else { + cosmic.background(theme.transparent).base.into() + }, )), border: iced::Border { radius: [ diff --git a/src/core.rs b/src/core.rs index a8691d11..0ca555e3 100644 --- a/src/core.rs +++ b/src/core.rs @@ -39,6 +39,7 @@ pub struct Window { pub show_close: bool, pub show_maximize: bool, pub show_minimize: bool, + pub transparent_header: bool, pub is_maximized: bool, height: f32, width: f32, @@ -169,6 +170,7 @@ impl Default for Core { show_minimize: true, show_window_menu: false, is_maximized: false, + transparent_header: false, height: 0., width: 0., },