notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit b58150162087aa13178ee4b575ec19fadbda17aa
parent 6ab8eb078ec2d21d92c35d193e3600b12acf040f
Author: kernelkind <kernelkind@gmail.com>
Date:   Fri, 29 Nov 2024 12:42:59 -0500

add missing light mode icons

Closes: #502
Signed-off-by: kernelkind <kernelkind@gmail.com>

Diffstat:
Aassets/icons/add_column_light_4x.png | 0
Aassets/icons/column_delete_icon_light_4x.png | 0
Aassets/icons/help_icon_inverted_4x.png | 0
Aassets/icons/repost_light_4x.png | 0
Aassets/icons/settings_light_4x.png | 0
Msrc/nav.rs | 6+++++-
Msrc/ui/note/mod.rs | 12++++++++----
Msrc/ui/side_panel.rs | 22++++++++++++++++------
8 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/assets/icons/add_column_light_4x.png b/assets/icons/add_column_light_4x.png Binary files differ. diff --git a/assets/icons/column_delete_icon_light_4x.png b/assets/icons/column_delete_icon_light_4x.png Binary files differ. diff --git a/assets/icons/help_icon_inverted_4x.png b/assets/icons/help_icon_inverted_4x.png Binary files differ. diff --git a/assets/icons/repost_light_4x.png b/assets/icons/repost_light_4x.png Binary files differ. diff --git a/assets/icons/settings_light_4x.png b/assets/icons/settings_light_4x.png Binary files differ. diff --git a/src/nav.rs b/src/nav.rs @@ -352,7 +352,11 @@ fn delete_column_button( let img_size = 16.0; let max_size = icon_width * ICON_EXPANSION_MULTIPLE; - let img_data = egui::include_image!("../assets/icons/column_delete_icon_4x.png"); + let img_data = if ui.visuals().dark_mode { + egui::include_image!("../assets/icons/column_delete_icon_4x.png") + } else { + egui::include_image!("../assets/icons/column_delete_icon_light_4x.png") + }; let img = egui::Image::new(img_data).max_width(img_size); let button_rect = { diff --git a/src/ui/note/mod.rs b/src/ui/note/mod.rs @@ -370,7 +370,7 @@ impl<'a> NoteView<'a> { ui.horizontal(|ui| { ui.vertical(|ui| { ui.add_space(2.0); - ui.add_sized([20.0, 20.0], repost_icon()); + ui.add_sized([20.0, 20.0], repost_icon(ui.visuals().dark_mode)); }); ui.add_space(6.0); let resp = ui.add(one_line_display_name_widget( @@ -714,8 +714,12 @@ fn reply_button(ui: &mut egui::Ui, note_key: NoteKey) -> egui::Response { resp.union(put_resp) } -fn repost_icon() -> egui::Image<'static> { - let img_data = egui::include_image!("../../../assets/icons/repost_icon_4x.png"); +fn repost_icon(dark_mode: bool) -> egui::Image<'static> { + let img_data = if dark_mode { + egui::include_image!("../../../assets/icons/repost_icon_4x.png") + } else { + egui::include_image!("../../../assets/icons/repost_light_4x.png") + }; egui::Image::new(img_data) } @@ -726,7 +730,7 @@ fn quote_repost_button(ui: &mut egui::Ui, note_key: NoteKey) -> egui::Response { let expand_size = 5.0; let rect = rect.translate(egui::vec2(-(expand_size / 2.0), 0.0)); - let put_resp = ui.put(rect, repost_icon().max_width(size)); + let put_resp = ui.put(rect, repost_icon(ui.visuals().dark_mode).max_width(size)); resp.union(put_resp) } diff --git a/src/ui/side_panel.rs b/src/ui/side_panel.rs @@ -263,11 +263,14 @@ impl<'a> DesktopSidePanel<'a> { } fn settings_button(dark_mode: bool) -> impl Widget { - let _ = dark_mode; - |ui: &mut egui::Ui| { + move |ui: &mut egui::Ui| { let img_size = 24.0; let max_size = ICON_WIDTH * ICON_EXPANSION_MULTIPLE; // max size of the widget - let img_data = egui::include_image!("../../assets/icons/settings_dark_4x.png"); + let img_data = if dark_mode { + egui::include_image!("../../assets/icons/settings_dark_4x.png") + } else { + egui::include_image!("../../assets/icons/settings_light_4x.png") + }; let img = egui::Image::new(img_data).max_width(img_size); let helper = AnimationHelper::new(ui, "settings-button", vec2(max_size, max_size)); @@ -285,12 +288,15 @@ fn settings_button(dark_mode: bool) -> impl Widget { } fn add_column_button(dark_mode: bool) -> impl Widget { - let _ = dark_mode; move |ui: &mut egui::Ui| { let img_size = 24.0; let max_size = ICON_WIDTH * ICON_EXPANSION_MULTIPLE; // max size of the widget - let img_data = egui::include_image!("../../assets/icons/add_column_dark_4x.png"); + let img_data = if dark_mode { + egui::include_image!("../../assets/icons/add_column_dark_4x.png") + } else { + egui::include_image!("../../assets/icons/add_column_light_4x.png") + }; let img = egui::Image::new(img_data).max_width(img_size); @@ -418,7 +424,11 @@ fn support_button() -> impl Widget { let img_size = 16.0; let max_size = ICON_WIDTH * ICON_EXPANSION_MULTIPLE; // max size of the widget - let img_data = egui::include_image!("../../assets/icons/help_icon_dark_4x.png"); + let img_data = if ui.visuals().dark_mode { + egui::include_image!("../../assets/icons/help_icon_dark_4x.png") + } else { + egui::include_image!("../../assets/icons/help_icon_inverted_4x.png") + }; let img = egui::Image::new(img_data).max_width(img_size); let helper = AnimationHelper::new(ui, "help-button", vec2(max_size, max_size));