mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-15 14:24:19 +01:00
remove useless struct
we can just use tuples for compound ids Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -271,7 +271,7 @@ pub fn timeline_view(ui: &mut egui::Ui, app: &mut Damus, timeline: usize) {
|
||||
// need this for some reason??
|
||||
ui.add_space(3.0);
|
||||
|
||||
let scroll_id = ui.id().with(app.timelines[timeline].selected_view);
|
||||
let scroll_id = egui::Id::new(("tlscroll", app.timelines[timeline].selected_view, timeline));
|
||||
egui::ScrollArea::vertical()
|
||||
.id_source(scroll_id)
|
||||
.animated(false)
|
||||
|
||||
@@ -7,7 +7,6 @@ pub use options::NoteOptions;
|
||||
use crate::{colors, notecache::CachedNote, ui, ui::View, Damus};
|
||||
use egui::{Label, RichText, Sense};
|
||||
use nostrdb::{NoteKey, Transaction};
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
pub struct Note<'a> {
|
||||
app: &'a mut Damus,
|
||||
@@ -26,20 +25,6 @@ impl<'a> View for Note<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq, Debug, Clone, Copy)]
|
||||
struct ProfileAnimId {
|
||||
profile_key: u64,
|
||||
note_key: u64,
|
||||
}
|
||||
|
||||
impl Hash for ProfileAnimId {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
state.write_u8(0x12);
|
||||
self.profile_key.hash(state);
|
||||
self.note_key.hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
fn reply_desc(
|
||||
ui: &mut egui::Ui,
|
||||
txn: &Transaction,
|
||||
@@ -224,10 +209,7 @@ impl<'a> Note<'a> {
|
||||
} else {
|
||||
let (rect, size) = ui::anim::hover_expand(
|
||||
ui,
|
||||
egui::Id::new(ProfileAnimId {
|
||||
profile_key,
|
||||
note_key,
|
||||
}),
|
||||
egui::Id::new((profile_key, note_key)),
|
||||
pfp_size,
|
||||
expand_size,
|
||||
anim_speed,
|
||||
@@ -345,6 +327,7 @@ fn render_note_actionbar(ui: &mut egui::Ui) -> egui::InnerResponse<Option<BarAct
|
||||
egui::Button::image(egui::Image::new(img_data).max_width(10.0))
|
||||
//.stroke(egui::Stroke::NONE)
|
||||
.frame(false)
|
||||
.stroke(egui::Stroke::NONE)
|
||||
.fill(ui.style().visuals.panel_fill),
|
||||
)
|
||||
.clicked()
|
||||
|
||||
Reference in New Issue
Block a user