refactor: rename widgets to ui
consolidate ui related things like widgets into our ui module Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -5,7 +5,7 @@ use crate::frame_history::FrameHistory;
|
|||||||
use crate::imgcache::ImageCache;
|
use crate::imgcache::ImageCache;
|
||||||
use crate::notecache::NoteCache;
|
use crate::notecache::NoteCache;
|
||||||
use crate::timeline;
|
use crate::timeline;
|
||||||
use crate::widgets;
|
use crate::ui;
|
||||||
use crate::Result;
|
use crate::Result;
|
||||||
use egui::containers::scroll_area::ScrollBarVisibility;
|
use egui::containers::scroll_area::ScrollBarVisibility;
|
||||||
|
|
||||||
@@ -522,7 +522,7 @@ fn render_notes(ui: &mut egui::Ui, damus: &mut Damus, timeline: usize) {
|
|||||||
let num_notes = damus.timelines[timeline].notes.len();
|
let num_notes = damus.timelines[timeline].notes.len();
|
||||||
|
|
||||||
for i in 0..num_notes {
|
for i in 0..num_notes {
|
||||||
let note = widgets::Note::new(damus, damus.timelines[timeline].notes[i].key, timeline);
|
let note = ui::Note::new(damus, damus.timelines[timeline].notes[i].key, timeline);
|
||||||
ui.add(note);
|
ui.add(note);
|
||||||
ui.add(egui::Separator::default().spacing(0.0));
|
ui.add(egui::Separator::default().spacing(0.0));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ mod error;
|
|||||||
//mod note;
|
//mod note;
|
||||||
//mod block;
|
//mod block;
|
||||||
mod abbrev;
|
mod abbrev;
|
||||||
mod widgets;
|
|
||||||
mod fonts;
|
mod fonts;
|
||||||
mod images;
|
mod images;
|
||||||
mod result;
|
mod result;
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
pub mod note;
|
||||||
|
pub mod username;
|
||||||
|
|
||||||
|
pub use note::Note;
|
||||||
|
pub use username::Username;
|
||||||
|
|
||||||
use egui::Margin;
|
use egui::Margin;
|
||||||
|
|
||||||
pub fn padding<R>(
|
pub fn padding<R>(
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
pub mod contents;
|
pub mod contents;
|
||||||
pub use contents::NoteContents;
|
pub use contents::NoteContents;
|
||||||
|
|
||||||
use crate::{widgets, Damus};
|
use crate::{ui, Damus};
|
||||||
use egui::{Color32, Label, RichText, Sense, TextureHandle, Vec2};
|
use egui::{Color32, Label, RichText, Sense, TextureHandle, Vec2};
|
||||||
use nostrdb::{NoteKey, Transaction};
|
use nostrdb::{NoteKey, Transaction};
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ impl<'a> Note<'a> {
|
|||||||
ui.allocate_rect(rect, Sense::hover());
|
ui.allocate_rect(rect, Sense::hover());
|
||||||
ui.put(rect, |ui: &mut egui::Ui| {
|
ui.put(rect, |ui: &mut egui::Ui| {
|
||||||
ui.add(
|
ui.add(
|
||||||
widgets::Username::new(profile.as_ref().ok(), note.pubkey())
|
ui::Username::new(profile.as_ref().ok(), note.pubkey())
|
||||||
.abbreviated(8)
|
.abbreviated(8)
|
||||||
.pk_colored(true),
|
.pk_colored(true),
|
||||||
)
|
)
|
||||||
@@ -114,7 +114,7 @@ impl<'a> Note<'a> {
|
|||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
ui.spacing_mut().item_spacing.x = 2.0;
|
ui.spacing_mut().item_spacing.x = 2.0;
|
||||||
ui.add(
|
ui.add(
|
||||||
widgets::Username::new(profile.as_ref().ok(), note.pubkey())
|
ui::Username::new(profile.as_ref().ok(), note.pubkey())
|
||||||
.abbreviated(20),
|
.abbreviated(20),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
pub mod note;
|
|
||||||
pub mod username;
|
|
||||||
|
|
||||||
pub use note::Note;
|
|
||||||
pub use username::Username;
|
|
||||||
Reference in New Issue
Block a user