chore: update dependencies
Also switches to the `about` widget.
This commit is contained in:
parent
58b8da4310
commit
f3ec16b9bd
5 changed files with 296 additions and 710 deletions
910
Cargo.lock
generated
910
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
16
Cargo.toml
16
Cargo.toml
|
|
@ -6,36 +6,30 @@ edition = "2024"
|
||||||
license = "GPL-3.0-only"
|
license = "GPL-3.0-only"
|
||||||
rust-version = "1.85"
|
rust-version = "1.85"
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
vergen = { version = "8", features = ["git", "gitcl"] }
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
alacritty_terminal = { git = "https://github.com/alacritty/alacritty", rev = "cacdb5bb3b72bad2c729227537979d95af75978f" }
|
alacritty_terminal = { git = "https://github.com/alacritty/alacritty", rev = "cacdb5bb3b72bad2c729227537979d95af75978f" }
|
||||||
env_logger = "0.11"
|
|
||||||
hex_color = { version = "3", features = ["serde"] }
|
hex_color = { version = "3", features = ["serde"] }
|
||||||
indexmap = "2"
|
indexmap = "2"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
open = "5.3.2"
|
open = "5.3.2"
|
||||||
palette = { version = "0.7", features = ["serde"] }
|
palette = { version = "0.7", features = ["serde"] }
|
||||||
paste = "1.0"
|
paste = "1.0"
|
||||||
ron = "0.8"
|
ron = "0.11"
|
||||||
serde = { version = "1", features = ["serde_derive"] }
|
serde = { version = "1", features = ["serde_derive"] }
|
||||||
shlex = "1"
|
shlex = "1"
|
||||||
tokio = { version = "1", features = ["sync"] }
|
tokio = { version = "1", features = ["sync"] }
|
||||||
# CLI arguments
|
# CLI arguments
|
||||||
clap_lex = "0.7"
|
clap_lex = "0.7"
|
||||||
# Internationalization
|
# Internationalization
|
||||||
i18n-embed = { version = "0.15", features = [
|
i18n-embed = { version = "0.16", features = [
|
||||||
"fluent-system",
|
"fluent-system",
|
||||||
"desktop-requester",
|
"desktop-requester",
|
||||||
] }
|
] }
|
||||||
i18n-embed-fl = "0.9"
|
i18n-embed-fl = "0.10"
|
||||||
icu_collator = "1.5"
|
icu_collator = "1.5"
|
||||||
icu_provider = { version = "1.5", features = ["sync"] }
|
icu_provider = { version = "1.5", features = ["sync"] }
|
||||||
rust-embed = "8"
|
rust-embed = "8"
|
||||||
url = "2.5"
|
url = "2.5"
|
||||||
# TODO: required by 1.80
|
|
||||||
home = "=0.5.9"
|
|
||||||
|
|
||||||
[dependencies.cosmic-files]
|
[dependencies.cosmic-files]
|
||||||
git = "https://github.com/pop-os/cosmic-files.git"
|
git = "https://github.com/pop-os/cosmic-files.git"
|
||||||
|
|
@ -49,7 +43,7 @@ features = ["monospace_fallback", "shape-run-cache"]
|
||||||
git = "https://github.com/pop-os/libcosmic.git"
|
git = "https://github.com/pop-os/libcosmic.git"
|
||||||
default-features = false
|
default-features = false
|
||||||
#TODO: a11y feature crashes file chooser dialog
|
#TODO: a11y feature crashes file chooser dialog
|
||||||
features = ["multi-window", "tokio", "winit", "surface-message"]
|
features = ["about", "multi-window", "tokio", "winit", "surface-message"]
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
fork = "0.2"
|
fork = "0.2"
|
||||||
|
|
@ -63,8 +57,6 @@ wayland = ["libcosmic/wayland", "cosmic-files/wayland"]
|
||||||
inherits = "release"
|
inherits = "release"
|
||||||
debug = true
|
debug = true
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
# https://github.com/smol-rs/polling/pull/235
|
|
||||||
polling = { git = "https://github.com/jackpot51/polling.git", branch = "master" }
|
|
||||||
xdg-mime = { git = "https://github.com/ellieplayswow/xdg-mime-rs", branch = "feature/get-same-as" }
|
xdg-mime = { git = "https://github.com/ellieplayswow/xdg-mime-rs", branch = "feature/get-same-as" }
|
||||||
|
|
||||||
# [patch.'https://github.com/pop-os/libcosmic']
|
# [patch.'https://github.com/pop-os/libcosmic']
|
||||||
|
|
|
||||||
17
build.rs
17
build.rs
|
|
@ -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(())
|
|
||||||
}
|
|
||||||
|
|
@ -4,7 +4,8 @@ new-terminal = New terminal
|
||||||
# Context Pages
|
# Context Pages
|
||||||
|
|
||||||
## About
|
## About
|
||||||
git-description = Git commit {$hash} on {$date}
|
repository = Repository
|
||||||
|
support = Support
|
||||||
|
|
||||||
## Color schemes
|
## Color schemes
|
||||||
color-schemes = Color schemes
|
color-schemes = Color schemes
|
||||||
|
|
|
||||||
60
src/main.rs
60
src/main.rs
|
|
@ -4,7 +4,6 @@
|
||||||
use alacritty_terminal::tty::Options;
|
use alacritty_terminal::tty::Options;
|
||||||
use alacritty_terminal::{event::Event as TermEvent, term, term::color::Colors as TermColors, tty};
|
use alacritty_terminal::{event::Event as TermEvent, term, term::color::Colors as TermColors, tty};
|
||||||
use cosmic::iced::clipboard::dnd::DndAction;
|
use cosmic::iced::clipboard::dnd::DndAction;
|
||||||
use cosmic::widget::DndDestination;
|
|
||||||
use cosmic::widget::menu::action::MenuAction;
|
use cosmic::widget::menu::action::MenuAction;
|
||||||
use cosmic::widget::menu::key_bind::KeyBind;
|
use cosmic::widget::menu::key_bind::KeyBind;
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
|
|
@ -22,7 +21,7 @@ use cosmic::{
|
||||||
stream, window,
|
stream, window,
|
||||||
},
|
},
|
||||||
style,
|
style,
|
||||||
widget::{self, PaneGrid, button, pane_grid, segmented_button},
|
widget::{self, DndDestination, PaneGrid, about::About, button, pane_grid, segmented_button},
|
||||||
};
|
};
|
||||||
use cosmic::{Apply, surface};
|
use cosmic::{Apply, surface};
|
||||||
use cosmic_files::dialog::{Dialog, DialogKind, DialogMessage, DialogResult, DialogSettings};
|
use cosmic_files::dialog::{Dialog, DialogKind, DialogMessage, DialogResult, DialogSettings};
|
||||||
|
|
@ -97,9 +96,8 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
}
|
}
|
||||||
Some("--version") | Some("-V") => {
|
Some("--version") | Some("-V") => {
|
||||||
println!(
|
println!(
|
||||||
"cosmic-term {} (git commit {})",
|
"cosmic-term {}",
|
||||||
env!("CARGO_PKG_VERSION"),
|
env!("CARGO_PKG_VERSION"),
|
||||||
env!("VERGEN_GIT_SHA")
|
|
||||||
);
|
);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
@ -419,6 +417,7 @@ pub enum ContextPage {
|
||||||
/// The [`App`] stores application-specific state.
|
/// The [`App`] stores application-specific state.
|
||||||
pub struct App {
|
pub struct App {
|
||||||
core: Core,
|
core: Core,
|
||||||
|
about: About,
|
||||||
pane_model: TerminalPaneGrid,
|
pane_model: TerminalPaneGrid,
|
||||||
config_handler: Option<cosmic_config::Config>,
|
config_handler: Option<cosmic_config::Config>,
|
||||||
config: Config,
|
config: Config,
|
||||||
|
|
@ -737,38 +736,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-term";
|
|
||||||
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.CosmicTerm.svg"
|
|
||||||
)[..],
|
|
||||||
))
|
|
||||||
.into(),
|
|
||||||
widget::text::title3(fl!("cosmic-terminal")).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!("{repository}/commits/{hash}")))
|
|
||||||
.padding(0)
|
|
||||||
.into(),
|
|
||||||
])
|
|
||||||
.align_x(Alignment::Center)
|
|
||||||
.spacing(space_xxs)
|
|
||||||
.into()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn color_schemes(&self, color_scheme_kind: ColorSchemeKind) -> Element<'_, Message> {
|
fn color_schemes(&self, color_scheme_kind: ColorSchemeKind) -> Element<'_, Message> {
|
||||||
let cosmic_theme::Spacing { space_xxxs, .. } = self.core().system_theme().cosmic().spacing;
|
let cosmic_theme::Spacing { space_xxxs, .. } = self.core().system_theme().cosmic().spacing;
|
||||||
|
|
||||||
|
|
@ -1546,8 +1513,24 @@ impl Application for App {
|
||||||
let mut terminal_ids = HashMap::new();
|
let mut terminal_ids = HashMap::new();
|
||||||
terminal_ids.insert(pane_model.focused(), widget::Id::unique());
|
terminal_ids.insert(pane_model.focused(), widget::Id::unique());
|
||||||
|
|
||||||
|
let about = About::default()
|
||||||
|
.name(fl!("cosmic-terminal"))
|
||||||
|
.icon(widget::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-term"),
|
||||||
|
(
|
||||||
|
fl!("support"),
|
||||||
|
"https://github.com/pop-os/cosmic-term/issues",
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
|
||||||
let mut app = Self {
|
let mut app = Self {
|
||||||
core,
|
core,
|
||||||
|
about,
|
||||||
pane_model,
|
pane_model,
|
||||||
config_handler: flags.config_handler,
|
config_handler: flags.config_handler,
|
||||||
config: flags.config,
|
config: flags.config,
|
||||||
|
|
@ -2681,8 +2664,9 @@ impl Application for App {
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(match self.context_page {
|
Some(match self.context_page {
|
||||||
ContextPage::About => context_drawer::context_drawer(
|
ContextPage::About => context_drawer::about(
|
||||||
self.about(),
|
&self.about,
|
||||||
|
Message::LaunchUrl,
|
||||||
Message::ToggleContextPage(ContextPage::About),
|
Message::ToggleContextPage(ContextPage::About),
|
||||||
),
|
),
|
||||||
ContextPage::ColorSchemes(color_scheme_kind) => context_drawer::context_drawer(
|
ContextPage::ColorSchemes(color_scheme_kind) => context_drawer::context_drawer(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue