Compare commits

...

23 commits

Author SHA1 Message Date
403d81e282 chore: refresh lockfile after libcosmic theme-v2 rebase
Leyoda 2026 – GPLv3
2026-07-03 14:05:58 +02:00
e8a0a536f1 fix: adapt to cosmic-theme background(transparent) accessor
Leyoda 2026 – GPLv3
2026-07-03 13:10:15 +02:00
8e84caeefa chore: align about license metadata 2026-05-29 07:41:58 +02:00
86feecfcae chore: use local cosmic-text checkout 2026-05-29 07:41:58 +02:00
6d61148ad8 yoda: refresh local dbus binding lock 2026-05-29 07:41:39 +02:00
49d0bcd449 chore: align editor with local files stack 2026-05-29 07:41:18 +02:00
92248d6a31 yoda: relocate local fork paths from ~/Devels to ~/Projets/COSMIC
Mise à jour des path= absolus (window_clipboard, dnd, mime, cosmic-text)
après consolidation des forks cosmic-* sous ~/Projets/COSMIC/.

Leyoda 2026 – GPLv3
2026-05-29 07:40:58 +02:00
7eb103473c yoda wayland-v5: redirect window_clipboard + cosmic-text to local forks
Propagates the [patch] blocks added in cosmic-yoterm v5 to keep the
whole yoda app family on a single Wayland-only stack. Without these,
iced_winit fails to select a window_clipboard version because our
fork exposes a `wayland` feature that upstream doesn't.

- window_clipboard → /home/lionel/Devels/window_clipboard (x11 gated
  behind opt-in feature)
- cosmic-text → /home/lionel/Devels/cosmic-text (EAW terminal_cells +
  upstream PR#503 applied)
2026-05-29 07:40:10 +02:00
628faaf61d yoda: rewire onto libcosmic-yoda + leyoda/cosmic-files paths
- libcosmic git dep replaced by libcosmic-yoda = { path = ../libcosmic }
- cosmic-files git dep replaced by path = ../cosmic-files (leyoda fork)
- winit feature dropped from libcosmic-yoda deps, wayland added
- feature refs libcosmic/* -> libcosmic-yoda/*
- [patch] block for pop-os/libcosmic removed

Installed at /usr/bin/cosmic-edit. Pre-yoda binary kept as
/usr/bin/cosmic-edit.pre-yoda-fork.
2026-05-29 07:39:34 +02:00
Votre Nom
7537f7f437 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-05-29 07:34:48 +02:00
Hojjat Abdollahi
a56297f855
fix(libcosmic): fix item highlight in wayland context menu 2026-05-28 23:11:52 +02:00
Ashley Wulber
2db1c80078 fix: update cosmic-files 2026-05-26 13:48:13 -06:00
Jeremy Soller
4edfc6aa8e
Merge pull request #573 from pop-os/epoch-update
Epoch 1.0.14 version update
2026-05-26 13:07:40 -06:00
Ashley Wulber
12cee06253 fix: libcosmic updates 2026-05-26 14:15:00 -04:00
Jeremy Soller
4b231042e7
Merge pull request #572 from weblate/weblate-pop-os-cosmic-edit
i18n: translation update from Hosted Weblate
2026-05-26 09:12:36 -06:00
Jeremy Soller
aadff7540e Epoch 1.0.14 version update
Generated by cosmic-epoch scripts/version-update.sh
2026-05-26 08:30:47 -06:00
Hosted Weblate
2efddc1833
i18n: translation updates from weblate
Co-authored-by: therealmate <hellogaming91@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-edit/hu/
Translation: Pop OS/COSMIC Edit
2026-05-26 01:11:34 +02:00
Jeremy Soller
7bbe82ec3f Epoch 1.0.13 version update
Generated by cosmic-epoch scripts/version-update.sh
2026-05-12 12:09:43 -06:00
Jeremy Soller
448da77cd5
Merge pull request #565 from weblate/weblate-pop-os-cosmic-edit
i18n: translation update from Hosted Weblate
2026-05-12 09:41:41 -06:00
Levi Portenier
d123bc0a51
Merge pull request #566 from pop-os/epoch-update
Epoch 1.0.12 version update
2026-05-05 14:57:43 -06:00
Jeremy Soller
2a60283f14 Epoch 1.0.12 version update
Generated by cosmic-epoch scripts/version-update.sh
2026-05-05 13:21:26 -06:00
Hosted Weblate
7de9ba756c
i18n: translation updates from weblate
Co-authored-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Co-authored-by: BoneNI <bounkirdni@gmail.com>
Co-authored-by: Feike Donia <feikedonia@proton.me>
Co-authored-by: Filippos Papadopoulos <filippospap.developer@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Jim Spentzos <jimspentzos2000@gmail.com>
Co-authored-by: Konstantinos <kostas.lampropoulos94@gmail.com>
Co-authored-by: Nara Díaz Viñolas <nara.diaz.vinolas@gmail.com>
Co-authored-by: Tadas Misiūnas <tadujo@gmail.com>
Co-authored-by: Vilius Paliokas <viliuspaliokas@gmail.com>
Co-authored-by: Марко М. Костић <marko.m.kostic@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-edit/ca/
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-edit/el/
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-edit/lt/
Translate-URL: https://hosted.weblate.org/projects/pop-os/cosmic-edit/sr/
Translation: Pop OS/COSMIC Edit
2026-05-03 01:52:13 +02:00
KENZ
4c53d607f7
feat(ime): minimal IME support for the text_box widget (#539)
* Support CJK input method

* Fix the input method window occasionally jumps around

Use the previous caret(text cursor) position to place the input method
window when the position is not available

* refactor: Omit calling request_input_method() if doesn't focus

- iced UserInterface.update() starts with InputMethod::Disabled state,
  and merges any input_method_request() which is InputMethod::Enabled in
  widgets tree traversal.
- We don't enable the input method feature if the widget doesn't have
  focus, we can safely omit request_input_method() call itself.
2026-04-27 16:05:22 -06:00
12 changed files with 779 additions and 877 deletions

1263
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

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

18
debian/changelog vendored
View file

@ -1,3 +1,21 @@
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
* Epoch 1.0.11 version update

View file

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

View file

@ -7,7 +7,7 @@ open-project = Άνοιγμα έργου
## Document statistics
document-statistics = Στατιστικά εγγράφου
word-count = Λέξεις
word-count = Πλήθος λέξεων
character-count = Χαρακτήρες
character-count-no-spaces = Χαρακτήρες (χωρίς κενά)
line-count = Γραμμές
@ -20,13 +20,13 @@ settings = Ρυθμίσεις
appearance = Εμφάνιση
theme = Θέμα
default-font = Γραμματοσειρά
default-font-size = Μέγεθος γραμματοσειράς
default-font = Προεπιλεγμένη γραμματοσειρά
default-font-size = Προεπιλεγμένο μέγεθος γραμματοσειράς
### Keyboard shortcuts
keyboard-shortcuts = Συντομεύσεις πλήκτρων
enable-vim-bindings = Ενεργοποίηση πλήκτρων vim
keyboard-shortcuts = Συντομεύσεις πληκτρολογίου
enable-vim-bindings = Ενεργοποίηση συντομεύσεων Vim
# Menu
@ -37,7 +37,7 @@ file = Αρχείο
new-file = Νέο αρχείο
new-window = Νέο παράθυρο
open-file = Άνοιγμα αρχείου...
todo = TODO
todo = Λίστα εργασιών
save = Αποθήκευση
save-as = Αποθήκευση ως...
revert-all-changes = Αναίρεση όλων των αλλαγών
@ -62,23 +62,60 @@ spell-check = Έλεγχος ορθογραφίας...
## View
view = Προβολή
indentation = Εσοχές
indentation = Εσοχές κειμένου
### Indentation
automatic-indentation = Αυτόματη εισαγωγή εσοχών
tab-width = Πλάτος Tabs: { $tab_width }
convert-indentation-to-spaces = Μετατροπή εσοχών σε spaces
convert-indentation-to-tabs = Μετατροπή εσοχών σε tabs
word-wrap = Περιτύλιξη λέξεων
tab-width = Πλάτος στηλοθέτη: { $tab_width }
convert-indentation-to-spaces = Μετατροπή εσοχών σε κενά
convert-indentation-to-tabs = Μετατροπή εσοχών σε στηλοθέτες
word-wrap = Αναδίπλωση λέξεων
show-line-numbers = Εμφάνιση αριθμού γραμμών
highlight-current-line = Υπογράμμιση τρέχουσας γραμμής
syntax-highlighting = Υπογράμμιση συντακτικού...
highlight-current-line = Επισήμανση τρέχουσας γραμμής
syntax-highlighting = Επισήμανση συντακτικού...
menu-settings = Ρυθμίσεις...
menu-keyboard-shortcuts = Συντομεύσεις πλήκτρων...
menu-about = Σχετικά με τον επεξεργαστή κειμένου COSMIC...
menu-keyboard-shortcuts = Συντομεύσεις πληκτρολογίου...
menu-about = Σχετικά με την Επεξεργασία κειμένου COSMIC...
cancel = Ακύρωση
repository = Αποθετήριο
support = Υποστήριξη
dark = Σκοτεινό
light = Φωτεινό
dark = Σκουρόχρωμο
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…
stage = Előkészítés
staged-changes = Előkészített változtatások
unstage = Változtatások visszavonása előkészítésből
unstaged-changes = Előkészítésből visszavont változtatások
unstage = Előkészítés visszavonása
unstaged-changes = Nem előkészített változtatások
## Project search
@ -35,7 +35,7 @@ project-search = Projektkereső
## Prompt save changes
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
discard = Változtatások elvetése
save-all = Összes mentése
@ -68,7 +68,7 @@ find-next = Következő találat
replace-placeholder = Csere…
replace = Csere
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
wrap-around = Körbefutás
@ -100,7 +100,7 @@ quit = Kilépés
edit = Szerkesztés
undo = Visszavonás
redo = Visszaállítás
redo = Újra
cut = Kivágás
copy = Másolás
paste = Beillesztés

0
i18n/lo/cosmic_edit.ftl Normal file
View file

View file

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

View file

@ -0,0 +1,91 @@
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

@ -366,7 +366,7 @@ pub enum Message {
GitProjectStatus(Vec<(String, PathBuf, Vec<GitStatus>)>),
GitStage(PathBuf, PathBuf),
GitUnstage(PathBuf, PathBuf),
Key(Modifiers, keyboard::Key),
Key(Modifiers, keyboard::key::Physical, keyboard::Key),
LaunchUrl(String),
Modifiers(Modifiers),
NewFile,
@ -1455,6 +1455,7 @@ impl Application for App {
.author("System76")
.comments(fl!("comment"))
.license("GPL-3.0-only")
.license_url("https://spdx.org/licenses/GPL-3.0-only")
.developers([("Jeremy Soller", "jeremy@system76.com")])
.links([
(fl!("repository"), "https://github.com/pop-os/cosmic-edit"),
@ -2124,9 +2125,9 @@ impl Application for App {
|x| x,
);
}
Message::Key(modifiers, key) => {
Message::Key(modifiers, physical, key) => {
for (key_bind, action) in self.key_binds.iter() {
if key_bind.matches(modifiers, &key) {
if key_bind.matches(modifiers, &key, Some(&physical)) {
return self.update(action.message(None));
}
}
@ -2779,7 +2780,7 @@ impl Application for App {
// If that was the last tab, exit the application
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
@ -3307,12 +3308,15 @@ impl Application for App {
let mut subscriptions = vec![
event::listen_with(|event, status, window_id| match event {
event::Event::Keyboard(keyboard::Event::KeyPressed { modifiers, key, .. }) => {
match status {
event::Status::Ignored => Some(Message::Key(modifiers, key)),
event::Status::Captured => None,
}
}
event::Event::Keyboard(keyboard::Event::KeyPressed {
modifiers,
physical_key,
key,
..
}) => match status {
event::Status::Ignored => Some(Message::Key(modifiers, physical_key, key)),
event::Status::Captured => None,
},
event::Event::Keyboard(keyboard::Event::ModifiersChanged(modifiers)) => {
Some(Message::Modifiers(modifiers))
}

View file

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

View file

@ -7,6 +7,7 @@ use cosmic::{
Border, Radians, Shell, Transformation,
clipboard::Clipboard,
image,
input_method::{Event as InputMethodEvent, InputMethod, Preedit, Purpose},
keyboard::{Key, key::Named},
layout::{self, Layout},
renderer::{self, Quad, Renderer as _},
@ -16,6 +17,7 @@ use cosmic::{
operation::{self, Operation},
tree,
},
window::Event as WindowEvent,
},
iced::{
Color, Element, Length, Padding, Point, Rectangle, Size, Vector,
@ -127,6 +129,35 @@ where
self.on_focus = Some(on_focus);
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>(
@ -794,7 +825,7 @@ where
let scrollbar_color = if pressed {
// pressed_state_color, 0.5
cosmic_theme
.background
.background(false)
.component
.pressed
.without_alpha()
@ -803,7 +834,7 @@ where
} else if hover {
// hover_state_color, 0.2
cosmic_theme
.background
.background(false)
.component
.hover
.without_alpha()
@ -890,7 +921,7 @@ where
let scrollbar_color = if pressed {
// pressed_state_color, 0.5
cosmic_theme
.background
.background(false)
.component
.pressed
.without_alpha()
@ -899,7 +930,7 @@ where
} else if hover {
// hover_state_color, 0.2
cosmic_theme
.background
.background(false)
.component
.hover
.without_alpha()
@ -1101,6 +1132,33 @@ where
}
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)) => {
if let Some(p) = cursor_position.position_in(layout.bounds()) {
state.is_focused = true;
@ -1336,6 +1394,12 @@ where
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));
}
}
_ => (),
}
@ -1385,6 +1449,8 @@ pub struct State {
scrollbar_h_rect: Cell<Option<Rectangle<f32>>>,
handle_opt: Mutex<Option<image::Handle>>,
shift_anchor: Mutex<Option<Cursor>>,
caret_position: (i32, i32),
preedit: Option<Preedit>,
}
impl State {
@ -1402,6 +1468,8 @@ impl State {
scrollbar_h_rect: Cell::new(None),
handle_opt: Mutex::new(None),
shift_anchor: Mutex::new(None),
caret_position: (0, 0),
preedit: None,
}
}
}