feat(app_images): add module to manage static app image assets

This commit is contained in:
Fernando López Guevara
2025-06-04 19:52:04 -03:00
committed by William Casarin
parent 48f17f91b8
commit 36667bc024
19 changed files with 358 additions and 160 deletions

View File

@@ -1,10 +1,11 @@
use egui::{
Align, Button, Frame, Image, InnerResponse, Layout, RichText, ScrollArea, Ui, UiBuilder, Vec2,
Align, Button, Frame, InnerResponse, Layout, RichText, ScrollArea, Ui, UiBuilder, Vec2,
};
use nostrdb::{Ndb, Transaction};
use notedeck::{Accounts, Images};
use notedeck_ui::colors::PINK;
use notedeck_ui::app_images;
use notedeck_ui::profile::preview::SimpleProfilePreview;
pub struct AccountsView<'a> {
@@ -175,10 +176,8 @@ fn scroll_area() -> ScrollArea {
}
fn add_account_button() -> Button<'static> {
let img_data = egui::include_image!("../../../../assets/icons/add_account_icon_4x.png");
let img = Image::new(img_data).fit_to_exact_size(Vec2::new(48.0, 48.0));
Button::image_and_text(
img,
app_images::add_account_image().fit_to_exact_size(Vec2::new(48.0, 48.0)),
RichText::new(" Add account")
.size(16.0)
// TODO: this color should not be hard coded. Find some way to add it to the visuals