iris: add positioned text overflow

This commit is contained in:
iris committed 2026-09-12 19:58:02 -04:00
1 parent cb5f11d21a
commit 1f0a7b5f94
22 files changed
+771 -43

No files matched your search

+2 -2
View File
@@ -69,7 +69,7 @@ struct ImeState {
fn placeholder<Rsc: HasEvents>(rsc: &mut Rsc, message: &str) -> StrongWidget {
wtext(message.to_string())
.color(PaintId::WHITE)
.wrap(true)
.overflow(TextOverflow::Wrap)
.pad(16)
.add_strong(rsc)
.any()
@@ -122,7 +122,7 @@ impl BenchClient {
let report_display = wtext("")
.editable(EditMode::MultiLine)
.text_align(Align::LEFT)
.wrap(true)
.overflow(TextOverflow::Wrap)
.size(14)
.color(PaintId::WHITE)
.attr::<Selectable>(())
+1 -1
View File
@@ -37,7 +37,7 @@ fn build_transport() -> Result<UreqTransport, String> {
fn placeholder<Rsc: HasEvents>(rsc: &mut Rsc, message: &str) -> StrongWidget {
wtext(message.to_string())
.color(PaintId::WHITE)
.wrap(true)
.overflow(TextOverflow::Wrap)
.pad(16)
.add_strong(rsc)
.any()
+2 -2
View File
@@ -325,7 +325,7 @@ fn session_row(rsc: &mut StdRsc<Client>, session: &SessionSummary, selected: boo
let label = format!("{}\n{}", session.title, session.status);
wtext(label)
.color(PaintId::WHITE)
.wrap(true)
.overflow(TextOverflow::Wrap)
.pad(10)
.width(rest(1))
.background(rect(bg))
@@ -342,7 +342,7 @@ fn session_row(rsc: &mut StdRsc<Client>, session: &SessionSummary, selected: boo
fn placeholder(rsc: &mut StdRsc<Client>, message: &str) -> StrongWidget {
wtext(message.to_string())
.color(PaintId::WHITE)
.wrap(true)
.overflow(TextOverflow::Wrap)
.pad(16)
.add_strong(rsc)
.any()
+1 -1
View File
@@ -53,7 +53,7 @@ where
let field = wtext("")
.editable(EditMode::MultiLine)
.text_align(Align::LEFT)
.wrap(true)
.overflow(TextOverflow::Wrap)
.size(18)
.color(theme.text.clone())
.attr::<Selectable>(())
+7 -3
View File
@@ -197,7 +197,11 @@ where
let field = wtext(rendered.text)
.spans(rendered.spans)
.text_align(Align::LEFT)
.wrap(!verbatim)
.overflow(if verbatim {
TextOverflow::Visible
} else {
TextOverflow::Wrap
})
.family(if verbatim { MONOSPACE } else { SANS_SERIF })
.size(BASE_SIZE)
.color(match frame {
@@ -218,8 +222,8 @@ where
.unwrap_or(SelectionInput::Tapped);
// Panning or selecting across a link must not open it.
if outcome == SelectionInput::Tapped {
let byte = field.selection(rsc).byte_at(pos, size);
let url = tap_links.url_at(byte);
let byte = field.selection(rsc).source_byte_at(pos, size);
let url = byte.and_then(|byte| tap_links.url_at(byte));
if let Some(url) = url {
log::info!("iris link: opening {url}");
<Rsc::State as OpenUrl>::open_url(ctx.state, &url);
+1 -2
View File
@@ -87,7 +87,7 @@ fn raw_block<Rsc: HasEvents>(rsc: &mut Rsc, body: TextBuilder<Rsc>, theme: &Them
where
Rsc::State: FocusHost,
{
let field = body.family(MONOSPACE).size(BODY_SIZE).wrap(false).add(rsc);
let field = body.family(MONOSPACE).size(BODY_SIZE).add(rsc);
field
.scrollable(Axis::X, Pin::Start)
.pad(dp(RAW_PAD_DP))
@@ -281,7 +281,6 @@ where
}
(false, Some(title)) => header.push(
text(title.to_string(), BODY_SIZE, shared.theme.muted.clone())
.wrap(false)
.masked()
.width(rest(1))
.add_strong(rsc)