|
|
@ -21,7 +21,7 @@ impl Default for WindowOptions { |
|
|
|
title_bar: true, |
|
|
|
closable: true, |
|
|
|
collapsible: true, |
|
|
|
resizable: true, |
|
|
|
resizable: false, |
|
|
|
scroll: false, |
|
|
|
disabled_time: f64::NEG_INFINITY, |
|
|
|
anchored: false, |
|
|
@ -82,7 +82,7 @@ impl super::View for WindowOptions { |
|
|
|
collapsible, |
|
|
|
resizable, |
|
|
|
scroll, |
|
|
|
disabled_time, |
|
|
|
disabled_time: _, |
|
|
|
anchored, |
|
|
|
anchor, |
|
|
|
anchor_offset, |
|
|
@ -92,39 +92,48 @@ impl super::View for WindowOptions { |
|
|
|
ui.label("title:"); |
|
|
|
ui.text_edit_singleline(title); |
|
|
|
}); |
|
|
|
ui.checkbox(title_bar, "title_bar"); |
|
|
|
ui.checkbox(closable, "closable"); |
|
|
|
ui.checkbox(collapsible, "collapsible"); |
|
|
|
ui.checkbox(resizable, "resizable"); |
|
|
|
ui.checkbox(scroll, "scroll"); |
|
|
|
|
|
|
|
ui.group(|ui| { |
|
|
|
ui.checkbox(anchored, "anchored"); |
|
|
|
ui.set_enabled(*anchored); |
|
|
|
ui.horizontal(|ui| { |
|
|
|
ui.label("x:"); |
|
|
|
ui.selectable_value(&mut anchor.0[0], egui::Align::LEFT, "Left"); |
|
|
|
ui.selectable_value(&mut anchor.0[0], egui::Align::Center, "Center"); |
|
|
|
ui.selectable_value(&mut anchor.0[0], egui::Align::RIGHT, "Right"); |
|
|
|
}); |
|
|
|
ui.horizontal(|ui| { |
|
|
|
ui.label("y:"); |
|
|
|
ui.selectable_value(&mut anchor.0[1], egui::Align::TOP, "Top"); |
|
|
|
ui.selectable_value(&mut anchor.0[1], egui::Align::Center, "Center"); |
|
|
|
ui.selectable_value(&mut anchor.0[1], egui::Align::BOTTOM, "Bottom"); |
|
|
|
ui.horizontal(|ui| { |
|
|
|
ui.group(|ui| { |
|
|
|
ui.vertical(|ui| { |
|
|
|
ui.checkbox(title_bar, "title_bar"); |
|
|
|
ui.checkbox(closable, "closable"); |
|
|
|
ui.checkbox(collapsible, "collapsible"); |
|
|
|
ui.checkbox(resizable, "resizable"); |
|
|
|
ui.checkbox(scroll, "scroll"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
ui.horizontal(|ui| { |
|
|
|
ui.label("Offset:"); |
|
|
|
ui.add(egui::DragValue::new(&mut anchor_offset.x)); |
|
|
|
ui.add(egui::DragValue::new(&mut anchor_offset.y)); |
|
|
|
ui.group(|ui| { |
|
|
|
ui.vertical(|ui| { |
|
|
|
ui.checkbox(anchored, "anchored"); |
|
|
|
ui.set_enabled(*anchored); |
|
|
|
ui.horizontal(|ui| { |
|
|
|
ui.label("x:"); |
|
|
|
ui.selectable_value(&mut anchor.0[0], egui::Align::LEFT, "Left"); |
|
|
|
ui.selectable_value(&mut anchor.0[0], egui::Align::Center, "Center"); |
|
|
|
ui.selectable_value(&mut anchor.0[0], egui::Align::RIGHT, "Right"); |
|
|
|
}); |
|
|
|
ui.horizontal(|ui| { |
|
|
|
ui.label("y:"); |
|
|
|
ui.selectable_value(&mut anchor.0[1], egui::Align::TOP, "Top"); |
|
|
|
ui.selectable_value(&mut anchor.0[1], egui::Align::Center, "Center"); |
|
|
|
ui.selectable_value(&mut anchor.0[1], egui::Align::BOTTOM, "Bottom"); |
|
|
|
}); |
|
|
|
ui.horizontal(|ui| { |
|
|
|
ui.label("Offset:"); |
|
|
|
ui.add(egui::DragValue::new(&mut anchor_offset.x)); |
|
|
|
ui.add(egui::DragValue::new(&mut anchor_offset.y)); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
if ui.button("Disable for 2 seconds").clicked() { |
|
|
|
*disabled_time = ui.input().time; |
|
|
|
} |
|
|
|
ui.separator(); |
|
|
|
|
|
|
|
ui.vertical_centered(|ui| { |
|
|
|
ui.horizontal(|ui| { |
|
|
|
if ui.button("Disable for 2 seconds").clicked() { |
|
|
|
self.disabled_time = ui.input().time; |
|
|
|
} |
|
|
|
egui::reset_button(ui, self); |
|
|
|
ui.add(crate::__egui_github_link_file!()); |
|
|
|
}); |
|
|
|