fix(desktop): header bar styling

This effectively reverts commit 19c2cefd8a.
The changes don't seem to be necessary anymore. and this ensures the header bar matches the theme.
This commit is contained in:
Vukašin Vojinović 2025-09-08 18:28:17 +02:00 • committed by Jeremy Soller
parent 3ee1a07f09
commit f0cce9a81f
4 changed files with 28 additions and 66 deletions

46
Cargo.lock generated
View file

@ -1495,8 +1495,8 @@ dependencies = [
"jxl-oxide", "jxl-oxide",
"libc", "libc",
"libcosmic", "libcosmic",
"liblzma",
"log", "log",
"lzma-rust2",
"md-5", "md-5",
"mime_guess", "mime_guess",
"notify-debouncer-full", "notify-debouncer-full",
@ -3932,9 +3932,9 @@ dependencies = [
[[package]] [[package]]
name = "indexmap" name = "indexmap"
version = "2.11.0" version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" checksum = "206a8042aec68fa4a62e8d3f7aa4ceb508177d9324faf261e1959e495b7a1921"
dependencies = [ dependencies = [
"equivalent", "equivalent",
"hashbrown 0.15.5", "hashbrown 0.15.5",
@ -4530,26 +4530,6 @@ dependencies = [
"windows-targets 0.53.3", "windows-targets 0.53.3",
] ]
[[package]]
name = "liblzma"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10bf66f4598dc77ff96677c8e763655494f00ff9c1cf79e2eb5bb07bc31f807d"
dependencies = [
"liblzma-sys",
]
[[package]]
name = "liblzma-sys"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01b9596486f6d60c3bbe644c0e1be1aa6ccc472ad630fe8927b456973d7cb736"
dependencies = [
"cc",
"libc",
"pkg-config",
]
[[package]] [[package]]
name = "libm" name = "libm"
version = "0.2.15" version = "0.2.15"
@ -4922,7 +4902,7 @@ dependencies = [
"cfg_aliases 0.1.1", "cfg_aliases 0.1.1",
"codespan-reporting", "codespan-reporting",
"hexf-parse", "hexf-parse",
"indexmap 2.11.0", "indexmap 2.11.1",
"log", "log",
"rustc-hash 1.1.0", "rustc-hash 1.1.0",
"spirv", "spirv",
@ -5502,11 +5482,11 @@ dependencies = [
[[package]] [[package]]
name = "ordermap" name = "ordermap"
version = "0.5.9" version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fd6fedcd996c8c97932075cc3811d83f53280f48d5620e4e3cab7f6a12678c4" checksum = "0dcd63f1ae4b091e314a26627c467dd8810d674ba798abc0e566679955776c63"
dependencies = [ dependencies = [
"indexmap 2.11.0", "indexmap 2.11.1",
"serde", "serde",
] ]
@ -6627,7 +6607,7 @@ version = "1.0.143"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
dependencies = [ dependencies = [
"indexmap 2.11.0", "indexmap 2.11.1",
"itoa", "itoa",
"memchr", "memchr",
"ryu", "ryu",
@ -6664,7 +6644,7 @@ dependencies = [
"chrono", "chrono",
"hex", "hex",
"indexmap 1.9.3", "indexmap 1.9.3",
"indexmap 2.11.0", "indexmap 2.11.1",
"schemars 0.9.0", "schemars 0.9.0",
"schemars 1.0.4", "schemars 1.0.4",
"serde", "serde",
@ -7416,7 +7396,7 @@ version = "0.19.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [ dependencies = [
"indexmap 2.11.0", "indexmap 2.11.1",
"toml_datetime", "toml_datetime",
"winnow 0.5.40", "winnow 0.5.40",
] ]
@ -7427,7 +7407,7 @@ version = "0.22.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [ dependencies = [
"indexmap 2.11.0", "indexmap 2.11.1",
"serde", "serde",
"serde_spanned", "serde_spanned",
"toml_datetime", "toml_datetime",
@ -8086,7 +8066,7 @@ dependencies = [
"bitflags 2.9.4", "bitflags 2.9.4",
"cfg_aliases 0.1.1", "cfg_aliases 0.1.1",
"document-features", "document-features",
"indexmap 2.11.0", "indexmap 2.11.1",
"log", "log",
"naga", "naga",
"once_cell", "once_cell",
@ -9324,7 +9304,7 @@ dependencies = [
"flate2", "flate2",
"getrandom 0.3.3", "getrandom 0.3.3",
"hmac", "hmac",
"indexmap 2.11.0", "indexmap 2.11.1",
"lzma-rust2", "lzma-rust2",
"memchr", "memchr",
"pbkdf2", "pbkdf2",

View file

@ -51,8 +51,8 @@ xdg-mime = { git = "https://github.com/ellieplayswow/xdg-mime-rs", branch = "fea
bzip2 = { version = "0.6", optional = true } #TODO: replace with pure Rust crate bzip2 = { version = "0.6", optional = true } #TODO: replace with pure Rust crate
flate2 = "1.1" flate2 = "1.1"
tar = "0.4.44" tar = "0.4.44"
liblzma = { version = "0.4.4", optional = true } #TODO: replace with pure Rust crate lzma-rust2 = { version = "0.13", optional = true }
ordermap = { version = "0.5.9", features = ["serde"] } ordermap = { version = "0.5.10", features = ["serde"] }
# Internationalization # Internationalization
i18n-embed = { version = "0.16", features = [ i18n-embed = { version = "0.16", features = [
"fluent-system", "fluent-system",
@ -92,10 +92,10 @@ default = [
"desktop", "desktop",
"gvfs", "gvfs",
"io-uring", "io-uring",
"lzma-rust2",
"notify", "notify",
"wgpu", "wgpu",
"wayland", "wayland",
"liblzma",
] ]
dbus-config = ["libcosmic/dbus-config"] dbus-config = ["libcosmic/dbus-config"]
desktop = [ desktop = [

View file

@ -301,7 +301,6 @@ impl MenuAction for NavMenuAction {
pub enum Message { pub enum Message {
AddToSidebar(Option<Entity>), AddToSidebar(Option<Entity>),
AppTheme(AppTheme), AppTheme(AppTheme),
CloseId(window::Id),
CloseToast(widget::ToastId), CloseToast(widget::ToastId),
Compress(Option<Entity>), Compress(Option<Entity>),
Config(Config), Config(Config),
@ -314,7 +313,6 @@ pub enum Message {
DesktopDialogs(bool), DesktopDialogs(bool),
DialogCancel, DialogCancel,
DialogComplete, DialogComplete,
DragId(window::Id),
Eject, Eject,
FileDialogMessage(DialogMessage), FileDialogMessage(DialogMessage),
DialogPush(DialogPage), DialogPush(DialogPage),
@ -2642,7 +2640,7 @@ impl Application for App {
} }
Message::DesktopViewOptions => { Message::DesktopViewOptions => {
let mut settings = window::Settings { let mut settings = window::Settings {
decorations: false, decorations: true,
min_size: Some(Size::new(360.0, 180.0)), min_size: Some(Size::new(360.0, 180.0)),
resizable: true, resizable: true,
size: Size::new(480.0, 444.0), size: Size::new(480.0, 444.0),
@ -3540,7 +3538,7 @@ impl Application for App {
let mut commands = Vec::with_capacity(selected_paths.len()); let mut commands = Vec::with_capacity(selected_paths.len());
for path in selected_paths { for path in selected_paths {
let mut settings = window::Settings { let mut settings = window::Settings {
decorations: false, decorations: true,
min_size: Some(Size::new(360.0, 180.0)), min_size: Some(Size::new(360.0, 180.0)),
resizable: true, resizable: true,
size: Size::new(480.0, 600.0), size: Size::new(480.0, 600.0),
@ -4678,12 +4676,6 @@ impl Application for App {
} }
} }
} }
Message::CloseId(id) => {
return window::close(id);
}
Message::DragId(id) => {
return window::drag(id);
}
Message::NetworkDriveOpenEntityAfterMount { entity } => { Message::NetworkDriveOpenEntityAfterMount { entity } => {
return self.on_nav_select(entity); return self.on_nav_select(entity);
} }
@ -5761,21 +5753,11 @@ impl Application for App {
} }
}; };
widget::container( widget::container(widget::scrollable(content))
widget::column::column() .width(Length::Fill)
.push(Element::from( .height(Length::Fill)
widget::header_bar() .class(theme::Container::WindowBackground)
.on_close(Message::CloseId(id)) .into()
.on_drag(Message::DragId(id))
.build(),
))
.push(widget::scrollable(content))
.width(Length::Fill),
)
.width(Length::Fill)
.height(Length::Fill)
.class(theme::Container::WindowBackground)
.into()
} }
fn system_theme_update( fn system_theme_update(

View file

@ -24,9 +24,9 @@ pub const SUPPORTED_ARCHIVE_TYPES: &[&str] = &[
"application/x-bzip2", "application/x-bzip2",
#[cfg(feature = "bzip2")] #[cfg(feature = "bzip2")]
"application/x-bzip2-compressed-tar", "application/x-bzip2-compressed-tar",
#[cfg(feature = "liblzma")] #[cfg(feature = "lzma-rust2")]
"application/x-xz", "application/x-xz",
#[cfg(feature = "liblzma")] #[cfg(feature = "lzma-rust2")]
"application/x-xz-compressed-tar", "application/x-xz-compressed-tar",
]; ];
@ -86,11 +86,11 @@ pub fn extract(
.map(tar::Archive::new) .map(tar::Archive::new)
.and_then(|mut archive| archive.unpack(new_dir)) .and_then(|mut archive| archive.unpack(new_dir))
.map_err(|e| OperationError::from_err(e, controller))?, .map_err(|e| OperationError::from_err(e, controller))?,
#[cfg(feature = "liblzma")] #[cfg(feature = "lzma-rust2")]
"application/x-xz" | "application/x-xz-compressed-tar" => { "application/x-xz" | "application/x-xz-compressed-tar" => {
OpReader::new(path, controller.clone()) OpReader::new(path, controller.clone())
.map(io::BufReader::new) .map(io::BufReader::new)
.map(liblzma::read::XzDecoder::new) .map(|reader| lzma_rust2::XzReader::new(reader, true))
.map(tar::Archive::new) .map(tar::Archive::new)
.and_then(|mut archive| archive.unpack(new_dir)) .and_then(|mut archive| archive.unpack(new_dir))
.map_err(|e| OperationError::from_err(e, controller))? .map_err(|e| OperationError::from_err(e, controller))?
@ -151,7 +151,7 @@ fn zip_extract<R: io::Read + io::Seek, P: AsRef<Path>>(
}?; }?;
let filepath = file let filepath = file
.enclosed_name() .enclosed_name()
.ok_or(ZipError::InvalidArchive("Invalid file path"))?; .ok_or(ZipError::InvalidArchive("Invalid file path".into()))?;
let outpath = directory.as_ref().join(filepath); let outpath = directory.as_ref().join(filepath);