Minor cleanup of the demo code

This commit is contained in:
Emil Ernerfeldt 2021-04-05 12:30:07 +02:00
parent ab4819ca99
commit 3803d0f3d1
2 changed files with 2 additions and 7 deletions

View File

@ -65,23 +65,17 @@ impl PlotDemo {
egui::DragValue::new(circle_radius)
.speed(0.1)
.clamp_range(0.0..=f32::INFINITY)
// .logarithmic(true)
// .smallest_positive(1e-2)
.prefix("r: "),
);
ui.horizontal(|ui| {
ui.add(
egui::DragValue::new(&mut circle_center.x)
.speed(0.1)
// .logarithmic(true)
// .smallest_positive(1e-2)
.prefix("x: "),
);
ui.add(
egui::DragValue::new(&mut circle_center.y)
.speed(1.0)
// .logarithmic(true)
// .smallest_positive(1e-2)
.prefix("y: "),
);
});

View File

@ -131,7 +131,8 @@ impl Widgets {
ui.horizontal(|ui| {
ui.label("Password:");
let response = ui.add(
let response = ui.add_sized(
[140.0, 20.0],
egui::TextEdit::singleline(&mut self.single_line_text_input)
.password(!self.show_password),
);