commit 361d0e370839f0b5aa9e5f9019797603760c1e30
parent c5df47dc73eb502a99152fc992bf4e86250dd26b
Author: kernelkind <kernelkind@gmail.com>
Date: Wed, 13 Aug 2025 19:04:16 -0400
make search icon more customizable
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/crates/notedeck_columns/src/ui/side_panel.rs b/crates/notedeck_columns/src/ui/side_panel.rs
@@ -332,11 +332,11 @@ fn add_column_button() -> impl Widget {
}
}
-pub fn search_button() -> impl Widget {
- |ui: &mut egui::Ui| -> egui::Response {
+pub fn search_button_impl(color: egui::Color32, line_width: f32) -> impl Widget {
+ move |ui: &mut egui::Ui| -> egui::Response {
let max_size = ICON_WIDTH * ICON_EXPANSION_MULTIPLE; // max size of the widget
- let min_line_width_circle = 1.5; // width of the magnifying glass
- let min_line_width_handle = 1.5;
+ let min_line_width_circle = line_width; // width of the magnifying glass
+ let min_line_width_handle = line_width;
let helper = AnimationHelper::new(ui, "search-button", vec2(max_size, max_size));
let painter = ui.painter_at(helper.get_animation_rect());
@@ -359,8 +359,8 @@ pub fn search_button() -> impl Widget {
let handle_pos_2 =
circle_center + (handle_vec * (cur_outer_circle_radius + cur_handle_length));
- let circle_stroke = Stroke::new(cur_line_width_circle, colors::MID_GRAY);
- let handle_stroke = Stroke::new(cur_line_width_handle, colors::MID_GRAY);
+ let circle_stroke = Stroke::new(cur_line_width_circle, color);
+ let handle_stroke = Stroke::new(cur_line_width_handle, color);
painter.line_segment([handle_pos_1, handle_pos_2], handle_stroke);
painter.circle(
@@ -377,6 +377,10 @@ pub fn search_button() -> impl Widget {
}
}
+pub fn search_button() -> impl Widget {
+ search_button_impl(colors::MID_GRAY, 1.5)
+}
+
// TODO: convert to responsive button when expanded side panel impl is finished
fn add_deck_button() -> impl Widget {