Compare commits

..

1 commit

Author SHA1 Message Date
Votre Nom
8f906d1762 Cargo.toml: patch libcosmic via local path for dev builds
Activates the [patch.'https://github.com/pop-os/libcosmic'] override
pointing at ../libcosmic, enabling local development against a
patched libcosmic checkout (e.g. to pick up
WindowControlsPosition / macOS-style window controls).

This branch is intentionally dev-local: do NOT merge upstream.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 15:13:55 +02:00
14 changed files with 1289 additions and 1123 deletions

1939
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,10 +1,10 @@
[package] [package]
name = "cosmic-edit" name = "cosmic-edit"
version = "1.3.0" version = "1.0.11"
authors = ["Jeremy Soller <jeremy@system76.com>"] authors = ["Jeremy Soller <jeremy@system76.com>"]
edition = "2024" edition = "2024"
license = "GPL-3.0-only" license = "GPL-3.0-only"
rust-version = "1.93" rust-version = "1.90"
[dependencies] [dependencies]
dirs = "6" dirs = "6"
@ -33,22 +33,21 @@ i18n-embed-fl = "0.10"
rust-embed = "8" rust-embed = "8"
[dependencies.cosmic-files] [dependencies.cosmic-files]
path = "../cosmic-files" git = "https://github.com/pop-os/cosmic-files.git"
default-features = false default-features = false
[dependencies.cosmic-syntax-theme] [dependencies.cosmic-syntax-theme]
git = "https://github.com/pop-os/cosmic-syntax-theme.git" git = "https://github.com/pop-os/cosmic-syntax-theme.git"
[dependencies.cosmic-text] [dependencies.cosmic-text]
version = "0.19" git = "https://github.com/pop-os/cosmic-text.git"
features = ["syntect", "vi"] features = ["syntect", "vi"]
# Yoda fork. [dependencies.libcosmic]
[dependencies.libcosmic-yoda] git = "https://github.com/pop-os/libcosmic.git"
path = "../libcosmic"
default-features = false default-features = false
#TODO: a11y feature crashes file choser dialog #TODO: a11y feature crashes file choser dialog
features = ["about", "multi-window", "tokio", "wayland", "surface-message"] features = ["about", "multi-window", "tokio", "winit", "surface-message"]
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
fork = "0.2" fork = "0.2"
@ -58,10 +57,10 @@ xdgen = "0.1"
[features] [features]
default = ["dbus-config", "gvfs", "wgpu", "wayland"] default = ["dbus-config", "gvfs", "wgpu", "wayland"]
dbus-config = ["libcosmic-yoda/dbus-config"] dbus-config = ["libcosmic/dbus-config"]
gvfs = ["cosmic-files/gvfs"] gvfs = ["cosmic-files/gvfs"]
wgpu = ["libcosmic-yoda/wgpu", "cosmic-files/wgpu"] wgpu = ["libcosmic/wgpu", "cosmic-files/wgpu"]
wayland = ["libcosmic-yoda/wayland", "cosmic-files/wayland"] wayland = ["libcosmic/wayland", "cosmic-files/wayland"]
[profile.release-with-debug] [profile.release-with-debug]
inherits = "release" inherits = "release"
@ -70,12 +69,10 @@ debug = true
[patch.crates-io] [patch.crates-io]
onig = { git = "https://github.com/rust-onig/rust-onig.git", branch = "main" } 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" } onig_sys = { git = "https://github.com/rust-onig/rust-onig.git", branch = "main" }
# Yoda: unify cosmic-text with the local checkout used by libcosmic/iced/glyphon.
cosmic-text = { path = "../cosmic-text" }
# Yoda wayland cut v5: redirect window_clipboard to the local fork [patch.'https://github.com/pop-os/libcosmic']
# (x11 gated behind opt-in feature). libcosmic = { path = "../libcosmic" }
[patch.'https://forge.aditua.com/leyoda/window_clipboard.git'] cosmic-config = { path = "../libcosmic/cosmic-config" }
window_clipboard = { path = "/home/lionel/Projets/COSMIC/window_clipboard" } cosmic-theme = { path = "../libcosmic/cosmic-theme" }
dnd = { path = "/home/lionel/Projets/COSMIC/window_clipboard/dnd" } iced_futures = { path = "../libcosmic/iced/futures" }
mime = { path = "/home/lionel/Projets/COSMIC/window_clipboard/mime" } iced_winit = { path = "../libcosmic/iced/winit" }

42
debian/changelog vendored
View file

@ -1,45 +1,3 @@
cosmic-edit (1.2.0) noble; urgency=medium
* Epoch 1.2.0 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 30 Jun 2026 12:20:53 -0600
cosmic-edit (1.1.0) noble; urgency=medium
* Epoch 1.1.0 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 23 Jun 2026 08:47:04 -0600
cosmic-edit (1.0.16) noble; urgency=medium
* Epoch 1.0.16 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 09 Jun 2026 10:25:21 -0600
cosmic-edit (1.0.15) noble; urgency=medium
* Epoch 1.0.15 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 02 Jun 2026 11:02:06 -0600
cosmic-edit (1.0.14) noble; urgency=medium
* Epoch 1.0.14 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 26 May 2026 08:30:39 -0600
cosmic-edit (1.0.13) noble; urgency=medium
* Epoch 1.0.13 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 12 May 2026 09:37:51 -0600
cosmic-edit (1.0.12) noble; urgency=medium
* Epoch 1.0.12 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 05 May 2026 10:23:41 -0600
cosmic-edit (1.0.11) noble; urgency=medium cosmic-edit (1.0.11) noble; urgency=medium
* Epoch 1.0.11 version update * Epoch 1.0.11 version update

View file

@ -1,3 +0,0 @@
cancel = Cancel·lar
quit = Surt
settings = Configuració

View file

@ -7,7 +7,7 @@ open-project = Άνοιγμα έργου
## Document statistics ## Document statistics
document-statistics = Στατιστικά εγγράφου document-statistics = Στατιστικά εγγράφου
word-count = Πλήθος λέξεων word-count = Λέξεις
character-count = Χαρακτήρες character-count = Χαρακτήρες
character-count-no-spaces = Χαρακτήρες (χωρίς κενά) character-count-no-spaces = Χαρακτήρες (χωρίς κενά)
line-count = Γραμμές line-count = Γραμμές
@ -20,13 +20,13 @@ settings = Ρυθμίσεις
appearance = Εμφάνιση appearance = Εμφάνιση
theme = Θέμα theme = Θέμα
default-font = Προεπιλεγμένη γραμματοσειρά default-font = Γραμματοσειρά
default-font-size = Προεπιλεγμένο μέγεθος γραμματοσειράς default-font-size = Μέγεθος γραμματοσειράς
### Keyboard shortcuts ### Keyboard shortcuts
keyboard-shortcuts = Συντομεύσεις πληκτρολογίου keyboard-shortcuts = Συντομεύσεις πλήκτρων
enable-vim-bindings = Ενεργοποίηση συντομεύσεων Vim enable-vim-bindings = Ενεργοποίηση πλήκτρων vim
# Menu # Menu
@ -37,7 +37,7 @@ file = Αρχείο
new-file = Νέο αρχείο new-file = Νέο αρχείο
new-window = Νέο παράθυρο new-window = Νέο παράθυρο
open-file = Άνοιγμα αρχείου... open-file = Άνοιγμα αρχείου...
todo = Λίστα εργασιών todo = TODO
save = Αποθήκευση save = Αποθήκευση
save-as = Αποθήκευση ως... save-as = Αποθήκευση ως...
revert-all-changes = Αναίρεση όλων των αλλαγών revert-all-changes = Αναίρεση όλων των αλλαγών
@ -62,60 +62,23 @@ spell-check = Έλεγχος ορθογραφίας...
## View ## View
view = Προβολή view = Προβολή
indentation = Εσοχές κειμένου indentation = Εσοχές
### Indentation ### Indentation
automatic-indentation = Αυτόματη εισαγωγή εσοχών automatic-indentation = Αυτόματη εισαγωγή εσοχών
tab-width = Πλάτος στηλοθέτη: { $tab_width } tab-width = Πλάτος Tabs: { $tab_width }
convert-indentation-to-spaces = Μετατροπή εσοχών σε κενά convert-indentation-to-spaces = Μετατροπή εσοχών σε spaces
convert-indentation-to-tabs = Μετατροπή εσοχών σε στηλοθέτες convert-indentation-to-tabs = Μετατροπή εσοχών σε tabs
word-wrap = Αναδίπλωση λέξεων word-wrap = Περιτύλιξη λέξεων
show-line-numbers = Εμφάνιση αριθμού γραμμών show-line-numbers = Εμφάνιση αριθμού γραμμών
highlight-current-line = Επισήμανση τρέχουσας γραμμής highlight-current-line = Υπογράμμιση τρέχουσας γραμμής
syntax-highlighting = Επισήμανση συντακτικού... syntax-highlighting = Υπογράμμιση συντακτικού...
menu-settings = Ρυθμίσεις... menu-settings = Ρυθμίσεις...
menu-keyboard-shortcuts = Συντομεύσεις πληκτρολογίου... menu-keyboard-shortcuts = Συντομεύσεις πλήκτρων...
menu-about = Σχετικά με την Επεξεργασία κειμένου COSMIC... menu-about = Σχετικά με τον επεξεργαστή κειμένου COSMIC...
cancel = Ακύρωση cancel = Ακύρωση
repository = Αποθετήριο repository = Αποθετήριο
support = Υποστήριξη support = Υποστήριξη
dark = Σκουρόχρωμο dark = Σκοτεινό
light = Ανοιχτόχρωμο light = Φωτεινό
close-file = Κλείσιμο αρχείου
cosmic-text-editor = Επεξεργασία κειμένου COSMIC
find-placeholder = Εύρεση...
replace-placeholder = Αντικατάσταση...
match-desktop = Συμφωνία με την επιφάνεια εργασίας
discard = Απόρριψη αλλαγών
select-all = Επιλογή όλων
comment = Πρόγραμμα επεξεργασίας κειμένου για το περιβάλλον επιφάνειας εργασίας COSMIC
git-management = Διαχείριση Git
save-all = Αποθήκευση όλων
find-previous = Εύρεση προηγούμενου
find-next = Εύρεση επόμενου
replace-all = Αντικατάσταση όλων
close-project = Κλείσιμο έργου
menu-git-management = Διαχείριση Git...
find-in-project = Εύρεση στο έργο...
default-size = Προεπιλεγμένο μέγεθος
zoom-out = Σμίκρυνση
zoom-in = Μεγέθυνση
project-search = Αναζήτηση έργων
prompt-save-changes-title = Αποθήκευση των αλλαγών πριν από το κλείσιμο;
open-recent-file = Άνοιγμα πρόσφατου αρχείου
menu-open-project = Άνοιγμα έργου...
open-recent-project = Άνοιγμα πρόσφατου έργου
git-management-loading = Φόρτωση διαχείρισης Git...
prompt-unsaved-changes = Υπάρχουν μη αποθηκευμένες αλλαγές. Εάν συνεχίσετε χωρίς να κάνετε αποθήκευση, αυτές οι αλλαγές θα χαθούν.
case-sensitive = Διάκριση πεζών-κεφαλαίων
stage = Προετοιμασία
staged-changes = Προετοιμασμένες αλλαγές
unstage = Ακύρωση προετοιμασίας
unstaged-changes = Απροετοίμαστες αλλαγές
syntax-dark = Σκουρόχρωμο συντακτικό
syntax-light = Ανοιχτόχρωμο συντακτικό
default-zoom-step = Βήματα ζουμ
git-management-description = Η διαχείριση Git είναι ένα εργαλείο για προγραμματιστές που χρησιμοποιείται για λειτουργίες ελέγχου εκδόσεων.
use-regex = Χρήση κανονικών εκφράσεων
wrap-around = Αναδίπλωση

View file

@ -25,8 +25,8 @@ git-management-description = A Git-kezelő egy verziókezeléssel kapcsolatos fe
git-management-loading = Git-kezelő betöltése… git-management-loading = Git-kezelő betöltése…
stage = Előkészítés stage = Előkészítés
staged-changes = Előkészített változtatások staged-changes = Előkészített változtatások
unstage = Előkészítés visszavonása unstage = Változtatások visszavonása előkészítésből
unstaged-changes = Nem előkészített változtatások unstaged-changes = Előkészítésből visszavont változtatások
## Project search ## Project search
@ -35,7 +35,7 @@ project-search = Projektkereső
## Prompt save changes ## Prompt save changes
prompt-save-changes-title = Mented a változtatásokat bezárás előtt? prompt-save-changes-title = Mented a változtatásokat bezárás előtt?
prompt-unsaved-changes = Vannak nem mentett változtatások. Ha nem mentesz, ezek el fognak veszni. prompt-unsaved-changes = Vannak nem mentett változtatások. Ha nem mentesz, ezek el fognak veszni!
cancel = Mégse cancel = Mégse
discard = Változtatások elvetése discard = Változtatások elvetése
save-all = Összes mentése save-all = Összes mentése
@ -68,7 +68,7 @@ find-next = Következő találat
replace-placeholder = Csere… replace-placeholder = Csere…
replace = Csere replace = Csere
replace-all = Összes lecserélése replace-all = Összes lecserélése
case-sensitive = Kis- és nagybetű-érzékenység case-sensitive = Kis- és nagybetű érzékenység
use-regex = Regex használata use-regex = Regex használata
wrap-around = Körbefutás wrap-around = Körbefutás
@ -100,7 +100,7 @@ quit = Kilépés
edit = Szerkesztés edit = Szerkesztés
undo = Visszavonás undo = Visszavonás
redo = Újra redo = Visszaállítás
cut = Kivágás cut = Kivágás
copy = Másolás copy = Másolás
paste = Beillesztés paste = Beillesztés

View file

@ -14,7 +14,7 @@ line-count = Eilučių skaičius
## Settings ## Settings
settings = Nuostatos settings = Nustatymai
## Appearance ## Appearance
@ -25,7 +25,7 @@ default-font-size = Numatytas šrifto dydis
### Keyboard shortcuts ### Keyboard shortcuts
keyboard-shortcuts = Spartieji klavišai keyboard-shortcuts = Klaviatūros greitieji klavišai
enable-vim-bindings = Naudoti Vim sąsajas enable-vim-bindings = Naudoti Vim sąsajas
# Menu # Menu
@ -36,14 +36,14 @@ enable-vim-bindings = Naudoti Vim sąsajas
file = Failas file = Failas
new-file = Naujas failas new-file = Naujas failas
new-window = Naujas langas new-window = Naujas langas
open-file = Atverti failą... open-file = Atidaryti failą...
todo = TODO todo = TODO
save = Išsaugoti save = Išsaugoti
save-as = Išsaugoti kaip... save-as = Išsaugoti kaip...
revert-all-changes = Atšaukti visus keitimus revert-all-changes = Atstatyti visus pakeitimus
menu-document-statistics = Apie dokumentą... menu-document-statistics = Apie dokumentą...
document-type = Dokumento tipas... document-type = Dokumento tipas...
encoding = Koduotė... encoding = Kodavimas...
print = Spausdinti print = Spausdinti
quit = Išeiti quit = Išeiti
@ -51,13 +51,13 @@ quit = Išeiti
edit = Redaguoti edit = Redaguoti
undo = Anuliuoti undo = Anuliuoti
redo = Grąžinti redo = Atkurti
cut = Iškirpti cut = Iškirpti
copy = Kopijuoti copy = Kopijuoti
paste = Įti paste = Įklijuoti
find = Rasti find = Surasti
replace = Keisti replace = Pakeisti
spell-check = Tikrinti rašybą... spell-check = Rašybos tikrinimas...
## View ## View
@ -70,51 +70,50 @@ automatic-indentation = Automatinė įtrauka
tab-width = Tabuliavimo žingsnio plotis: { $tab_width } tab-width = Tabuliavimo žingsnio plotis: { $tab_width }
convert-indentation-to-spaces = Pakeisti įtrauką tarpais convert-indentation-to-spaces = Pakeisti įtrauką tarpais
convert-indentation-to-tabs = Pakeisti įtrauką tabuliavimo žingsniu convert-indentation-to-tabs = Pakeisti įtrauką tabuliavimo žingsniu
word-wrap = Žodžių kėlimas word-wrap = Žodžių perkėlimas
show-line-numbers = Rodyti eilučių numerius show-line-numbers = Rodyti eilučių numerius
highlight-current-line = Paryškinti dabartinę eilutę highlight-current-line = Paryškinti dabartinę eilutę
syntax-highlighting = Sintaksės tikrinimas... syntax-highlighting = Sintaksės tikrinimas...
menu-settings = Nuostatos... menu-settings = Nustatymai...
menu-keyboard-shortcuts = Spartieji klavišai... menu-keyboard-shortcuts = Klaviatūros greitieji klavišai...
menu-about = Apie COSMIC Rašyklę... menu-about = Apie COSMIC Text Editor...
cancel = Atšaukti cancel = Atšaukti
repository = Saugykla repository = Saugykla
support = Palaikymas support = Palaikymas
cosmic-text-editor = COSMIC Rašyklė cosmic-text-editor = COSMIC Text Editor
git-management = Git valdymas git-management = Git valdymas
git-management-description = Git valdymas - kūrėjų įrankis, naudojamas versijų kontrolės sistemos operacijoms įvykdyti. git-management-description = Git valdymas - kūrėjų įrankis, naudojamas versijų kontrolės sistemos operacijoms įvykdyti.
git-management-loading = Kraunamas Git valdymas... git-management-loading = Kraunamas Git valdymas...
save-all = Išsaugoti viską save-all = Išsaugoti viską
syntax-dark = Tamsi sintaksė syntax-dark = Tamsi sintaksė
default-zoom-step = Artinimo žingsniai default-zoom-step = Priartinimo žingsniai
open-recent-file = Atverti pastarąjį failą open-recent-file = Atidaryti pastararąjį failą
close-file = Uždaryti failą close-file = Uždaryti failą
menu-open-project = Atidaryti projektą... menu-open-project = Atidaryti projektą...
open-recent-project = Atidaryti pastarąjį projektą open-recent-project = Atidaryti pastarąjį projektą
close-project = Uždaryti projektą close-project = Uždaryti projektą
select-all = Žymėti viską select-all = Pažymėti viską
find-in-project = Ieškoti projekte... find-in-project = Ieškoti projekte...
zoom-in = Artinti zoom-in = Priartinti
default-size = Numatytas dydis default-size = Numatytas dydis
zoom-out = Tolinti zoom-out = Nutolinti
menu-git-management = Git valdymas... menu-git-management = Git valdymas...
staged-changes = Patvirtinti keitimai staged-changes = Patvirtinti pokyčiai
unstaged-changes = Nepatvirtinti keitimai unstaged-changes = Nepatvirtinti pokyčiai
prompt-save-changes-title = Išsaugoti pakeitimus prieš uždarant? prompt-save-changes-title = Išsaugoti pakeitimus prieš uždarant?
prompt-unsaved-changes = Yra neišsaugotų keitimų. Jei tęsite neišsaugoję, šie keitimai dings. prompt-unsaved-changes = Yra neišsaugotų pakeitimų. Jeigu tęsite neišsaugojus, jūsų pakeitimai bus prarasti.
discard = Pašalinti keitimus discard = Pašalinti pakeitimus
match-desktop = Pagal darbalaukio temą match-desktop = Pagal darbalaukio temą
find-placeholder = Rasti... find-placeholder = Surasti...
find-previous = Ieškoti ankstesnio find-previous = Atgalinis ieškojimas
find-next = Ieškoti tolesnio find-next = Ieškoti sekančio
replace-placeholder = Keisti... replace-placeholder = Pakeisti...
replace-all = Pakeisti visus replace-all = Pakeisti visus
case-sensitive = Skirti raidžių dydžius case-sensitive = Skirti raidžių dydžius
use-regex = Naudoti regex use-regex = Naudoti regex
wrap-around = Laikinai skaidyti eilutes wrap-around = Kelti į sekančią eilutę
stage = Patvirtinti pakeitimai stage = Patvirtinti pakeitimai
project-search = Paieška projekte project-search = Paieška projekte
dark = Tamsus dark = Tamsus
light = Šviesus light = Šviesus
comment = COSMIC aplinkos rašyklė comment = COSMIC desktop teksto redaktorius
unstage = Atšaukti patvirtinimą

View file

@ -1,91 +0,0 @@
quit = Изађи
cancel = Откажи
settings = Подешавања
appearance = Изглед
dark = Тамна
light = Светла
replace = Замени
save = Сачувај
undo = Опозови
repository = Ризница
support = Подршка
theme = Тема
match-desktop = Прати радну површину
file = Датотека
new-window = Нови прозор
edit = Уреди
cut = Исеци
copy = Умножи
paste = Залепи
select-all = Означи све
zoom-in = Увећајте приказ
default-size = Подразумевана величина
zoom-out = Умањите приказ
view = Преглед
menu-settings = Подешавања...
cosmic-text-editor = Космик уређивач текста
comment = Уређивач текста за Космик радну површину
new-document = Нови документ
open-project = Отвори пројекат
todo = УРАДИТИ
document-statistics = Статистика документа
word-count = Број речи
character-count = Знакови
character-count-no-spaces = Знакови (без размака)
line-count = Редови
git-management = Управљање Гитом
git-management-description = Управљање Гитом је алат за програмере који се користи за радње управљања издањима.
git-management-loading = Учитавање управљања Гитом...
stage = Припреми
staged-changes = Припремљене измене
unstage = Поништи припрему
unstaged-changes = Неприпремљене измене
project-search = Претрага пројекта
prompt-save-changes-title = Сачувај измене пре затварања?
prompt-unsaved-changes = Имате несачуване измене. Ако наставите без сачувања, ове измене ће бити изгубљене.
discard = Одбаци измене
save-all = Сачувај све
syntax-dark = Тамна синтакса
syntax-light = Светла синтакса
default-font = Подразумевани фонт
default-font-size = Подразумевана величина фонта
default-zoom-step = Кораци увећања
keyboard-shortcuts = Пречице тастатуре
enable-vim-bindings = Омогући Вим везивања
find-placeholder = Пронађи...
find-previous = Нађи претходно
find-next = Нађи следеће
replace-placeholder = Замени…
replace-all = Замени све
case-sensitive = Разликује величину слова
use-regex = Употреби регуларни израз
wrap-around = Преламај около
new-file = Нова датотека
open-file = Отвори датотеку...
open-recent-file = Отвори недавну датотеку
close-file = Затвори датотеку
menu-open-project = Отвори пројекат...
open-recent-project = Отвори недавни пројекат
close-project = Затвори пројекат
save-as = Сачувај као...
revert-all-changes = Врати све измене
menu-document-statistics = Статистика документа...
document-type = Врста документа...
encoding = Кодирање...
menu-git-management = Управљање Гитом...
print = Штампај
redo = Понови
find = Пронађи
find-in-project = Пронађи у пројекту...
spell-check = Провера правописа...
indentation = Увлачење
automatic-indentation = Самостално увлачење
tab-width = Ширина табулатора: { $tab_width }
convert-indentation-to-spaces = Претворите увлачење у размаке
convert-indentation-to-tabs = Претворите увлачење у табулаторе
word-wrap = Прелом речи
show-line-numbers = Приказује бројеве редова
highlight-current-line = Истиче текући ред
syntax-highlighting = Истицање синтаксе...
menu-keyboard-shortcuts = Пречице на тастатури...
menu-about = О Космик уређивачу текста...

View file

@ -5,7 +5,7 @@ Exec=cosmic-edit %F
Terminal=false Terminal=false
Type=Application Type=Application
StartupNotify=true StartupNotify=true
MimeType=text/plain;application/x-zerosize; MimeType=text/plain;
Icon=com.system76.CosmicEdit Icon=com.system76.CosmicEdit
Categories=COSMIC;Utility;TextEditor; Categories=COSMIC;Utility;TextEditor;
Keywords=Text;Editor; Keywords=Text;Editor;

View file

@ -26,9 +26,6 @@ pub fn key_binds() -> HashMap<KeyBind, Action> {
bind!([Ctrl], Key::Character("f".into()), Find); bind!([Ctrl], Key::Character("f".into()), Find);
bind!([Ctrl], Key::Character("h".into()), FindAndReplace); bind!([Ctrl], Key::Character("h".into()), FindAndReplace);
bind!([Ctrl], Key::Character("v".into()), Paste); bind!([Ctrl], Key::Character("v".into()), Paste);
bind!([Shift], Key::Named(Named::Insert), Paste);
bind!([Ctrl], Key::Named(Named::Insert), Copy);
bind!([Shift], Key::Named(Named::Delete), Cut);
bind!([Ctrl], Key::Character("t".into()), NewFile); bind!([Ctrl], Key::Character("t".into()), NewFile);
bind!([Ctrl], Key::Character("n".into()), NewWindow); bind!([Ctrl], Key::Character("n".into()), NewWindow);
bind!([Ctrl], Key::Character("o".into()), OpenFileDialog); bind!([Ctrl], Key::Character("o".into()), OpenFileDialog);

View file

@ -366,7 +366,7 @@ pub enum Message {
GitProjectStatus(Vec<(String, PathBuf, Vec<GitStatus>)>), GitProjectStatus(Vec<(String, PathBuf, Vec<GitStatus>)>),
GitStage(PathBuf, PathBuf), GitStage(PathBuf, PathBuf),
GitUnstage(PathBuf, PathBuf), GitUnstage(PathBuf, PathBuf),
Key(Modifiers, keyboard::key::Physical, keyboard::Key), Key(Modifiers, keyboard::Key),
LaunchUrl(String), LaunchUrl(String),
Modifiers(Modifiers), Modifiers(Modifiers),
NewFile, NewFile,
@ -691,7 +691,13 @@ impl App {
return Some(NewTab::Exists(entity)); return Some(NewTab::Exists(entity));
} }
self.add_to_recents(&canonical); // Add to recent files, ensuring only one entry
self.config_state.recent_files.retain(|x| x != &canonical);
self.config_state
.recent_files
.push_front(canonical.to_path_buf());
self.config_state.recent_files.truncate(10);
self.save_config_state();
let mut tab = EditorTab::new(&self.config); let mut tab = EditorTab::new(&self.config);
tab.open(canonical); tab.open(canonical);
@ -701,15 +707,6 @@ impl App {
} }
} }
fn add_to_recents(&mut self, canonical: &PathBuf) {
self.config_state.recent_files.retain(|x| x != canonical);
self.config_state
.recent_files
.push_front(canonical.to_path_buf());
self.config_state.recent_files.truncate(10);
self.save_config_state();
}
fn update_config(&mut self) -> Task<Message> { fn update_config(&mut self) -> Task<Message> {
//TODO: provide iterator over data //TODO: provide iterator over data
let entities: Vec<_> = self.tab_model.iter().collect(); let entities: Vec<_> = self.tab_model.iter().collect();
@ -1458,7 +1455,6 @@ impl Application for App {
.author("System76") .author("System76")
.comments(fl!("comment")) .comments(fl!("comment"))
.license("GPL-3.0-only") .license("GPL-3.0-only")
.license_url("https://spdx.org/licenses/GPL-3.0-only")
.developers([("Jeremy Soller", "jeremy@system76.com")]) .developers([("Jeremy Soller", "jeremy@system76.com")])
.links([ .links([
(fl!("repository"), "https://github.com/pop-os/cosmic-edit"), (fl!("repository"), "https://github.com/pop-os/cosmic-edit"),
@ -2128,9 +2124,9 @@ impl Application for App {
|x| x, |x| x,
); );
} }
Message::Key(modifiers, physical, key) => { Message::Key(modifiers, key) => {
for (key_bind, action) in self.key_binds.iter() { for (key_bind, action) in self.key_binds.iter() {
if key_bind.matches(modifiers, &key, Some(&physical)) { if key_bind.matches(modifiers, &key) {
return self.update(action.message(None)); return self.update(action.message(None));
} }
} }
@ -2590,18 +2586,11 @@ impl Application for App {
let entity = entity_opt.unwrap_or_else(|| self.tab_model.active()); let entity = entity_opt.unwrap_or_else(|| self.tab_model.active());
if let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity) { if let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity) {
match tab.path_opt.clone() { if tab.path_opt.is_none() {
Some(path) => { return self.update(Message::SaveAsDialog(Some(entity)));
title_opt = Some(tab.title());
tab.save();
if let Ok(canonical) = fs::canonicalize(&path) {
self.add_to_recents(&canonical);
}
}
None => {
return self.update(Message::SaveAsDialog(Some(entity)));
}
} }
title_opt = Some(tab.title());
tab.save();
} }
if let Some(title) = title_opt { if let Some(title) = title_opt {
self.tab_model.text_set(self.tab_model.active(), title); self.tab_model.text_set(self.tab_model.active(), title);
@ -2612,17 +2601,10 @@ impl Application for App {
let entities: Vec<_> = self.tab_model.iter().collect(); let entities: Vec<_> = self.tab_model.iter().collect();
for entity in entities { for entity in entities {
if let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity) { if let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity) {
match tab.path_opt.clone() { if tab.path_opt.is_none() {
Some(path) => { log::warn!("{} has no path when doing save all", tab.title());
tab.save();
if let Ok(canonical) = fs::canonicalize(&path) {
self.add_to_recents(&canonical);
}
}
None => {
log::warn!("{} has no path when doing save all", tab.title());
}
} }
tab.save();
} }
} }
return self.update_dialogs(); return self.update_dialogs();
@ -2666,11 +2648,6 @@ impl Application for App {
tab.path_opt = Some(paths.remove(0)); tab.path_opt = Some(paths.remove(0));
title_opt = Some(tab.title()); title_opt = Some(tab.title());
tab.save(); tab.save();
if let Some(path) = tab.path_opt.clone() {
if let Ok(canonical) = fs::canonicalize(&path) {
self.add_to_recents(&canonical);
}
}
} }
if let Some(title) = title_opt { if let Some(title) = title_opt {
self.tab_model.text_set(entity, title); self.tab_model.text_set(entity, title);
@ -2802,7 +2779,7 @@ impl Application for App {
// If that was the last tab, exit the application // If that was the last tab, exit the application
if self.tab_model.iter().next().is_none() { if self.tab_model.iter().next().is_none() {
return self.update(Message::QuitForce); return self.update(Message::QuitForce)
} }
// Close PromptSaveClose dialog if open for this entity // Close PromptSaveClose dialog if open for this entity
@ -3330,15 +3307,12 @@ impl Application for App {
let mut subscriptions = vec![ let mut subscriptions = vec![
event::listen_with(|event, status, window_id| match event { event::listen_with(|event, status, window_id| match event {
event::Event::Keyboard(keyboard::Event::KeyPressed { event::Event::Keyboard(keyboard::Event::KeyPressed { modifiers, key, .. }) => {
modifiers, match status {
physical_key, event::Status::Ignored => Some(Message::Key(modifiers, key)),
key, event::Status::Captured => None,
.. }
}) => match status { }
event::Status::Ignored => Some(Message::Key(modifiers, physical_key, key)),
event::Status::Captured => None,
},
event::Event::Keyboard(keyboard::Event::ModifiersChanged(modifiers)) => { event::Event::Keyboard(keyboard::Event::ModifiersChanged(modifiers)) => {
Some(Message::Modifiers(modifiers)) Some(Message::Modifiers(modifiers))
} }

View file

@ -121,11 +121,10 @@ pub fn context_menu<'a>(
entity: segmented_button::Entity, entity: segmented_button::Entity,
) -> Element<'a, Message> { ) -> Element<'a, Message> {
fn key_style(theme: &cosmic::Theme) -> TextStyle { fn key_style(theme: &cosmic::Theme) -> TextStyle {
let mut color = theme.cosmic().background(false).component.on; let mut color = theme.cosmic().background.component.on;
color.alpha *= 0.75; color.alpha *= 0.75;
TextStyle { TextStyle {
color: Some(color.into()), color: Some(color.into()),
..Default::default()
} }
} }
@ -160,7 +159,7 @@ pub fn context_menu<'a>(
//TODO: move style to libcosmic //TODO: move style to libcosmic
.style(|theme| { .style(|theme| {
let cosmic = theme.cosmic(); let cosmic = theme.cosmic();
let component = &cosmic.background(false).component; let component = &cosmic.background.component;
widget::container::Style { widget::container::Style {
icon_color: Some(component.on.into()), icon_color: Some(component.on.into()),
text_color: Some(component.on.into()), text_color: Some(component.on.into()),

View file

@ -7,7 +7,6 @@ use cosmic::{
Border, Radians, Shell, Transformation, Border, Radians, Shell, Transformation,
clipboard::Clipboard, clipboard::Clipboard,
image, image,
input_method::{Event as InputMethodEvent, InputMethod, Preedit, Purpose},
keyboard::{Key, key::Named}, keyboard::{Key, key::Named},
layout::{self, Layout}, layout::{self, Layout},
renderer::{self, Quad, Renderer as _}, renderer::{self, Quad, Renderer as _},
@ -17,7 +16,6 @@ use cosmic::{
operation::{self, Operation}, operation::{self, Operation},
tree, tree,
}, },
window::Event as WindowEvent,
}, },
iced::{ iced::{
Color, Element, Length, Padding, Point, Rectangle, Size, Vector, Color, Element, Length, Padding, Point, Rectangle, Size, Vector,
@ -129,35 +127,6 @@ where
self.on_focus = Some(on_focus); self.on_focus = Some(on_focus);
self self
} }
fn input_method<'b>(
&self,
state: &'b State,
scale_factor: f32,
layout: Layout<'_>,
) -> InputMethod<&'b str> {
if !state.is_focused {
return InputMethod::Disabled;
};
let editor_pos = layout.position() + [self.padding.left, self.padding.top].into();
let (caret_x, caret_y) = state.caret_position;
InputMethod::Enabled {
cursor: Rectangle::new(
Point::new(
editor_pos.x
+ (caret_x as f32 + state.editor_offset_x.get() as f32) / scale_factor,
editor_pos.y + (caret_y as f32) / scale_factor,
),
Size::new(
1.0,
(self.metrics.scale(scale_factor).line_height) / scale_factor,
),
),
purpose: Purpose::Normal,
preedit: state.preedit.as_ref().map(Preedit::as_ref),
}
}
} }
pub fn text_box<'a, Message>( pub fn text_box<'a, Message>(
@ -825,7 +794,7 @@ where
let scrollbar_color = if pressed { let scrollbar_color = if pressed {
// pressed_state_color, 0.5 // pressed_state_color, 0.5
cosmic_theme cosmic_theme
.background(false) .background
.component .component
.pressed .pressed
.without_alpha() .without_alpha()
@ -834,7 +803,7 @@ where
} else if hover { } else if hover {
// hover_state_color, 0.2 // hover_state_color, 0.2
cosmic_theme cosmic_theme
.background(false) .background
.component .component
.hover .hover
.without_alpha() .without_alpha()
@ -921,7 +890,7 @@ where
let scrollbar_color = if pressed { let scrollbar_color = if pressed {
// pressed_state_color, 0.5 // pressed_state_color, 0.5
cosmic_theme cosmic_theme
.background(false) .background
.component .component
.pressed .pressed
.without_alpha() .without_alpha()
@ -930,7 +899,7 @@ where
} else if hover { } else if hover {
// hover_state_color, 0.2 // hover_state_color, 0.2
cosmic_theme cosmic_theme
.background(false) .background
.component .component
.hover .hover
.without_alpha() .without_alpha()
@ -1132,33 +1101,6 @@ where
} }
state.modifiers = *modifiers; state.modifiers = *modifiers;
} }
Event::InputMethod(event) => match event {
InputMethodEvent::Opened | InputMethodEvent::Closed => {
let metrics = self.metrics.scale(scale_factor);
state.preedit = matches!(event, InputMethodEvent::Opened).then(|| {
let mut preedit = Preedit::new();
preedit.text_size = Some(metrics.font_size.into());
preedit
});
}
InputMethodEvent::Preedit(content, selection) => {
if state.is_focused {
state.preedit = Some(Preedit {
content: content.to_owned(),
selection: selection.clone(),
text_size: Some(self.metrics.font_size.into()),
});
}
}
InputMethodEvent::Commit(text) => {
if state.is_focused {
editor.start_change();
editor.insert_string(&text, None);
editor.finish_change();
shell.capture_event();
}
}
},
Event::Mouse(MouseEvent::ButtonPressed(button)) => { Event::Mouse(MouseEvent::ButtonPressed(button)) => {
if let Some(p) = cursor_position.position_in(layout.bounds()) { if let Some(p) = cursor_position.position_in(layout.bounds()) {
state.is_focused = true; state.is_focused = true;
@ -1394,12 +1336,6 @@ where
shell.capture_event(); shell.capture_event();
} }
} }
Event::Window(WindowEvent::RedrawRequested(_now)) => {
if state.is_focused {
state.caret_position = editor.cursor_position().unwrap_or(state.caret_position);
shell.request_input_method(&self.input_method(state, scale_factor, layout));
}
}
_ => (), _ => (),
} }
@ -1449,8 +1385,6 @@ pub struct State {
scrollbar_h_rect: Cell<Option<Rectangle<f32>>>, scrollbar_h_rect: Cell<Option<Rectangle<f32>>>,
handle_opt: Mutex<Option<image::Handle>>, handle_opt: Mutex<Option<image::Handle>>,
shift_anchor: Mutex<Option<Cursor>>, shift_anchor: Mutex<Option<Cursor>>,
caret_position: (i32, i32),
preedit: Option<Preedit>,
} }
impl State { impl State {
@ -1468,8 +1402,6 @@ impl State {
scrollbar_h_rect: Cell::new(None), scrollbar_h_rect: Cell::new(None),
handle_opt: Mutex::new(None), handle_opt: Mutex::new(None),
shift_anchor: Mutex::new(None), shift_anchor: Mutex::new(None),
caret_position: (0, 0),
preedit: None,
} }
} }
} }