From b32b226c7738559336a7bd3c226866350349cfd0 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Wed, 9 Aug 2023 02:51:50 +0300 Subject: [PATCH] ui: fix text ellipsize --- src/gui/views/network/connections/content.rs | 5 +---- src/gui/views/views.rs | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/views/network/connections/content.rs b/src/gui/views/network/connections/content.rs index 7989c5d..807917e 100644 --- a/src/gui/views/network/connections/content.rs +++ b/src/gui/views/network/connections/content.rs @@ -222,10 +222,7 @@ impl ConnectionsContent { // Draw connections URL. ui.add_space(4.0); let conn_text = format!("{} {}", COMPUTER_TOWER, conn.url); - ui.label(RichText::new(conn_text) - .color(Colors::TEXT) - .size(15.0)); - + View::ellipsize_text(ui, conn_text, 15.0, Colors::TEXT); ui.add_space(1.0); // Setup connection status text. diff --git a/src/gui/views/views.rs b/src/gui/views/views.rs index 322fb44..ef445d9 100644 --- a/src/gui/views/views.rs +++ b/src/gui/views/views.rs @@ -68,7 +68,7 @@ impl View { }); job.wrap = TextWrapping { max_rows: 1, - break_anywhere: false, + break_anywhere: true, overflow_character: Option::from('﹍'), ..Default::default() }; @@ -322,7 +322,7 @@ impl View { }); job.wrap = TextWrapping { max_rows: 1, - break_anywhere: false, + break_anywhere: true, overflow_character: Option::from('﹍'), ..Default::default() };