@@ -12,7 +12,7 @@ use notedeck::{
1212use notedeck_columns:: { timeline:: kind:: ListKind , timeline:: TimelineKind , Damus } ;
1313
1414use notedeck_dave:: { Dave , DaveAvatar } ;
15- use notedeck_ui:: { AnimationHelper , ProfilePic } ;
15+ use notedeck_ui:: { app_images , AnimationHelper , ProfilePic } ;
1616
1717static ICON_WIDTH : f32 = 40.0 ;
1818pub static ICON_EXPANSION_MULTIPLE : f32 = 1.2 ;
@@ -438,8 +438,7 @@ fn milestone_name() -> impl Widget {
438438fn expand_side_panel_button ( ) -> impl Widget {
439439 |ui : & mut egui:: Ui | -> egui:: Response {
440440 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 ( )
443442 . max_width ( img_size)
444443 . sense ( egui:: Sense :: click ( ) ) ;
445444
@@ -450,17 +449,16 @@ fn expand_side_panel_button() -> impl Widget {
450449fn expanding_button (
451450 name : & ' static str ,
452451 img_size : f32 ,
453- light_img : & egui:: ImageSource ,
454- dark_img : & egui:: ImageSource ,
452+ light_img : egui:: Image ,
453+ dark_img : egui:: Image ,
455454 ui : & mut egui:: Ui ,
456455) -> egui:: Response {
457456 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 {
459458 dark_img
460459 } else {
461460 light_img
462461 } ;
463- let img = egui:: Image :: new ( img_data. clone ( ) ) . max_width ( img_size) ;
464462
465463 let helper = AnimationHelper :: new ( ui, name, egui:: vec2 ( max_size, max_size) ) ;
466464
@@ -479,8 +477,8 @@ fn support_button(ui: &mut egui::Ui) -> egui::Response {
479477 expanding_button (
480478 "help-button" ,
481479 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 ( ) ,
484482 ui,
485483 )
486484}
@@ -489,8 +487,8 @@ fn settings_button(ui: &mut egui::Ui) -> egui::Response {
489487 expanding_button (
490488 "settings-button" ,
491489 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 ( ) ,
494492 ui,
495493 )
496494}
@@ -499,8 +497,8 @@ fn notifications_button(ui: &mut egui::Ui) -> egui::Response {
499497 expanding_button (
500498 "notifications-button" ,
501499 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 ( ) ,
504502 ui,
505503 )
506504}
@@ -509,15 +507,20 @@ fn home_button(ui: &mut egui::Ui) -> egui::Response {
509507 expanding_button (
510508 "home-button" ,
511509 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 ( ) ,
514512 ui,
515513 )
516514}
517515
518516fn 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+ )
521524}
522525
523526fn dave_sidebar_rect ( ui : & mut egui:: Ui ) -> Rect {
@@ -574,9 +577,8 @@ fn wallet_button() -> impl Widget {
574577 let img_size = 24.0 ;
575578
576579 let max_size = img_size * ICON_EXPANSION_MULTIPLE ;
577- let img_data = egui:: include_image!( "../../../assets/icons/wallet-icon.svg" ) ;
578580
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) ;
580582
581583 if !ui. visuals ( ) . dark_mode {
582584 img = img. tint ( egui:: Color32 :: BLACK ) ;
0 commit comments