diff --git a/Cargo.lock b/Cargo.lock index 2aac86f..3d2ff66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,6 +257,12 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" +[[package]] +name = "anyhow" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" + [[package]] name = "apply" version = "0.3.0" @@ -1147,7 +1153,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1164,7 +1170,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "quote", "syn 1.0.109", @@ -1196,12 +1202,13 @@ dependencies = [ "systemicons", "tokio", "two-face", + "vergen", ] [[package]] name = "cosmic-files" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-files#8ab15027a521713850384fa87666bb9974f2666b" +source = "git+https://github.com/pop-os/cosmic-files.git#8ab15027a521713850384fa87666bb9974f2666b" dependencies = [ "chrono", "dirs", @@ -1228,7 +1235,7 @@ dependencies = [ [[package]] name = "cosmic-syntax-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-syntax-theme#b1e1eb0234568911e59888f092dfc779c609b499" +source = "git+https://github.com/pop-os/cosmic-syntax-theme.git#b1e1eb0234568911e59888f092dfc779c609b499" dependencies = [ "handlebars", "serde", @@ -1238,7 +1245,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.11.2" -source = "git+https://github.com/pop-os/cosmic-text#2766961af621b9235616e186046f6d14a2f5fbc0" +source = "git+https://github.com/pop-os/cosmic-text.git#2766961af621b9235616e186046f6d14a2f5fbc0" dependencies = [ "bitflags 2.4.2", "cosmic_undo_2", @@ -1263,7 +1270,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "almost", "cosmic-config", @@ -2802,7 +2809,7 @@ dependencies = [ [[package]] name = "iced" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_accessibility", "iced_core", @@ -2817,7 +2824,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "accesskit", "accesskit_winit", @@ -2826,7 +2833,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "bitflags 1.3.2", "log", @@ -2843,7 +2850,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "futures", "iced_core", @@ -2856,7 +2863,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2880,7 +2887,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2892,7 +2899,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_core", "iced_futures", @@ -2902,7 +2909,7 @@ dependencies = [ [[package]] name = "iced_style" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_core", "once_cell", @@ -2912,7 +2919,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "bytemuck", "cosmic-text", @@ -2929,7 +2936,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2948,7 +2955,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_renderer", "iced_runtime", @@ -2962,7 +2969,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "iced_graphics", "iced_runtime", @@ -3314,7 +3321,7 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a09e76e729895690caac6ac620c212a2e3745d32" +source = "git+https://github.com/pop-os/libcosmic.git#a09e76e729895690caac6ac620c212a2e3745d32" dependencies = [ "apply", "ashpd", @@ -4042,6 +4049,15 @@ dependencies = [ "syn 2.0.51", ] +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "objc" version = "0.2.7" @@ -5006,6 +5022,12 @@ dependencies = [ "owned_ttf_parser 0.15.2", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "rustybuzz" version = "0.12.1" @@ -5587,7 +5609,9 @@ checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "libc", "num-conv", + "num_threads", "powerfmt", "serde", "time-core", @@ -6048,6 +6072,18 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "vergen" +version = "8.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +dependencies = [ + "anyhow", + "cfg-if 1.0.0", + "rustversion", + "time", +] + [[package]] name = "version-compare" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index d47e115..0e6af4d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,9 @@ edition = "2021" license = "GPL-3.0-only" rust-version = "1.71" +[build-dependencies] +vergen = { version = "8", features = ["git", "gitcl"] } + [dependencies] dirs = "5" env_logger = "0.10.0" @@ -26,18 +29,18 @@ i18n-embed-fl = "0.7" rust-embed = "8" [dependencies.cosmic-files] -git = "https://github.com/pop-os/cosmic-files" +git = "https://github.com/pop-os/cosmic-files.git" default-features = false [dependencies.cosmic-syntax-theme] -git = "https://github.com/pop-os/cosmic-syntax-theme" +git = "https://github.com/pop-os/cosmic-syntax-theme.git" [dependencies.cosmic-text] -git = "https://github.com/pop-os/cosmic-text" +git = "https://github.com/pop-os/cosmic-text.git" features = ["syntect", "vi"] [dependencies.libcosmic] -git = "https://github.com/pop-os/libcosmic" +git = "https://github.com/pop-os/libcosmic.git" default-features = false features = ["multi-window", "tokio", "winit"] diff --git a/build.rs b/build.rs index bf50970..3628d6a 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,11 @@ -fn main() { +fn main() -> Result<(), Box> { // Rebuild if i18n files change - println!("cargo:rerun-if-changed=i18n") + println!("cargo:rerun-if-changed=i18n"); + + vergen::EmitBuilder::builder() + .fail_on_error() + .git_commit_date() + .git_sha(true) + .emit()?; + Ok(()) } diff --git a/debian/control b/debian/control index 76c1214..97e6177 100644 --- a/debian/control +++ b/debian/control @@ -4,6 +4,7 @@ Priority: optional Maintainer: Jeremy Soller Build-Depends: debhelper-compat (=13), + git, just (>= 1.13.0), pkg-config, rust-all, diff --git a/i18n/cs/cosmic_edit.ftl b/i18n/cs/cosmic_edit.ftl index d86c890..547d8d7 100644 --- a/i18n/cs/cosmic_edit.ftl +++ b/i18n/cs/cosmic_edit.ftl @@ -68,4 +68,4 @@ highlight-current-line = Zvýraznění aktuálního řádku syntax-highlighting = Zvýraznění syntaxe... menu-settings = Nastavení... menu-keyboard-shortcuts = Klávesové zkratky... -about-cosmic-text-editor = O textovém editoru COSMIC +menu-about = O textovém editoru COSMIC diff --git a/i18n/de/cosmic_edit.ftl b/i18n/de/cosmic_edit.ftl index 4790021..346786e 100644 --- a/i18n/de/cosmic_edit.ftl +++ b/i18n/de/cosmic_edit.ftl @@ -68,4 +68,4 @@ highlight-current-line = Aktuelle Zeile hervorheben syntax-highlighting = Syntax Hervorhebung... menu-settings = Einstellungen... menu-keyboard-shortcuts = Tastenkombinationen... -about-cosmic-text-editor = Über COSMIC Text Editor +menu-about = Über COSMIC Text Editor diff --git a/i18n/el/cosmic_edit.ftl b/i18n/el/cosmic_edit.ftl index 8a9b239..b4d5f8a 100644 --- a/i18n/el/cosmic_edit.ftl +++ b/i18n/el/cosmic_edit.ftl @@ -68,4 +68,4 @@ highlight-current-line = Υπογράμμιση τρέχουσας γραμμή syntax-highlighting = Υπογράμμιση συντακτικού... menu-settings = Ρυθμίσεις... menu-keyboard-shortcuts = Συντομεύσεις πλήκτρων... -about-cosmic-text-editor = Σχετικά με τον επεξεργαστή κειμένου COSMIC +menu-about = Σχετικά με τον επεξεργαστή κειμένου COSMIC diff --git a/i18n/en/cosmic_edit.ftl b/i18n/en/cosmic_edit.ftl index 636a727..c2e6799 100644 --- a/i18n/en/cosmic_edit.ftl +++ b/i18n/en/cosmic_edit.ftl @@ -1,9 +1,14 @@ +cosmic-text-editor = COSMIC Text Editor new-document = New document open-project = Open project todo = TODO # Context Pages +## About +about = About +git-description = Git commit {$hash} on {$date} + ## Document statistics document-statistics = Document statistics word-count = Word count @@ -102,4 +107,4 @@ highlight-current-line = Highlight current line syntax-highlighting = Syntax highlighting... menu-settings = Settings... menu-keyboard-shortcuts = Keyboard shortcuts... -about-cosmic-text-editor = About COSMIC Text Editor +menu-about = About COSMIC Text Editor... diff --git a/i18n/es/cosmic_edit.ftl b/i18n/es/cosmic_edit.ftl index 1934ca8..c5a809b 100644 --- a/i18n/es/cosmic_edit.ftl +++ b/i18n/es/cosmic_edit.ftl @@ -87,4 +87,4 @@ highlight-current-line = Resaltar línea actual syntax-highlighting = Resaltado de sintaxis... menu-settings = Ajustes... menu-keyboard-shortcuts = Atajos de teclado... -about-cosmic-text-editor = Sobre el Editor de Texto COSMIC +menu-about = Sobre el Editor de Texto COSMIC diff --git a/i18n/fi/cosmic_edit.ftl b/i18n/fi/cosmic_edit.ftl index 37d786c..55aeda4 100644 --- a/i18n/fi/cosmic_edit.ftl +++ b/i18n/fi/cosmic_edit.ftl @@ -88,4 +88,4 @@ highlight-current-line = Korosta nykyinen rivi syntax-highlighting = Syntaksi korostus... menu-settings = Asetukset... menu-keyboard-shortcuts = Pikanäppäimet... -about-cosmic-text-editor = Tietoa COSMIC-tekstieditorista +menu-about = Tietoa COSMIC-tekstieditorista diff --git a/i18n/fr/cosmic_edit.ftl b/i18n/fr/cosmic_edit.ftl index c98b634..35b97de 100644 --- a/i18n/fr/cosmic_edit.ftl +++ b/i18n/fr/cosmic_edit.ftl @@ -68,4 +68,4 @@ highlight-current-line = Surbriller la ligne actuelle syntax-highlighting = Surbrillance de la syntaxe... menu-settings = Paramètre... menu-keyboard-shortcuts = Raccourci clavier... -about-cosmic-text-editor = À propos de COSMIC Text Editor +menu-about = À propos de COSMIC Text Editor diff --git a/i18n/he/cosmic_edit.ftl b/i18n/he/cosmic_edit.ftl index 35e8e7c..0736fdf 100644 --- a/i18n/he/cosmic_edit.ftl +++ b/i18n/he/cosmic_edit.ftl @@ -68,4 +68,4 @@ highlight-current-line = הדגשת שורה נוכחית syntax-highlighting = הדגשה תחבירית... menu-settings = הגדרות... menu-keyboard-shortcuts = קיצורי מקשים... -about-cosmic-text-editor = אודות עורך טקסט COSMIC +menu-about = אודות עורך טקסט COSMIC diff --git a/i18n/hu/cosmic_edit.ftl b/i18n/hu/cosmic_edit.ftl index b68a272..9bd3850 100644 --- a/i18n/hu/cosmic_edit.ftl +++ b/i18n/hu/cosmic_edit.ftl @@ -88,4 +88,4 @@ highlight-current-line = Aktuális sor kiemelése syntax-highlighting = Szintaxis kiemelés... menu-settings = Beállítások... menu-keyboard-shortcuts = Billentyűparancsok... -about-cosmic-text-editor = Információ a COSMIC Szövegszerkesztőről +menu-about = Információ a COSMIC Szövegszerkesztőről diff --git a/i18n/it/cosmic_edit.ftl b/i18n/it/cosmic_edit.ftl index 45accdf..55cc8a3 100644 --- a/i18n/it/cosmic_edit.ftl +++ b/i18n/it/cosmic_edit.ftl @@ -88,4 +88,4 @@ highlight-current-line = Evidenzia linea corrente syntax-highlighting = Evidenziazione sintassi... menu-settings = Impostazioni... menu-keyboard-shortcuts = Scorciatoie da tastiera... -about-cosmic-text-editor = Informazioni su COSMIC Text Editor +menu-about = Informazioni su COSMIC Text Editor diff --git a/i18n/ja/cosmic_edit.ftl b/i18n/ja/cosmic_edit.ftl index e582a83..623e824 100644 --- a/i18n/ja/cosmic_edit.ftl +++ b/i18n/ja/cosmic_edit.ftl @@ -90,4 +90,4 @@ highlight-current-line = 現在の行をハイライト syntax-highlighting = シンタックスハイライト... menu-settings = 設定... menu-keyboard-shortcuts = キーボードショートカット... -about-cosmic-text-editor = COSMICテキストデータについて... +menu-about = COSMICテキストデータについて... diff --git a/i18n/ko-KR/cosmic_edit.ftl b/i18n/ko-KR/cosmic_edit.ftl index ed7c6e0..9db23ad 100644 --- a/i18n/ko-KR/cosmic_edit.ftl +++ b/i18n/ko-KR/cosmic_edit.ftl @@ -68,4 +68,4 @@ highlight-current-line = 현재 줄 강조 표시 syntax-highlighting = 구문 강조... menu-settings = 설정... menu-keyboard-shortcuts = 단축키... -about-cosmic-text-editor = COSMIC Text Editor 대해 +menu-about = COSMIC Text Editor 대해 diff --git a/i18n/lt/cosmic_edit.ftl b/i18n/lt/cosmic_edit.ftl index f856cf8..aef3796 100644 --- a/i18n/lt/cosmic_edit.ftl +++ b/i18n/lt/cosmic_edit.ftl @@ -68,4 +68,4 @@ highlight-current-line = Paryškinti dabartinę eilutę syntax-highlighting = Sintaksės tikrinimas... menu-settings = Nustatymai... menu-keyboard-shortcuts = Spartieji klavišai... -about-cosmic-text-editor = Apie COSMIC Text Editor +menu-about = Apie COSMIC Text Editor diff --git a/i18n/nl/cosmic_edit.ftl b/i18n/nl/cosmic_edit.ftl index cc9bf46..12f4e49 100644 --- a/i18n/nl/cosmic_edit.ftl +++ b/i18n/nl/cosmic_edit.ftl @@ -68,4 +68,4 @@ highlight-current-line = Markeer huidige regel syntax-highlighting = Syntax markering... menu-settings = Instellingen... menu-keyboard-shortcuts = Toetsenbord snelkoppelingen... -about-cosmic-text-editor = Over COSMIC Tekstbewerker +menu-about = Over COSMIC Tekstbewerker diff --git a/i18n/pl/cosmic_edit.ftl b/i18n/pl/cosmic_edit.ftl index 4304b6f..8322e7f 100644 --- a/i18n/pl/cosmic_edit.ftl +++ b/i18n/pl/cosmic_edit.ftl @@ -95,4 +95,4 @@ highlight-current-line = Podświetl aktualną linię syntax-highlighting = Podświetlanie składni... menu-settings = Ustawienia... menu-keyboard-shortcuts = Skróty klawiszowe... -about-cosmic-text-editor = O Edytorze Tekstu COSMIC +menu-about = O Edytorze Tekstu COSMIC diff --git a/i18n/pt-BR/cosmic_edit.ftl b/i18n/pt-BR/cosmic_edit.ftl index a67a942..bc0e12b 100644 --- a/i18n/pt-BR/cosmic_edit.ftl +++ b/i18n/pt-BR/cosmic_edit.ftl @@ -68,4 +68,4 @@ highlight-current-line = Destacar linha atual syntax-highlighting = Destaque de sintaxe... menu-settings = Configurações... menu-keyboard-shortcuts = Atalhos do teclado... -about-cosmic-text-editor = Sobre o Editor de Texto COSMIC +menu-about = Sobre o Editor de Texto COSMIC diff --git a/i18n/ru/cosmic_edit.ftl b/i18n/ru/cosmic_edit.ftl index 1cec1b9..c294a71 100644 --- a/i18n/ru/cosmic_edit.ftl +++ b/i18n/ru/cosmic_edit.ftl @@ -95,4 +95,4 @@ highlight-current-line = Подсветка текущей строки syntax-highlighting = Подсветка синтаксиса... menu-settings = Параметры... menu-keyboard-shortcuts = Сочетания клавиш... -about-cosmic-text-editor = О Текстовом редакторе COSMIC +menu-about = О Текстовом редакторе COSMIC diff --git a/i18n/sk/cosmic_edit.ftl b/i18n/sk/cosmic_edit.ftl index cc17e1f..6107201 100644 --- a/i18n/sk/cosmic_edit.ftl +++ b/i18n/sk/cosmic_edit.ftl @@ -95,4 +95,4 @@ highlight-current-line = Zvýrazniť aktuálny riadok syntax-highlighting = Zvýraznenie syntaxe... menu-settings = Nastavenia... menu-keyboard-shortcuts = Klávesové skratky... -about-cosmic-text-editor = O textovom editore COSMIC +menu-about = O textovom editore COSMIC diff --git a/i18n/sr-Cyrl/cosmic_edit.ftl b/i18n/sr-Cyrl/cosmic_edit.ftl index 8a68757..3368223 100644 --- a/i18n/sr-Cyrl/cosmic_edit.ftl +++ b/i18n/sr-Cyrl/cosmic_edit.ftl @@ -95,4 +95,4 @@ highlight-current-line = Истакни тренутни ред syntax-highlighting = Истицање синтаксе... menu-settings = Подешавања... menu-keyboard-shortcuts = Пречице на тастатури... -about-cosmic-text-editor = О COSMIC уређивачу текста +menu-about = О COSMIC уређивачу текста diff --git a/i18n/sr-Latn/cosmic_edit.ftl b/i18n/sr-Latn/cosmic_edit.ftl index 9dc4aff..09c1515 100644 --- a/i18n/sr-Latn/cosmic_edit.ftl +++ b/i18n/sr-Latn/cosmic_edit.ftl @@ -95,4 +95,4 @@ highlight-current-line = Istakni trenutni red syntax-highlighting = Isticanje sintakse... menu-settings = Podešavanja... menu-keyboard-shortcuts = Prečice na tastaturi... -about-cosmic-text-editor = O COSMIC uređivaču teksta +menu-about = O COSMIC uređivaču teksta diff --git a/i18n/sv-SE/cosmic_edit.ftl b/i18n/sv-SE/cosmic_edit.ftl index 5bc1221..46a202c 100644 --- a/i18n/sv-SE/cosmic_edit.ftl +++ b/i18n/sv-SE/cosmic_edit.ftl @@ -93,4 +93,4 @@ highlight-current-line = Markera aktuell rad syntax-highlighting = Syntax markering... menu-settings = Inställningar... menu-keyboard-shortcuts = Tangentbordsgenvägar... -about-cosmic-text-editor = Om COSMIC Textredigerare +menu-about = Om COSMIC Textredigerare diff --git a/i18n/tr/cosmic_edit.ftl b/i18n/tr/cosmic_edit.ftl index 182154b..84d6764 100644 --- a/i18n/tr/cosmic_edit.ftl +++ b/i18n/tr/cosmic_edit.ftl @@ -95,4 +95,4 @@ highlight-current-line = Mevcut satırı vurgula syntax-highlighting = Sentaks vurgulama... menu-settings = Ayarlar... menu-keyboard-shortcuts = Klavye kısayolları... -about-cosmic-text-editor = COSMIC Metin Düzenleyicisi Hakkında +menu-about = COSMIC Metin Düzenleyicisi Hakkında diff --git a/i18n/uk/cosmic_edit.ftl b/i18n/uk/cosmic_edit.ftl index 6589062..f4e3320 100644 --- a/i18n/uk/cosmic_edit.ftl +++ b/i18n/uk/cosmic_edit.ftl @@ -95,4 +95,4 @@ highlight-current-line = Підсвічувати поточний рядок syntax-highlighting = Підсвічування синтаксису... menu-settings = Налаштування... menu-keyboard-shortcuts = Гарячі клавіші... -about-cosmic-text-editor = Про текстовий редактор COSMIC +menu-about = Про текстовий редактор COSMIC diff --git a/justfile b/justfile index d68c259..51d6c0a 100644 --- a/justfile +++ b/justfile @@ -15,6 +15,9 @@ desktop := APPID + '.desktop' desktop-src := 'res' / desktop desktop-dst := clean(rootdir / prefix) / 'share' / 'applications' / desktop +icons-src := 'res' / 'icons' / 'hicolor' +icons-dst := clean(rootdir / prefix) / 'share' / 'icons' / 'hicolor' + # Default recipe which runs `just build-release` default: build-release @@ -22,10 +25,13 @@ default: build-release clean: cargo clean -# `cargo clean` and removes vendored dependencies -clean-dist: clean +# Removes vendored dependencies +clean-vendor: rm -rf .cargo vendor vendor.tar +# `cargo clean` and removes vendored dependencies +clean-dist: clean clean-vendor + # Compiles with debug profile build-debug *args: cargo build {{args}} @@ -54,7 +60,10 @@ run *args: # Installs files install: install -Dm0755 {{bin-src}} {{bin-dst}} - install -Dm0755 {{desktop-src}} {{desktop-dst}} + install -Dm0644 {{desktop-src}} {{desktop-dst}} + for size in `ls {{icons-src}}`; do \ + install -Dm0644 "{{icons-src}}/$size/apps/{{APPID}}.svg" "{{icons-dst}}/$size/apps/{{APPID}}.svg"; \ + done # Uninstalls installed files uninstall: diff --git a/res/com.system76.CosmicEdit.desktop b/res/com.system76.CosmicEdit.desktop index 22e9f36..5d3b2dd 100644 --- a/res/com.system76.CosmicEdit.desktop +++ b/res/com.system76.CosmicEdit.desktop @@ -6,6 +6,6 @@ Terminal=false Type=Application StartupNotify=true MimeType=text/plain; -Icon=accessories-text-editor +Icon=com.system76.CosmicEdit Categories=COSMIC;Utility;TextEditor; Keywords=Text;Editor; diff --git a/res/icons/hicolor/128x128/apps/com.system76.CosmicEdit.svg b/res/icons/hicolor/128x128/apps/com.system76.CosmicEdit.svg new file mode 100644 index 0000000..80e5d67 --- /dev/null +++ b/res/icons/hicolor/128x128/apps/com.system76.CosmicEdit.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/16x16/apps/com.system76.CosmicEdit.svg b/res/icons/hicolor/16x16/apps/com.system76.CosmicEdit.svg new file mode 100644 index 0000000..f6abe35 --- /dev/null +++ b/res/icons/hicolor/16x16/apps/com.system76.CosmicEdit.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/24x24/apps/com.system76.CosmicEdit.svg b/res/icons/hicolor/24x24/apps/com.system76.CosmicEdit.svg new file mode 100644 index 0000000..e0a6930 --- /dev/null +++ b/res/icons/hicolor/24x24/apps/com.system76.CosmicEdit.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/256x256/apps/com.system76.CosmicEdit.svg b/res/icons/hicolor/256x256/apps/com.system76.CosmicEdit.svg new file mode 100644 index 0000000..fe707f7 --- /dev/null +++ b/res/icons/hicolor/256x256/apps/com.system76.CosmicEdit.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/32x32/apps/com.system76.CosmicEdit.svg b/res/icons/hicolor/32x32/apps/com.system76.CosmicEdit.svg new file mode 100644 index 0000000..9dc5274 --- /dev/null +++ b/res/icons/hicolor/32x32/apps/com.system76.CosmicEdit.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/48x48/apps/com.system76.CosmicEdit.svg b/res/icons/hicolor/48x48/apps/com.system76.CosmicEdit.svg new file mode 100644 index 0000000..629e7a7 --- /dev/null +++ b/res/icons/hicolor/48x48/apps/com.system76.CosmicEdit.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/icons/hicolor/64x64/apps/com.system76.CosmicEdit.svg b/res/icons/hicolor/64x64/apps/com.system76.CosmicEdit.svg new file mode 100644 index 0000000..e6ba2e5 --- /dev/null +++ b/res/icons/hicolor/64x64/apps/com.system76.CosmicEdit.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main.rs b/src/main.rs index b190842..0c68827 100644 --- a/src/main.rs +++ b/src/main.rs @@ -182,6 +182,7 @@ fn main() -> Result<(), Box> { #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub enum Action { Todo, + About, CloseFile, CloseProject(usize), Copy, @@ -227,6 +228,7 @@ impl Action { pub fn message(&self) -> Message { match self { Self::Todo => Message::Todo, + Self::About => Message::ToggleContextPage(ContextPage::About), Self::CloseFile => Message::CloseFile, Self::CloseProject(project_i) => Message::CloseProject(*project_i), Self::Copy => Message::Copy, @@ -370,6 +372,7 @@ pub enum Message { #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ContextPage { + About, DocumentStatistics, GitManagement, //TODO: Move search to pop-up @@ -381,6 +384,7 @@ pub enum ContextPage { impl ContextPage { fn title(&self) -> String { match self { + Self::About => fl!("about"), Self::DocumentStatistics => fl!("document-statistics"), Self::GitManagement => fl!("git-management"), Self::ProjectSearch => fl!("project-search"), @@ -708,13 +712,37 @@ impl App { None => "No Open File".to_string(), }; - let window_title = format!("{title} - COSMIC Text Editor"); + let window_title = format!("{title} - {}", fl!("cosmic-text-editor")); Command::batch([ self.set_window_title(window_title, self.main_window_id()), self.update_focus(), ]) } + fn about(&self) -> Element { + let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing; + widget::column::with_children(vec![ + widget::svg(widget::svg::Handle::from_memory( + &include_bytes!( + "../res/icons/hicolor/256x256/apps/com.system76.CosmicEdit.svg" + )[..], + )) + .into(), + widget::text::heading(fl!("cosmic-text-editor")).into(), + widget::button::link("https://github.com/pop-os/cosmic-edit") + .padding(0) + .into(), + widget::text(fl!( + "git-description", + hash = env!("VERGEN_GIT_SHA"), + date = env!("VERGEN_GIT_COMMIT_DATE") + )) + .into(), + ]) + .spacing(space_xxs) + .into() + } + fn document_statistics(&self) -> Element { //TODO: calculate in the background let mut character_count = 0; @@ -2220,6 +2248,7 @@ impl Application for App { } Some(match self.context_page { + ContextPage::About => self.about(), ContextPage::DocumentStatistics => self.document_statistics(), ContextPage::GitManagement => self.git_management(), ContextPage::ProjectSearch => self.project_search(), diff --git a/src/menu.rs b/src/menu.rs index 2550220..a703983 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -270,7 +270,7 @@ pub fn menu_bar<'a>( //TODO MenuTree::new(horizontal_rule(1)), //TODO menu_item(fl!("menu-keyboard-shortcuts"), Action::Todo), MenuTree::new(horizontal_rule(1)), - menu_item(fl!("about-cosmic-text-editor"), Action::Todo), + menu_item(fl!("menu-about"), Action::About), ], ), ])