chore: adapt latest changes from GPUI and nostr-sdk

This commit is contained in:
2025-01-30 08:03:39 +07:00
parent 72a6d79bc5
commit 82f18fc478
19 changed files with 276 additions and 186 deletions

View File

@@ -271,12 +271,14 @@ impl TextElement {
// print_points_as_svg_path(&line_corners, &points);
let first_p = *points.first().unwrap();
let mut path = gpui::Path::new(bounds.origin + first_p);
let first_p = *points.get(0).unwrap();
let mut builder = gpui::PathBuilder::fill();
builder.move_to(bounds.origin + first_p);
for p in points.iter().skip(1) {
path.line_to(bounds.origin + *p);
builder.line_to(bounds.origin + *p);
}
Some(path)
builder.build().ok()
}
}
@@ -423,7 +425,7 @@ impl Element for TextElement {
let lines = window
.text_system()
.shape_text(display_text, font_size, &runs, wrap_width)
.shape_text(display_text, font_size, &runs, wrap_width, None)
.unwrap();
// `position_for_index` for example

View File

@@ -1492,14 +1492,14 @@ impl Render for TextInput {
.id("TextElement")
.flex_grow()
.overflow_x_hidden()
.child(TextElement::new(cx.model().clone())),
.child(TextElement::new(cx.entity().clone())),
)
.when(self.loading, |this| {
this.child(Indicator::new().color(cx.theme().base.step(cx, ColorScaleStep::ELEVEN)))
})
.children(suffix)
.when(self.is_multi_line(), |this| {
let entity_id = cx.model().entity_id();
let entity_id = cx.entity().entity_id();
if self.last_layout.is_some() {
let scroll_size = self.scroll_size;