chore: update dependencies

Also switches to the `about` widget.
This commit is contained in:
Vukašin Vojinović 2025-09-11 16:24:07 +02:00
parent e405b929c1
commit b380b1bf32
5 changed files with 298 additions and 676 deletions

881
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -6,16 +6,13 @@ edition = "2024"
license = "GPL-3.0-only"
rust-version = "1.85"
[build-dependencies]
vergen = { version = "8", features = ["git", "gitcl"] }
[dependencies]
dirs = "6"
env_logger = "0.11.6"
env_logger = "0.11.8"
grep = "0.3.2"
ignore = "0.4.23"
log = "0.4.25"
notify = "6.1.1"
log = "0.4.28"
notify = "8.2.0"
open = "5.3.2"
paste = "1.0.15"
patch = "0.7.0"
@ -28,11 +25,11 @@ two-face = "0.4.3"
# Internationalization
icu_collator = "1.5"
icu_provider = { version = "1.5", features = ["sync"] }
i18n-embed = { version = "0.15", features = [
i18n-embed = { version = "0.16", features = [
"fluent-system",
"desktop-requester",
] }
i18n-embed-fl = "0.9"
i18n-embed-fl = "0.10"
rust-embed = "8"
[dependencies.cosmic-files]
@ -50,7 +47,7 @@ features = ["syntect", "vi"]
git = "https://github.com/pop-os/libcosmic.git"
default-features = false
#TODO: a11y feature crashes file choser dialog
features = ["dbus-config", "multi-window", "tokio", "winit", "surface-message"]
features = ["about", "dbus-config", "multi-window", "tokio", "winit", "surface-message"]
[target.'cfg(unix)'.dependencies]
fork = "0.2"
@ -68,8 +65,6 @@ debug = true
[patch.crates-io]
onig = { git = "https://github.com/rust-onig/rust-onig.git", branch = "main" }
onig_sys = { git = "https://github.com/rust-onig/rust-onig.git", branch = "main" }
# https://github.com/smol-rs/polling/pull/235
polling = { git = "https://github.com/jackpot51/polling.git", branch = "master" }
# [patch.'https://github.com/pop-os/libcosmic']
# libcosmic = { path = "../libcosmic" }

View file

@ -1,17 +0,0 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Rebuild if i18n files change
println!("cargo:rerun-if-changed=i18n");
// Emit version information (if not cached by just vendor)
let mut vergen = vergen::EmitBuilder::builder();
println!("cargo:rerun-if-env-changed=VERGEN_GIT_COMMIT_DATE");
if std::env::var_os("VERGEN_GIT_COMMIT_DATE").is_none() {
vergen.git_commit_date();
}
println!("cargo:rerun-if-env-changed=VERGEN_GIT_SHA");
if std::env::var_os("VERGEN_GIT_SHA").is_none() {
vergen.git_sha(false);
}
vergen.fail_on_error().emit()?;
Ok(())
}

View file

@ -6,7 +6,8 @@ todo = TODO
# Context Pages
## About
git-description = Git commit {$hash} on {$date}
repository = Repository
support = Support
## Document statistics
document-statistics = Document statistics

View file

@ -19,7 +19,7 @@ use cosmic::{
stream, window,
},
style, theme,
widget::{self, button, icon, nav_bar, segmented_button},
widget::{self, about::About, button, icon, nav_bar, segmented_button},
};
use cosmic_files::{
dialog::{Dialog, DialogKind, DialogMessage, DialogResult, DialogSettings},
@ -439,6 +439,7 @@ pub enum Find {
pub struct App {
core: Core,
about: About,
nav_model: segmented_button::SingleSelectModel,
tab_model: segmented_button::SingleSelectModel,
config_handler: Option<cosmic_config::Config>,
@ -849,38 +850,6 @@ impl App {
])
}
fn about(&self) -> Element<Message> {
let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing;
let repository = "https://github.com/pop-os/cosmic-edit";
let hash = env!("VERGEN_GIT_SHA");
let short_hash: String = hash.chars().take(7).collect();
let date = env!("VERGEN_GIT_COMMIT_DATE");
widget::column::with_children(vec![
widget::svg(widget::svg::Handle::from_memory(
&include_bytes!(
"../res/icons/hicolor/128x128/apps/com.system76.CosmicEdit.svg"
)[..],
))
.into(),
widget::text::title3(fl!("cosmic-text-editor")).into(),
widget::button::link(repository)
.on_press(Message::LaunchUrl(repository.to_string()))
.padding(0)
.into(),
widget::button::link(fl!(
"git-description",
hash = short_hash.as_str(),
date = date
))
.on_press(Message::LaunchUrl(format!("{}/commits/{}", repository, hash)))
.padding(0)
.into(),
])
.align_x(Alignment::Center)
.spacing(space_xxs)
.into()
}
fn document_statistics(&self) -> Element<Message> {
//TODO: calculate in the background
let mut character_count = 0;
@ -1367,8 +1336,24 @@ impl Application for App {
zoom_steps.push(zoom_step);
}
let about = About::default()
.name(fl!("cosmic-text-editor"))
.icon(icon::from_name(Self::APP_ID))
.version(env!("CARGO_PKG_VERSION"))
.author("System76")
.license("GPL-3.0-only")
.developers([("Jeremy Soller", "jeremy@system76.com")])
.links([
(fl!("repository"), "https://github.com/pop-os/cosmic-edit"),
(
fl!("support"),
"https://github.com/pop-os/cosmic-edit/issues",
),
]);
let mut app = App {
core,
about,
nav_model: nav_bar::Model::builder().build(),
tab_model: segmented_button::Model::builder().build(),
config_handler: flags.config_handler,
@ -2740,8 +2725,9 @@ impl Application for App {
}
Some(match self.context_page {
ContextPage::About => context_drawer::context_drawer(
self.about(),
ContextPage::About => context_drawer::about(
&self.about,
Message::LaunchUrl,
Message::ToggleContextPage(ContextPage::About),
),
ContextPage::DocumentStatistics => context_drawer::context_drawer(