Compare commits
15 commits
403d81e282
...
c3bd3782da
| Author | SHA1 | Date | |
|---|---|---|---|
| c3bd3782da | |||
| 30b334693f | |||
| 00e4487038 | |||
| cc2c274538 | |||
| 229b92c507 | |||
| cde36b1a5f | |||
| 6effc415e1 | |||
|
|
2600c6d38a | ||
|
|
dfcef22632 | ||
|
|
495f52cd5b | ||
|
|
eae9127fbe | ||
|
|
6ce200c84b | ||
|
|
b6627523f9 | ||
|
|
00a76ee709 | ||
|
|
bf217ab250 |
8 changed files with 495 additions and 720 deletions
1090
Cargo.lock
generated
1090
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
33
Cargo.toml
33
Cargo.toml
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "cosmic-edit"
|
name = "cosmic-edit"
|
||||||
version = "1.0.14"
|
version = "1.2.0"
|
||||||
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"
|
||||||
|
|
@ -33,7 +33,7 @@ i18n-embed-fl = "0.10"
|
||||||
rust-embed = "8"
|
rust-embed = "8"
|
||||||
|
|
||||||
[dependencies.cosmic-files]
|
[dependencies.cosmic-files]
|
||||||
git = "https://github.com/pop-os/cosmic-files.git"
|
path = "../cosmic-files"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
||||||
[dependencies.cosmic-syntax-theme]
|
[dependencies.cosmic-syntax-theme]
|
||||||
|
|
@ -43,11 +43,12 @@ git = "https://github.com/pop-os/cosmic-syntax-theme.git"
|
||||||
version = "0.19"
|
version = "0.19"
|
||||||
features = ["syntect", "vi"]
|
features = ["syntect", "vi"]
|
||||||
|
|
||||||
[dependencies.libcosmic]
|
# Yoda fork.
|
||||||
git = "https://github.com/pop-os/libcosmic.git"
|
[dependencies.libcosmic-yoda]
|
||||||
|
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", "winit", "surface-message"]
|
features = ["about", "multi-window", "tokio", "wayland", "surface-message"]
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
fork = "0.2"
|
fork = "0.2"
|
||||||
|
|
@ -57,16 +58,24 @@ xdgen = "0.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["dbus-config", "gvfs", "wgpu", "wayland"]
|
default = ["dbus-config", "gvfs", "wgpu", "wayland"]
|
||||||
dbus-config = ["libcosmic/dbus-config"]
|
dbus-config = ["libcosmic-yoda/dbus-config"]
|
||||||
gvfs = ["cosmic-files/gvfs"]
|
gvfs = ["cosmic-files/gvfs"]
|
||||||
wgpu = ["libcosmic/wgpu", "cosmic-files/wgpu"]
|
wgpu = ["libcosmic-yoda/wgpu", "cosmic-files/wgpu"]
|
||||||
wayland = ["libcosmic/wayland", "cosmic-files/wayland"]
|
wayland = ["libcosmic-yoda/wayland", "cosmic-files/wayland"]
|
||||||
|
|
||||||
[profile.release-with-debug]
|
[profile.release-with-debug]
|
||||||
inherits = "release"
|
inherits = "release"
|
||||||
debug = true
|
debug = true
|
||||||
|
|
||||||
# [patch.'https://github.com/pop-os/libcosmic']
|
[patch.crates-io]
|
||||||
# libcosmic = { git = "https://github.com/pop-os/libcosmic//" }
|
onig = { git = "https://github.com/rust-onig/rust-onig.git", branch = "main" }
|
||||||
# cosmic-config = { git = "https://github.com/pop-os/libcosmic//" }
|
onig_sys = { git = "https://github.com/rust-onig/rust-onig.git", branch = "main" }
|
||||||
# cosmic-theme = { git = "https://github.com/pop-os/libcosmic//" }
|
# 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
|
||||||
|
# (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" }
|
||||||
|
|
|
||||||
24
debian/changelog
vendored
24
debian/changelog
vendored
|
|
@ -1,3 +1,27 @@
|
||||||
|
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
|
cosmic-edit (1.0.14) noble; urgency=medium
|
||||||
|
|
||||||
* Epoch 1.0.14 version update
|
* Epoch 1.0.14 version update
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ Exec=cosmic-edit %F
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
MimeType=text/plain;
|
MimeType=text/plain;application/x-zerosize;
|
||||||
Icon=com.system76.CosmicEdit
|
Icon=com.system76.CosmicEdit
|
||||||
Categories=COSMIC;Utility;TextEditor;
|
Categories=COSMIC;Utility;TextEditor;
|
||||||
Keywords=Text;Editor;
|
Keywords=Text;Editor;
|
||||||
|
|
@ -26,6 +26,9 @@ 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);
|
||||||
|
|
|
||||||
51
src/main.rs
51
src/main.rs
|
|
@ -691,13 +691,7 @@ impl App {
|
||||||
return Some(NewTab::Exists(entity));
|
return Some(NewTab::Exists(entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add to recent files, ensuring only one entry
|
self.add_to_recents(&canonical);
|
||||||
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);
|
||||||
|
|
@ -707,6 +701,15 @@ 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();
|
||||||
|
|
@ -1455,6 +1458,7 @@ 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"),
|
||||||
|
|
@ -2586,11 +2590,18 @@ 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) {
|
||||||
if tab.path_opt.is_none() {
|
match tab.path_opt.clone() {
|
||||||
return self.update(Message::SaveAsDialog(Some(entity)));
|
Some(path) => {
|
||||||
|
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);
|
||||||
|
|
@ -2601,10 +2612,17 @@ 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) {
|
||||||
if tab.path_opt.is_none() {
|
match tab.path_opt.clone() {
|
||||||
log::warn!("{} has no path when doing save all", tab.title());
|
Some(path) => {
|
||||||
|
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();
|
||||||
|
|
@ -2648,6 +2666,11 @@ 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);
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ 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.component.on;
|
let mut color = theme.cosmic().background(false).component.on;
|
||||||
color.alpha *= 0.75;
|
color.alpha *= 0.75;
|
||||||
TextStyle {
|
TextStyle {
|
||||||
color: Some(color.into()),
|
color: Some(color.into()),
|
||||||
|
|
@ -160,7 +160,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.component;
|
let component = &cosmic.background(false).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()),
|
||||||
|
|
|
||||||
|
|
@ -825,7 +825,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
|
.background(false)
|
||||||
.component
|
.component
|
||||||
.pressed
|
.pressed
|
||||||
.without_alpha()
|
.without_alpha()
|
||||||
|
|
@ -834,7 +834,7 @@ where
|
||||||
} else if hover {
|
} else if hover {
|
||||||
// hover_state_color, 0.2
|
// hover_state_color, 0.2
|
||||||
cosmic_theme
|
cosmic_theme
|
||||||
.background
|
.background(false)
|
||||||
.component
|
.component
|
||||||
.hover
|
.hover
|
||||||
.without_alpha()
|
.without_alpha()
|
||||||
|
|
@ -921,7 +921,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
|
.background(false)
|
||||||
.component
|
.component
|
||||||
.pressed
|
.pressed
|
||||||
.without_alpha()
|
.without_alpha()
|
||||||
|
|
@ -930,7 +930,7 @@ where
|
||||||
} else if hover {
|
} else if hover {
|
||||||
// hover_state_color, 0.2
|
// hover_state_color, 0.2
|
||||||
cosmic_theme
|
cosmic_theme
|
||||||
.background
|
.background(false)
|
||||||
.component
|
.component
|
||||||
.hover
|
.hover
|
||||||
.without_alpha()
|
.without_alpha()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue