refactor: allow for transparent header
This commit is contained in:
parent
9855d8b6fd
commit
46b25d4218
2 changed files with 9 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ use crate::prelude::*;
|
||||||
use crate::theme::THEME;
|
use crate::theme::THEME;
|
||||||
use crate::widget::{container, id_container, menu, nav_bar, popover, space};
|
use crate::widget::{container, id_container, menu, nav_bar, popover, space};
|
||||||
use apply::Apply;
|
use apply::Apply;
|
||||||
use iced::{Length, Subscription, theme, window};
|
use iced::{Color, Length, Subscription, theme, window};
|
||||||
pub use settings::Settings;
|
pub use settings::Settings;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
|
@ -625,6 +625,7 @@ impl<App: Application> ApplicationExt for App {
|
||||||
let content_container = core.window.content_container;
|
let content_container = core.window.content_container;
|
||||||
let show_context = core.window.show_context;
|
let show_context = core.window.show_context;
|
||||||
let nav_bar_active = core.nav_bar_active();
|
let nav_bar_active = core.nav_bar_active();
|
||||||
|
let transparent_header = core.window.transparent_header;
|
||||||
let focused = core
|
let focused = core
|
||||||
.focus_chain()
|
.focus_chain()
|
||||||
.iter()
|
.iter()
|
||||||
|
|
@ -833,7 +834,11 @@ impl<App: Application> ApplicationExt for App {
|
||||||
let cosmic = theme.cosmic();
|
let cosmic = theme.cosmic();
|
||||||
container::Style {
|
container::Style {
|
||||||
background: Some(iced::Background::Color(
|
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 {
|
border: iced::Border {
|
||||||
radius: [
|
radius: [
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ pub struct Window {
|
||||||
pub show_close: bool,
|
pub show_close: bool,
|
||||||
pub show_maximize: bool,
|
pub show_maximize: bool,
|
||||||
pub show_minimize: bool,
|
pub show_minimize: bool,
|
||||||
|
pub transparent_header: bool,
|
||||||
pub is_maximized: bool,
|
pub is_maximized: bool,
|
||||||
height: f32,
|
height: f32,
|
||||||
width: f32,
|
width: f32,
|
||||||
|
|
@ -169,6 +170,7 @@ impl Default for Core {
|
||||||
show_minimize: true,
|
show_minimize: true,
|
||||||
show_window_menu: false,
|
show_window_menu: false,
|
||||||
is_maximized: false,
|
is_maximized: false,
|
||||||
|
transparent_header: false,
|
||||||
height: 0.,
|
height: 0.,
|
||||||
width: 0.,
|
width: 0.,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue