Skip to content

v2.2.5 Had to modify dependency (iced graphics) to get cargo install to work #141

@sgharvey

Description

@sgharvey

Kubuntu Linux 24.04 LTS

Had to modify file in order to get cargo install --path . to work.
~/.cargo/git/checkouts/libcosmic-41009aea1d72760b/3e78eb2/iced/graphics/src/geometry/text.rs

I know it isn't your code, but I didn't change the rev for libcosmic from 3e78eb238159d90956e85e95e868164671b649f6. I checked out 2.2.5 of AndroidMic, not HEAD. Not sure if I did something wrong somehow, but this is what I had to do.

Problem

~/AndroidMic/RustApp$ cargo install --path .

   Compiling iced_graphics v0.14.0-dev (https://github.com/pop-os/libcosmic.git?rev=3e78eb238159d90956e85e95e868164671b649f6#3e78eb23)
error[E0061]: this method takes 8 arguments but 7 arguments were supplied
   --> /home/sgh/.cargo/git/checkouts/libcosmic-41009aea1d72760b/3e78eb2/iced/graphics/src/geometry/text.rs:51:29
    |
 51 |         let layout = buffer.layout(
    |                             ^^^^^^
...
 57 |             None,
    |             ---- argument #5 of type 'Ellipsize' is missing
    |
note: method defined here
   --> /home/sgh/.cargo/git/checkouts/cosmic-text-86aa5169cd4376e0/f31b9d8/src/buffer_line.rs:241:12
    |
241 |     pub fn layout(
    |            ^^^^^^
help: provide the argument
    |
 51 ~         let layout = buffer.layout(
 52 +             font_system.raw(),
 53 +             self.size.0,
 54 +             None,
 55 +             cosmic_text::Wrap::None,
 56 +             /* Ellipsize */,
 57 +             None,
 58 +             8,
 59 +             cosmic_text::Hinting::Disabled,
 60 ~         );
    |

For more information about this error, try 'rustc --explain E0061'.

What Worked For Me

index 7c2cdd89..09f8827e 100644
--- a/graphics/src/geometry/text.rs
+++ b/graphics/src/geometry/text.rs
@@ -47,12 +47,13 @@ impl Text {
             cosmic_text::AttrsList::new(&text::to_attributes(self.font)),
             text::to_shaping(self.shaping),
         );

         let layout = buffer.layout(
             font_system.raw(),
             self.size.0,
             None,
             cosmic_text::Wrap::None,
+            cosmic_text::Ellipsize::End(cosmic_text::EllipsizeHeightLimit::Lines(6)),
             None,
             8,
             cosmic_text::Hinting::Disabled,

I just guessed that 6 lines would be a good number, I haven't tried a different number and haven't had a reason to.

Whenever you get around to picking a new rev of libcosmic, this will probably fix itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions