Shorten hash in UI
This commit is contained in:
parent
536a66eff9
commit
e95998c204
2 changed files with 3 additions and 2 deletions
2
build.rs
2
build.rs
|
|
@ -10,7 +10,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
}
|
}
|
||||||
println!("cargo:rerun-if-env-changed=VERGEN_GIT_SHA");
|
println!("cargo:rerun-if-env-changed=VERGEN_GIT_SHA");
|
||||||
if std::env::var_os("VERGEN_GIT_SHA").is_none() {
|
if std::env::var_os("VERGEN_GIT_SHA").is_none() {
|
||||||
vergen.git_sha(true);
|
vergen.git_sha(false);
|
||||||
}
|
}
|
||||||
vergen.fail_on_error().emit()?;
|
vergen.fail_on_error().emit()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -724,6 +724,7 @@ impl App {
|
||||||
let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing;
|
let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing;
|
||||||
let repository = "https://github.com/pop-os/cosmic-edit";
|
let repository = "https://github.com/pop-os/cosmic-edit";
|
||||||
let hash = env!("VERGEN_GIT_SHA");
|
let hash = env!("VERGEN_GIT_SHA");
|
||||||
|
let short_hash: String = hash.chars().take(7).collect();
|
||||||
let date = env!("VERGEN_GIT_COMMIT_DATE");
|
let date = env!("VERGEN_GIT_COMMIT_DATE");
|
||||||
widget::column::with_children(vec![
|
widget::column::with_children(vec![
|
||||||
widget::svg(widget::svg::Handle::from_memory(
|
widget::svg(widget::svg::Handle::from_memory(
|
||||||
|
|
@ -739,7 +740,7 @@ impl App {
|
||||||
.into(),
|
.into(),
|
||||||
widget::button::link(fl!(
|
widget::button::link(fl!(
|
||||||
"git-description",
|
"git-description",
|
||||||
hash = hash,
|
hash = short_hash.as_str(),
|
||||||
date = date
|
date = date
|
||||||
))
|
))
|
||||||
.on_press(Message::LaunchUrl(format!("{}/commits/{}", repository, hash)))
|
.on_press(Message::LaunchUrl(format!("{}/commits/{}", repository, hash)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue