Skip to content

Commit

Permalink
❤️(UI): add global dark/light mode switch to UI
Browse files Browse the repository at this point in the history
A global dark/light mode switch has been added to the user interface in the 'app.rs' code file. Rule-alignment for function chaining also has been updated to modify the indentation level and improve code readability.

Signed-off-by: Benign X <[email protected]>
  • Loading branch information
W-Mai committed Nov 21, 2023
1 parent b523551 commit f5229f1
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ impl MainApp {
&mut self.params.vis_progress,
0..=self.params.vis_progress_max,
)
.text("Progress")
.show_value(true),
.text("Progress")
.show_value(true),
);
});
StripBuilder::new(ui)
Expand Down Expand Up @@ -172,8 +172,8 @@ impl MainApp {
&mut self.params.trans_matrix[0][0],
-5.0..=5.0,
)
.text("m00")
.show_value(true),
.text("m00")
.show_value(true),
);
});
strip.cell(|ui| {
Expand All @@ -183,8 +183,8 @@ impl MainApp {
&mut self.params.trans_matrix[0][1],
-5.0..=5.0,
)
.text("m01")
.show_value(true),
.text("m01")
.show_value(true),
);
});
strip.cell(|ui| {
Expand All @@ -194,8 +194,8 @@ impl MainApp {
&mut self.params.trans_matrix[0][2],
-500.0..=500.0,
)
.text("m02")
.show_value(true),
.text("m02")
.show_value(true),
);
});
});
Expand All @@ -213,8 +213,8 @@ impl MainApp {
&mut self.params.trans_matrix[1][0],
-5.0..=5.0,
)
.text("m10")
.show_value(true),
.text("m10")
.show_value(true),
);
});
strip.cell(|ui| {
Expand All @@ -224,8 +224,8 @@ impl MainApp {
&mut self.params.trans_matrix[1][1],
-5.0..=5.0,
)
.text("m11")
.show_value(true),
.text("m11")
.show_value(true),
);
});
strip.cell(|ui| {
Expand All @@ -235,8 +235,8 @@ impl MainApp {
&mut self.params.trans_matrix[1][2],
-500.0..=500.0,
)
.text("m12")
.show_value(true),
.text("m12")
.show_value(true),
);
});
});
Expand All @@ -254,8 +254,8 @@ impl MainApp {
&mut self.params.trans_matrix[2][0],
-5.0..=5.0,
)
.text("m20")
.show_value(true),
.text("m20")
.show_value(true),
);
});
strip.cell(|ui| {
Expand All @@ -265,8 +265,8 @@ impl MainApp {
&mut self.params.trans_matrix[2][1],
-5.0..=5.0,
)
.text("m21")
.show_value(true),
.text("m21")
.show_value(true),
);
});
strip.cell(|ui| {
Expand All @@ -276,8 +276,8 @@ impl MainApp {
&mut self.params.trans_matrix[2][2],
-500.0..=500.0,
)
.text("m22")
.show_value(true),
.text("m22")
.show_value(true),
);
});
});
Expand Down Expand Up @@ -343,6 +343,8 @@ impl MainApp {
const VERSION: &str = env!("CARGO_PKG_VERSION");
use egui::special_emojis::GITHUB;
ui.horizontal_wrapped(|ui| {
egui::widgets::global_dark_light_mode_switch(ui);
ui.separator();
ui.heading("Vector Graphics Visualizer");
ui.separator();
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
Expand Down

0 comments on commit f5229f1

Please sign in to comment.