diff --git a/queries/reposts.json b/queries/reposts.json index d455956e..2e5f255d 100644 --- a/queries/reposts.json +++ b/queries/reposts.json @@ -1,7 +1 @@ -{ - "limit": 100, - "kinds": [ - 1, 6 - ], - "#p": ["32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"] -} +{ "limit": 100, "kinds": [ 6 ] } diff --git a/src/app_style.rs b/src/app_style.rs index 9cf9bc28..71a0b7d6 100644 --- a/src/app_style.rs +++ b/src/app_style.rs @@ -96,7 +96,7 @@ pub fn mobile_font_size(text_style: &NotedeckTextStyle) -> f32 { } } -#[derive(EnumIter)] +#[derive(Copy, Clone, Eq, PartialEq, Debug, EnumIter)] pub enum NotedeckTextStyle { Heading, Heading2, diff --git a/src/ui/note/mod.rs b/src/ui/note/mod.rs index 30426883..bc5c62e4 100644 --- a/src/ui/note/mod.rs +++ b/src/ui/note/mod.rs @@ -327,19 +327,21 @@ impl<'a> NoteView<'a> { action: None, } } else { - let txn = self.note.txn().expect("todo: support non-db notes"); + let txn = self.note.txn().expect("txn"); if let Some(note_to_repost) = get_reposted_note(self.ndb, txn, self.note) { let profile = self.ndb.get_profile_by_pubkey(txn, self.note.pubkey()); + let style = NotedeckTextStyle::Small; ui.horizontal(|ui| { ui.vertical(|ui| { ui.add_space(2.0); ui.add_sized([20.0, 20.0], repost_icon()); }); ui.add_space(6.0); - let resp = ui.add(one_line_display_name_widget(get_display_name( - profile.as_ref().ok(), - ))); + let resp = ui.add(one_line_display_name_widget( + get_display_name(profile.as_ref().ok()), + style, + )); if let Ok(rec) = &profile { resp.on_hover_ui_at_pointer(|ui| { ui.set_max_width(300.0); @@ -349,7 +351,8 @@ impl<'a> NoteView<'a> { ui.add_space(4.0); ui.label( RichText::new("Reposted") - .text_style(NotedeckTextStyle::Heading3.text_style()), + .color(colors::GRAY_SECONDARY) + .text_style(style.text_style()), ); }); NoteView::new(self.ndb, self.note_cache, self.img_cache, ¬e_to_repost).show(ui) diff --git a/src/ui/profile/preview.rs b/src/ui/profile/preview.rs index 42ea7b27..860177a9 100644 --- a/src/ui/profile/preview.rs +++ b/src/ui/profile/preview.rs @@ -198,17 +198,25 @@ fn display_name_widget( } } -pub fn one_line_display_name_widget(display_name: DisplayName<'_>) -> impl egui::Widget + '_ { +pub fn one_line_display_name_widget( + display_name: DisplayName<'_>, + style: NotedeckTextStyle, +) -> impl egui::Widget + '_ { + let text_style = style.text_style(); move |ui: &mut egui::Ui| match display_name { - DisplayName::One(n) => { - ui.label(RichText::new(n).text_style(NotedeckTextStyle::Heading3.text_style())) - } + DisplayName::One(n) => ui.label( + RichText::new(n) + .text_style(text_style) + .color(colors::GRAY_SECONDARY), + ), DisplayName::Both { display_name, username: _, } => ui.label( - RichText::new(display_name).text_style(NotedeckTextStyle::Heading3.text_style()), + RichText::new(display_name) + .text_style(text_style) + .color(colors::GRAY_SECONDARY), ), } }