Minor documentation improvements
This commit is contained in:
parent
1394205f52
commit
29668b5128
5 changed files with 7 additions and 2 deletions
|
@ -162,6 +162,7 @@ fn show_tooltip_area(
|
||||||
/// ui.memory().toggle_popup(popup_id);
|
/// ui.memory().toggle_popup(popup_id);
|
||||||
/// }
|
/// }
|
||||||
/// egui::popup::popup_below_widget(ui, popup_id, &response, |ui| {
|
/// egui::popup::popup_below_widget(ui, popup_id, &response, |ui| {
|
||||||
|
/// ui.set_min_width(200.0); // if you want to control the size
|
||||||
/// ui.label("Some more info, or things you can select:");
|
/// ui.label("Some more info, or things you can select:");
|
||||||
/// ui.label("…");
|
/// ui.label("…");
|
||||||
/// });
|
/// });
|
||||||
|
|
|
@ -142,7 +142,7 @@ impl GraphicLayers {
|
||||||
let order_map = &mut self.0[order as usize];
|
let order_map = &mut self.0[order as usize];
|
||||||
|
|
||||||
// If a layer is empty at the start of the frame
|
// If a layer is empty at the start of the frame
|
||||||
// the nobody has added to it, and it is old and defunct.
|
// then nobody has added to it, and it is old and defunct.
|
||||||
// Free it to save memory:
|
// Free it to save memory:
|
||||||
order_map.retain(|_, list| !list.lock().is_empty());
|
order_map.retain(|_, list| !list.lock().is_empty());
|
||||||
|
|
||||||
|
|
|
@ -303,7 +303,7 @@ impl Memory {
|
||||||
!self.had_focus_last_frame(id) && self.has_focus(id)
|
!self.had_focus_last_frame(id) && self.has_focus(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Does this widget have keybaord focus?
|
/// Does this widget have keyboard focus?
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn has_focus(&self, id: Id) -> bool {
|
pub fn has_focus(&self, id: Id) -> bool {
|
||||||
self.interaction.focus.id == Some(id)
|
self.interaction.focus.id == Some(id)
|
||||||
|
|
|
@ -10,6 +10,8 @@ use crate::*;
|
||||||
/// // Shorter version:
|
/// // Shorter version:
|
||||||
/// ui.image(my_texture_id, [640.0, 480.0]);
|
/// ui.image(my_texture_id, [640.0, 480.0]);
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// Se also [`crate::ImageButton`].
|
||||||
#[must_use = "You should put this widget in an ui with `ui.add(widget);`"]
|
#[must_use = "You should put this widget in an ui with `ui.add(widget);`"]
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub struct Image {
|
pub struct Image {
|
||||||
|
|
|
@ -49,6 +49,8 @@ struct SliderSpec {
|
||||||
/// # let mut my_f32: f32 = 0.0;
|
/// # let mut my_f32: f32 = 0.0;
|
||||||
/// ui.add(egui::Slider::new(&mut my_f32, 0.0..=100.0).text("My value"));
|
/// ui.add(egui::Slider::new(&mut my_f32, 0.0..=100.0).text("My value"));
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// The default `Slider` size is set by [`crate::style::Spacing::slider_width`].
|
||||||
#[must_use = "You should put this widget in an ui with `ui.add(widget);`"]
|
#[must_use = "You should put this widget in an ui with `ui.add(widget);`"]
|
||||||
pub struct Slider<'a> {
|
pub struct Slider<'a> {
|
||||||
get_set_value: GetSetValue<'a>,
|
get_set_value: GetSetValue<'a>,
|
||||||
|
|
Loading…
Reference in a new issue