mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 17:14:21 +01:00
Fix text wrapping issues
Mentions were getting wrapped in a horizontal, which breaks the outer horizontal_wrapped in note contents. When this breaks, it seems to be breaking subsequent wrapping in notes. Remove the horizontal to the remaining text wrapping issues! Changelog-Fixed: Fix text wrapping glitches Fixes: https://github.com/damus-io/notedeck/issues/33 Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -42,7 +42,7 @@ impl<'a> Mention<'a> {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn show(self, ui: &mut egui::Ui) -> egui::InnerResponse<Option<NoteAction>> {
|
pub fn show(self, ui: &mut egui::Ui) -> Option<NoteAction> {
|
||||||
mention_ui(
|
mention_ui(
|
||||||
self.ndb,
|
self.ndb,
|
||||||
self.img_cache,
|
self.img_cache,
|
||||||
@@ -55,12 +55,6 @@ impl<'a> Mention<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl egui::Widget for Mention<'_> {
|
|
||||||
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
|
|
||||||
self.show(ui).response
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
#[profiling::function]
|
#[profiling::function]
|
||||||
fn mention_ui(
|
fn mention_ui(
|
||||||
@@ -71,10 +65,9 @@ fn mention_ui(
|
|||||||
ui: &mut egui::Ui,
|
ui: &mut egui::Ui,
|
||||||
size: f32,
|
size: f32,
|
||||||
selectable: bool,
|
selectable: bool,
|
||||||
) -> egui::InnerResponse<Option<NoteAction>> {
|
) -> Option<NoteAction> {
|
||||||
let link_color = ui.visuals().hyperlink_color;
|
let link_color = ui.visuals().hyperlink_color;
|
||||||
|
|
||||||
ui.horizontal(|ui| {
|
|
||||||
let profile = ndb.get_profile_by_pubkey(txn, pk).ok();
|
let profile = ndb.get_profile_by_pubkey(txn, pk).ok();
|
||||||
|
|
||||||
let name: String = format!(
|
let name: String = format!(
|
||||||
@@ -106,5 +99,4 @@ fn mention_ui(
|
|||||||
}
|
}
|
||||||
|
|
||||||
note_action
|
note_action
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ pub fn render_note_contents(
|
|||||||
txn,
|
txn,
|
||||||
profile.pubkey(),
|
profile.pubkey(),
|
||||||
)
|
)
|
||||||
.show(ui)
|
.show(ui);
|
||||||
.inner;
|
|
||||||
if act.is_some() {
|
if act.is_some() {
|
||||||
note_action = act;
|
note_action = act;
|
||||||
}
|
}
|
||||||
@@ -172,8 +172,8 @@ pub fn render_note_contents(
|
|||||||
txn,
|
txn,
|
||||||
npub.pubkey(),
|
npub.pubkey(),
|
||||||
)
|
)
|
||||||
.show(ui)
|
.show(ui);
|
||||||
.inner;
|
|
||||||
if act.is_some() {
|
if act.is_some() {
|
||||||
note_action = act;
|
note_action = act;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ pub fn reply_desc(
|
|||||||
)
|
)
|
||||||
.size(size)
|
.size(size)
|
||||||
.selectable(selectable)
|
.selectable(selectable)
|
||||||
.show(ui)
|
.show(ui);
|
||||||
.inner;
|
|
||||||
|
|
||||||
if action.is_some() {
|
if action.is_some() {
|
||||||
note_action = action;
|
note_action = action;
|
||||||
@@ -96,8 +95,7 @@ pub fn reply_desc(
|
|||||||
)
|
)
|
||||||
.size(size)
|
.size(size)
|
||||||
.selectable(selectable)
|
.selectable(selectable)
|
||||||
.show(ui)
|
.show(ui);
|
||||||
.inner;
|
|
||||||
|
|
||||||
if action.is_some() {
|
if action.is_some() {
|
||||||
note_action = action;
|
note_action = action;
|
||||||
@@ -119,8 +117,7 @@ pub fn reply_desc(
|
|||||||
)
|
)
|
||||||
.size(size)
|
.size(size)
|
||||||
.selectable(selectable)
|
.selectable(selectable)
|
||||||
.show(ui)
|
.show(ui);
|
||||||
.inner;
|
|
||||||
|
|
||||||
if action.is_some() {
|
if action.is_some() {
|
||||||
note_action = action;
|
note_action = action;
|
||||||
@@ -144,8 +141,7 @@ pub fn reply_desc(
|
|||||||
)
|
)
|
||||||
.size(size)
|
.size(size)
|
||||||
.selectable(selectable)
|
.selectable(selectable)
|
||||||
.show(ui)
|
.show(ui);
|
||||||
.inner;
|
|
||||||
|
|
||||||
if action.is_some() {
|
if action.is_some() {
|
||||||
note_action = action;
|
note_action = action;
|
||||||
@@ -166,8 +162,7 @@ pub fn reply_desc(
|
|||||||
)
|
)
|
||||||
.size(size)
|
.size(size)
|
||||||
.selectable(selectable)
|
.selectable(selectable)
|
||||||
.show(ui)
|
.show(ui);
|
||||||
.inner;
|
|
||||||
|
|
||||||
if action.is_some() {
|
if action.is_some() {
|
||||||
note_action = action;
|
note_action = action;
|
||||||
|
|||||||
Reference in New Issue
Block a user