fix inline note preview colors
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -66,8 +66,8 @@ pub fn desktop_dark_color_theme() -> ColorTheme {
|
|||||||
|
|
||||||
// NONINTERACTIVE WIDGET
|
// NONINTERACTIVE WIDGET
|
||||||
noninteractive_bg_fill: DARK_ISH_BG,
|
noninteractive_bg_fill: DARK_ISH_BG,
|
||||||
noninteractive_weak_bg_fill: SEMI_DARKER_BG,
|
noninteractive_weak_bg_fill: DARK_BG,
|
||||||
noninteractive_bg_stroke_color: DARK_BG,
|
noninteractive_bg_stroke_color: SEMI_DARKER_BG,
|
||||||
noninteractive_fg_stroke_color: GRAY_SECONDARY,
|
noninteractive_fg_stroke_color: GRAY_SECONDARY,
|
||||||
|
|
||||||
// INACTIVE WIDGET
|
// INACTIVE WIDGET
|
||||||
|
|||||||
@@ -296,9 +296,10 @@ pub fn timeline_view(ui: &mut egui::Ui, app: &mut Damus, timeline: usize) {
|
|||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
let textmode = app.textmode;
|
ui::padding(8.0, ui, |ui| {
|
||||||
let note_ui = ui::Note::new(app, ¬e).note_previews(!textmode);
|
let textmode = app.textmode;
|
||||||
ui.add(note_ui);
|
ui.add(ui::Note::new(app, ¬e).note_previews(!textmode));
|
||||||
|
});
|
||||||
ui::hline(ui);
|
ui::hline(ui);
|
||||||
//ui.add(egui::Separator::default().spacing(0.0));
|
//ui.add(egui::Separator::default().spacing(0.0));
|
||||||
|
|
||||||
|
|||||||
@@ -80,12 +80,13 @@ fn render_note_preview(
|
|||||||
};
|
};
|
||||||
|
|
||||||
egui::Frame::none()
|
egui::Frame::none()
|
||||||
//.fill(egui::Color32::BLACK.gamma_multiply(0.2))
|
.fill(ui.visuals().noninteractive().bg_fill)
|
||||||
//
|
.inner_margin(egui::Margin::same(8.0))
|
||||||
|
.outer_margin(egui::Margin::symmetric(0.0, 8.0))
|
||||||
.rounding(egui::Rounding::same(10.0))
|
.rounding(egui::Rounding::same(10.0))
|
||||||
.stroke(egui::Stroke::new(
|
.stroke(egui::Stroke::new(
|
||||||
1.0,
|
1.0,
|
||||||
egui::Color32::from_rgb(0x2C, 0x2C, 0x2C),
|
ui.visuals().noninteractive().bg_stroke.color,
|
||||||
))
|
))
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
ui.add(
|
ui.add(
|
||||||
|
|||||||
@@ -192,92 +192,90 @@ impl<'a> Note<'a> {
|
|||||||
let note_key = self.note.key().expect("todo: support non-db notes");
|
let note_key = self.note.key().expect("todo: support non-db notes");
|
||||||
let txn = self.note.txn().expect("todo: support non-db notes");
|
let txn = self.note.txn().expect("todo: support non-db notes");
|
||||||
|
|
||||||
crate::ui::padding(12.0, ui, |ui| {
|
ui.with_layout(egui::Layout::left_to_right(egui::Align::TOP), |ui| {
|
||||||
ui.with_layout(egui::Layout::left_to_right(egui::Align::TOP), |ui| {
|
ui.spacing_mut().item_spacing.x = 16.0;
|
||||||
ui.spacing_mut().item_spacing.x = 16.0;
|
|
||||||
|
|
||||||
let profile = self.app.ndb.get_profile_by_pubkey(txn, self.note.pubkey());
|
let profile = self.app.ndb.get_profile_by_pubkey(txn, self.note.pubkey());
|
||||||
|
|
||||||
match profile
|
match profile
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.ok()
|
.ok()
|
||||||
.and_then(|p| p.record().profile()?.picture())
|
.and_then(|p| p.record().profile()?.picture())
|
||||||
{
|
{
|
||||||
// these have different lifetimes and types,
|
// these have different lifetimes and types,
|
||||||
// so the calls must be separate
|
// so the calls must be separate
|
||||||
Some(pic) => {
|
Some(pic) => {
|
||||||
let expand_size = 5.0;
|
let expand_size = 5.0;
|
||||||
let anim_speed = 0.05;
|
let anim_speed = 0.05;
|
||||||
let profile_key = profile.as_ref().unwrap().record().note_key();
|
let profile_key = profile.as_ref().unwrap().record().note_key();
|
||||||
let note_key = note_key.as_u64();
|
let note_key = note_key.as_u64();
|
||||||
|
|
||||||
if self.app.is_mobile() {
|
if self.app.is_mobile() {
|
||||||
ui.add(ui::ProfilePic::new(&mut self.app.img_cache, pic));
|
ui.add(ui::ProfilePic::new(&mut self.app.img_cache, pic));
|
||||||
} else {
|
} else {
|
||||||
let (rect, size) = ui::anim::hover_expand(
|
let (rect, size) = ui::anim::hover_expand(
|
||||||
ui,
|
ui,
|
||||||
egui::Id::new(ProfileAnimId {
|
egui::Id::new(ProfileAnimId {
|
||||||
profile_key,
|
profile_key,
|
||||||
note_key,
|
note_key,
|
||||||
}),
|
}),
|
||||||
ui::ProfilePic::default_size(),
|
ui::ProfilePic::default_size(),
|
||||||
expand_size,
|
expand_size,
|
||||||
anim_speed,
|
anim_speed,
|
||||||
);
|
|
||||||
|
|
||||||
ui.put(
|
|
||||||
rect,
|
|
||||||
ui::ProfilePic::new(&mut self.app.img_cache, pic).size(size),
|
|
||||||
)
|
|
||||||
.on_hover_ui_at_pointer(|ui| {
|
|
||||||
ui.set_max_width(300.0);
|
|
||||||
ui.add(ui::ProfilePreview::new(
|
|
||||||
profile.as_ref().unwrap(),
|
|
||||||
&mut self.app.img_cache,
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None => {
|
|
||||||
ui.add(ui::ProfilePic::new(
|
|
||||||
&mut self.app.img_cache,
|
|
||||||
ui::ProfilePic::no_pfp_url(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ui.with_layout(egui::Layout::top_down(egui::Align::LEFT), |ui| {
|
|
||||||
ui.horizontal(|ui| {
|
|
||||||
ui.spacing_mut().item_spacing.x = 2.0;
|
|
||||||
ui.add(
|
|
||||||
ui::Username::new(profile.as_ref().ok(), self.note.pubkey())
|
|
||||||
.abbreviated(20),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let cached_note = self
|
ui.put(
|
||||||
.app
|
rect,
|
||||||
.note_cache_mut()
|
ui::ProfilePic::new(&mut self.app.img_cache, pic).size(size),
|
||||||
.cached_note_or_insert_mut(note_key, self.note);
|
)
|
||||||
render_reltime(ui, cached_note, true);
|
.on_hover_ui_at_pointer(|ui| {
|
||||||
});
|
ui.set_max_width(300.0);
|
||||||
|
ui.add(ui::ProfilePreview::new(
|
||||||
ui.horizontal(|ui| {
|
profile.as_ref().unwrap(),
|
||||||
ui.spacing_mut().item_spacing.x = 2.0;
|
&mut self.app.img_cache,
|
||||||
reply_desc(ui, txn, self.app, note_key, self.note);
|
));
|
||||||
});
|
});
|
||||||
|
|
||||||
ui.add(NoteContents::new(
|
|
||||||
self.app,
|
|
||||||
txn,
|
|
||||||
self.note,
|
|
||||||
note_key,
|
|
||||||
self.options(),
|
|
||||||
));
|
|
||||||
|
|
||||||
if self.options().has_actionbar() {
|
|
||||||
render_note_actionbar(ui);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
ui.add(ui::ProfilePic::new(
|
||||||
|
&mut self.app.img_cache,
|
||||||
|
ui::ProfilePic::no_pfp_url(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ui.with_layout(egui::Layout::top_down(egui::Align::LEFT), |ui| {
|
||||||
|
ui.horizontal(|ui| {
|
||||||
|
ui.spacing_mut().item_spacing.x = 2.0;
|
||||||
|
ui.add(
|
||||||
|
ui::Username::new(profile.as_ref().ok(), self.note.pubkey())
|
||||||
|
.abbreviated(20),
|
||||||
|
);
|
||||||
|
|
||||||
|
let cached_note = self
|
||||||
|
.app
|
||||||
|
.note_cache_mut()
|
||||||
|
.cached_note_or_insert_mut(note_key, self.note);
|
||||||
|
render_reltime(ui, cached_note, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ui.horizontal(|ui| {
|
||||||
|
ui.spacing_mut().item_spacing.x = 2.0;
|
||||||
|
reply_desc(ui, txn, self.app, note_key, self.note);
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.add(NoteContents::new(
|
||||||
|
self.app,
|
||||||
|
txn,
|
||||||
|
self.note,
|
||||||
|
note_key,
|
||||||
|
self.options(),
|
||||||
|
));
|
||||||
|
|
||||||
|
if self.options().has_actionbar() {
|
||||||
|
render_note_actionbar(ui);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.response
|
.response
|
||||||
|
|||||||
Reference in New Issue
Block a user