mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-28 05:24:20 +01:00
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::notecache::NoteCache;
|
||||
use crate::timeline;
|
||||
use crate::widgets;
|
||||
use crate::ui;
|
||||
use crate::Result;
|
||||
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();
|
||||
|
||||
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(egui::Separator::default().spacing(0.0));
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ mod error;
|
||||
//mod note;
|
||||
//mod block;
|
||||
mod abbrev;
|
||||
mod widgets;
|
||||
mod fonts;
|
||||
mod images;
|
||||
mod result;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
pub mod note;
|
||||
pub mod username;
|
||||
|
||||
pub use note::Note;
|
||||
pub use username::Username;
|
||||
|
||||
use egui::Margin;
|
||||
|
||||
pub fn padding<R>(
|
||||
@@ -1,7 +1,7 @@
|
||||
pub mod contents;
|
||||
pub use contents::NoteContents;
|
||||
|
||||
use crate::{widgets, Damus};
|
||||
use crate::{ui, Damus};
|
||||
use egui::{Color32, Label, RichText, Sense, TextureHandle, Vec2};
|
||||
use nostrdb::{NoteKey, Transaction};
|
||||
|
||||
@@ -65,7 +65,7 @@ impl<'a> Note<'a> {
|
||||
ui.allocate_rect(rect, Sense::hover());
|
||||
ui.put(rect, |ui: &mut egui::Ui| {
|
||||
ui.add(
|
||||
widgets::Username::new(profile.as_ref().ok(), note.pubkey())
|
||||
ui::Username::new(profile.as_ref().ok(), note.pubkey())
|
||||
.abbreviated(8)
|
||||
.pk_colored(true),
|
||||
)
|
||||
@@ -114,7 +114,7 @@ impl<'a> Note<'a> {
|
||||
ui.horizontal(|ui| {
|
||||
ui.spacing_mut().item_spacing.x = 2.0;
|
||||
ui.add(
|
||||
widgets::Username::new(profile.as_ref().ok(), note.pubkey())
|
||||
ui::Username::new(profile.as_ref().ok(), note.pubkey())
|
||||
.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