mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
Minor cleanup of the demo code
This commit is contained in:
@@ -65,23 +65,17 @@ impl PlotDemo {
|
|||||||
egui::DragValue::new(circle_radius)
|
egui::DragValue::new(circle_radius)
|
||||||
.speed(0.1)
|
.speed(0.1)
|
||||||
.clamp_range(0.0..=f32::INFINITY)
|
.clamp_range(0.0..=f32::INFINITY)
|
||||||
// .logarithmic(true)
|
|
||||||
// .smallest_positive(1e-2)
|
|
||||||
.prefix("r: "),
|
.prefix("r: "),
|
||||||
);
|
);
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
ui.add(
|
ui.add(
|
||||||
egui::DragValue::new(&mut circle_center.x)
|
egui::DragValue::new(&mut circle_center.x)
|
||||||
.speed(0.1)
|
.speed(0.1)
|
||||||
// .logarithmic(true)
|
|
||||||
// .smallest_positive(1e-2)
|
|
||||||
.prefix("x: "),
|
.prefix("x: "),
|
||||||
);
|
);
|
||||||
ui.add(
|
ui.add(
|
||||||
egui::DragValue::new(&mut circle_center.y)
|
egui::DragValue::new(&mut circle_center.y)
|
||||||
.speed(1.0)
|
.speed(1.0)
|
||||||
// .logarithmic(true)
|
|
||||||
// .smallest_positive(1e-2)
|
|
||||||
.prefix("y: "),
|
.prefix("y: "),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ impl Widgets {
|
|||||||
|
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
ui.label("Password:");
|
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)
|
egui::TextEdit::singleline(&mut self.single_line_text_input)
|
||||||
.password(!self.show_password),
|
.password(!self.show_password),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user