Clean up demo slightly
This commit is contained in:
parent
f8a3042258
commit
5d0e348777
3 changed files with 44 additions and 35 deletions
|
@ -147,7 +147,7 @@ impl WidgetGallery {
|
||||||
});
|
});
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
||||||
ui.add(doc_link_label("Combo box", "ComboBox"));
|
ui.add(doc_link_label("ComboBox", "ComboBox"));
|
||||||
|
|
||||||
egui::ComboBox::from_label("Take your pick")
|
egui::ComboBox::from_label("Take your pick")
|
||||||
.selected_text(format!("{:?}", radio))
|
.selected_text(format!("{:?}", radio))
|
||||||
|
@ -162,6 +162,10 @@ impl WidgetGallery {
|
||||||
ui.add(egui::Slider::new(scalar, 0.0..=360.0).suffix("°"));
|
ui.add(egui::Slider::new(scalar, 0.0..=360.0).suffix("°"));
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
||||||
|
ui.add(doc_link_label("DragValue", "DragValue"));
|
||||||
|
ui.add(egui::DragValue::new(scalar).speed(1.0));
|
||||||
|
ui.end_row();
|
||||||
|
|
||||||
ui.add(doc_link_label("ProgressBar", "ProgressBar"));
|
ui.add(doc_link_label("ProgressBar", "ProgressBar"));
|
||||||
let progress = *scalar / 360.0;
|
let progress = *scalar / 360.0;
|
||||||
let progress_bar = egui::ProgressBar::new(progress)
|
let progress_bar = egui::ProgressBar::new(progress)
|
||||||
|
@ -173,10 +177,6 @@ impl WidgetGallery {
|
||||||
.hovered();
|
.hovered();
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
||||||
ui.add(doc_link_label("DragValue", "DragValue"));
|
|
||||||
ui.add(egui::DragValue::new(scalar).speed(1.0));
|
|
||||||
ui.end_row();
|
|
||||||
|
|
||||||
ui.add(doc_link_label("Color picker", "color_edit"));
|
ui.add(doc_link_label("Color picker", "color_edit"));
|
||||||
ui.color_edit_button_srgba(color);
|
ui.color_edit_button_srgba(color);
|
||||||
ui.end_row();
|
ui.end_row();
|
||||||
|
|
|
@ -21,7 +21,7 @@ impl Default for WindowOptions {
|
||||||
title_bar: true,
|
title_bar: true,
|
||||||
closable: true,
|
closable: true,
|
||||||
collapsible: true,
|
collapsible: true,
|
||||||
resizable: true,
|
resizable: false,
|
||||||
scroll: false,
|
scroll: false,
|
||||||
disabled_time: f64::NEG_INFINITY,
|
disabled_time: f64::NEG_INFINITY,
|
||||||
anchored: false,
|
anchored: false,
|
||||||
|
@ -82,7 +82,7 @@ impl super::View for WindowOptions {
|
||||||
collapsible,
|
collapsible,
|
||||||
resizable,
|
resizable,
|
||||||
scroll,
|
scroll,
|
||||||
disabled_time,
|
disabled_time: _,
|
||||||
anchored,
|
anchored,
|
||||||
anchor,
|
anchor,
|
||||||
anchor_offset,
|
anchor_offset,
|
||||||
|
@ -92,13 +92,19 @@ impl super::View for WindowOptions {
|
||||||
ui.label("title:");
|
ui.label("title:");
|
||||||
ui.text_edit_singleline(title);
|
ui.text_edit_singleline(title);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ui.horizontal(|ui| {
|
||||||
|
ui.group(|ui| {
|
||||||
|
ui.vertical(|ui| {
|
||||||
ui.checkbox(title_bar, "title_bar");
|
ui.checkbox(title_bar, "title_bar");
|
||||||
ui.checkbox(closable, "closable");
|
ui.checkbox(closable, "closable");
|
||||||
ui.checkbox(collapsible, "collapsible");
|
ui.checkbox(collapsible, "collapsible");
|
||||||
ui.checkbox(resizable, "resizable");
|
ui.checkbox(resizable, "resizable");
|
||||||
ui.checkbox(scroll, "scroll");
|
ui.checkbox(scroll, "scroll");
|
||||||
|
});
|
||||||
|
});
|
||||||
ui.group(|ui| {
|
ui.group(|ui| {
|
||||||
|
ui.vertical(|ui| {
|
||||||
ui.checkbox(anchored, "anchored");
|
ui.checkbox(anchored, "anchored");
|
||||||
ui.set_enabled(*anchored);
|
ui.set_enabled(*anchored);
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
|
@ -119,12 +125,15 @@ impl super::View for WindowOptions {
|
||||||
ui.add(egui::DragValue::new(&mut anchor_offset.y));
|
ui.add(egui::DragValue::new(&mut anchor_offset.y));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.separator();
|
||||||
|
|
||||||
|
ui.horizontal(|ui| {
|
||||||
if ui.button("Disable for 2 seconds").clicked() {
|
if ui.button("Disable for 2 seconds").clicked() {
|
||||||
*disabled_time = ui.input().time;
|
self.disabled_time = ui.input().time;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.vertical_centered(|ui| {
|
|
||||||
egui::reset_button(ui, self);
|
egui::reset_button(ui, self);
|
||||||
ui.add(crate::__egui_github_link_file!());
|
ui.add(crate::__egui_github_link_file!());
|
||||||
});
|
});
|
||||||
|
|
|
@ -145,7 +145,7 @@ impl BackendPanel {
|
||||||
|
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|
||||||
ui.label("egui windows");
|
ui.label("egui windows:");
|
||||||
self.egui_windows.checkboxes(ui);
|
self.egui_windows.checkboxes(ui);
|
||||||
|
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|
Loading…
Reference in a new issue