From 55c1b0afe012d72337a35d2165f4947fb4df454b Mon Sep 17 00:00:00 2001 From: Hojjat Date: Mon, 29 Jun 2026 18:18:30 -0600 Subject: [PATCH 1/2] feat: add context menu to text input and selectable text fields chore: update libcosmic --- src/tab.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/tab.rs b/src/tab.rs index 33e3339..337ba6b 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -2386,10 +2386,8 @@ impl Item { widget::image(handle.clone()).into() } ItemThumbnail::Svg(handle) => widget::svg(handle.clone()).into(), - ItemThumbnail::Text(content) => widget::text_editor(content) - .class(cosmic::theme::iced::TextEditor::Custom(Box::new( - text_editor_class, - ))) + ItemThumbnail::Text(content) => widget::text_editor::text_editor(content) + .style(text_editor_class) .width(THUMBNAIL_SIZE as f32) .height(Length::Fixed(THUMBNAIL_SIZE as f32)) .padding(spacing.space_xxs) @@ -2440,7 +2438,7 @@ impl Item { ); let mut details = widget::column::with_capacity(8).spacing(space_xxxs); - details = details.push(widget::text::heading(self.name.clone())); + details = details.push(widget::selectable_text::heading(self.name.clone())); details = details.push(widget::text::body(fl!( "type", mime = self.mime.to_string() @@ -2497,21 +2495,21 @@ impl Item { let time_formatter = time_formatter(military_time); if let Ok(time) = metadata.created() { - details = details.push(widget::text::body(fl!( + details = details.push(widget::selectable_text::body(fl!( "item-created", created = format_time(time, &date_time_formatter, &time_formatter).to_string() ))); } if let Ok(time) = metadata.modified() { - details = details.push(widget::text::body(fl!( + details = details.push(widget::selectable_text::body(fl!( "item-modified", modified = format_time(time, &date_time_formatter, &time_formatter).to_string() ))); } if let Ok(time) = metadata.accessed() { - details = details.push(widget::text::body(fl!( + details = details.push(widget::selectable_text::body(fl!( "item-accessed", accessed = format_time(time, &date_time_formatter, &time_formatter).to_string() ))); @@ -5178,9 +5176,11 @@ impl Tab { } ItemThumbnail::Text(text) => { element_opt = Some( - widget::container(widget::text_editor(text).padding(space_xxs).class( - cosmic::theme::iced::TextEditor::Custom(Box::new(text_editor_class)), - )) + widget::container( + widget::text_editor::text_editor(text) + .padding(space_xxs) + .style(text_editor_class), + ) .center(Length::Fill) .into(), ); From 78ac96c613686e17df4ba9e31373d53e53f1c381 Mon Sep 17 00:00:00 2001 From: Hojjat Date: Fri, 7 Aug 2026 13:47:35 -0600 Subject: [PATCH 2/2] chore: update libcosmic --- Cargo.lock | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 280bfb1..642ebf2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -826,7 +826,7 @@ dependencies = [ [[package]] name = "build_helpers" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "cfg_aliases", ] @@ -1359,7 +1359,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "quote", "syn 2.0.119", @@ -1551,7 +1551,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "almost", "configparser", @@ -2871,7 +2871,7 @@ dependencies = [ "log", "presser", "thiserror 2.0.19", - "windows 0.62.2", + "windows 0.56.0", ] [[package]] @@ -3105,7 +3105,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.62.2", + "windows-core 0.56.0", ] [[package]] @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "iced" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "build_helpers", "dnd", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "accesskit", "accesskit_winit", @@ -3151,7 +3151,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "bitflags 2.13.1", "build_helpers", @@ -3177,7 +3177,7 @@ dependencies = [ [[package]] name = "iced_debug" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "iced_core", "iced_futures", @@ -3187,7 +3187,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "futures", "iced_core", @@ -3201,7 +3201,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "bitflags 2.13.1", "bytemuck", @@ -3222,7 +3222,7 @@ dependencies = [ [[package]] name = "iced_program" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "iced_graphics", "iced_runtime", @@ -3231,7 +3231,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -3243,7 +3243,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "build_helpers", "bytes", @@ -3259,7 +3259,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "bytemuck", "cosmic-text", @@ -3276,7 +3276,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "as-raw-xcb-connection", "bitflags 2.13.1", @@ -3308,7 +3308,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.14.2" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "build_helpers", "cosmic-client-toolkit", @@ -3327,7 +3327,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.14.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "build_helpers", "cosmic-client-toolkit", @@ -4449,7 +4449,7 @@ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "libcosmic" version = "1.0.0" -source = "git+https://github.com/pop-os/libcosmic.git#0ca1b784c931c946517379795ce87328c6a902b8" +source = "git+https://github.com/pop-os/libcosmic.git#1f8d8786940cc6db59d412153c5a03f69a20375c" dependencies = [ "apply", "ashpd 0.12.3",