@@ -12,7 +12,7 @@ use notedeck::{
12
12
use notedeck_columns:: { timeline:: kind:: ListKind , timeline:: TimelineKind , Damus } ;
13
13
14
14
use notedeck_dave:: { Dave , DaveAvatar } ;
15
- use notedeck_ui:: { AnimationHelper , ProfilePic } ;
15
+ use notedeck_ui:: { app_images , AnimationHelper , ProfilePic } ;
16
16
17
17
static ICON_WIDTH : f32 = 40.0 ;
18
18
pub static ICON_EXPANSION_MULTIPLE : f32 = 1.2 ;
@@ -438,8 +438,7 @@ fn milestone_name() -> impl Widget {
438
438
fn expand_side_panel_button ( ) -> impl Widget {
439
439
|ui : & mut egui:: Ui | -> egui:: Response {
440
440
let img_size = 40.0 ;
441
- let img_data = egui:: include_image!( "../../../assets/damus_rounded_80.png" ) ;
442
- let img = egui:: Image :: new ( img_data)
441
+ let img = app_images:: damus_image ( )
443
442
. max_width ( img_size)
444
443
. sense ( egui:: Sense :: click ( ) ) ;
445
444
@@ -450,17 +449,16 @@ fn expand_side_panel_button() -> impl Widget {
450
449
fn expanding_button (
451
450
name : & ' static str ,
452
451
img_size : f32 ,
453
- light_img : & egui:: ImageSource ,
454
- dark_img : & egui:: ImageSource ,
452
+ light_img : egui:: Image ,
453
+ dark_img : egui:: Image ,
455
454
ui : & mut egui:: Ui ,
456
455
) -> egui:: Response {
457
456
let max_size = ICON_WIDTH * ICON_EXPANSION_MULTIPLE ; // max size of the widget
458
- let img_data = if ui. visuals ( ) . dark_mode {
457
+ let img = if ui. visuals ( ) . dark_mode {
459
458
dark_img
460
459
} else {
461
460
light_img
462
461
} ;
463
- let img = egui:: Image :: new ( img_data. clone ( ) ) . max_width ( img_size) ;
464
462
465
463
let helper = AnimationHelper :: new ( ui, name, egui:: vec2 ( max_size, max_size) ) ;
466
464
@@ -479,8 +477,8 @@ fn support_button(ui: &mut egui::Ui) -> egui::Response {
479
477
expanding_button (
480
478
"help-button" ,
481
479
16.0 ,
482
- & egui :: include_image! ( "../../../assets/icons/help_icon_inverted_4x.png" ) ,
483
- & egui :: include_image! ( "../../../assets/icons/help_icon_dark_4x.png" ) ,
480
+ app_images :: help_light_image ( ) ,
481
+ app_images :: help_dark_image ( ) ,
484
482
ui,
485
483
)
486
484
}
@@ -489,8 +487,8 @@ fn settings_button(ui: &mut egui::Ui) -> egui::Response {
489
487
expanding_button (
490
488
"settings-button" ,
491
489
32.0 ,
492
- & egui :: include_image! ( "../../../assets/icons/settings_light_4x.png" ) ,
493
- & egui :: include_image! ( "../../../assets/icons/settings_dark_4x.png" ) ,
490
+ app_images :: settings_light_image ( ) ,
491
+ app_images :: settings_dark_image ( ) ,
494
492
ui,
495
493
)
496
494
}
@@ -499,8 +497,8 @@ fn notifications_button(ui: &mut egui::Ui) -> egui::Response {
499
497
expanding_button (
500
498
"notifications-button" ,
501
499
24.0 ,
502
- & egui :: include_image! ( "../../../assets/icons/notifications_dark_4x.png" ) ,
503
- & egui :: include_image! ( "../../../assets/icons/notifications_dark_4x.png" ) ,
500
+ app_images :: notifications_button_image ( ) ,
501
+ app_images :: notifications_button_image ( ) ,
504
502
ui,
505
503
)
506
504
}
@@ -509,15 +507,20 @@ fn home_button(ui: &mut egui::Ui) -> egui::Response {
509
507
expanding_button (
510
508
"home-button" ,
511
509
24.0 ,
512
- & egui :: include_image! ( "../../../assets/icons/home-toolbar.png" ) ,
513
- & egui :: include_image! ( "../../../assets/icons/home-toolbar.png" ) ,
510
+ app_images :: home_button_image ( ) ,
511
+ app_images :: home_button_image ( ) ,
514
512
ui,
515
513
)
516
514
}
517
515
518
516
fn columns_button ( ui : & mut egui:: Ui ) -> egui:: Response {
519
- let btn = egui:: include_image!( "../../../assets/icons/columns_80.png" ) ;
520
- expanding_button ( "columns-button" , 40.0 , & btn, & btn, ui)
517
+ expanding_button (
518
+ "columns-button" ,
519
+ 40.0 ,
520
+ app_images:: columns_image ( ) ,
521
+ app_images:: columns_image ( ) ,
522
+ ui,
523
+ )
521
524
}
522
525
523
526
fn dave_sidebar_rect ( ui : & mut egui:: Ui ) -> Rect {
@@ -574,9 +577,8 @@ fn wallet_button() -> impl Widget {
574
577
let img_size = 24.0 ;
575
578
576
579
let max_size = img_size * ICON_EXPANSION_MULTIPLE ;
577
- let img_data = egui:: include_image!( "../../../assets/icons/wallet-icon.svg" ) ;
578
580
579
- let mut img = egui :: Image :: new ( img_data ) . max_width ( img_size) ;
581
+ let mut img = app_images :: wallet_image ( ) . max_width ( img_size) ;
580
582
581
583
if !ui. visuals ( ) . dark_mode {
582
584
img = img. tint ( egui:: Color32 :: BLACK ) ;
0 commit comments