mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Fixes for doc comments (#7668)
* [x] I have followed the instructions in the PR template - Some typos/grammos - Attempt to finish incomplete comment - Broken link - I understand the colon is a convention for pluralizing symbol names, but it seems redundant in the presence of other punctuation --------- Co-authored-by: Lucas Meurer <hi@lucasmerlin.me>
This commit is contained in:
@@ -2880,7 +2880,7 @@ impl Context {
|
||||
self.input(|i| i.pointer.hover_pos())
|
||||
}
|
||||
|
||||
/// If you detect a click or drag and wants to know where it happened, use this.
|
||||
/// If you detect a click or drag and want to know where it happened, use this.
|
||||
///
|
||||
/// Latest position of the mouse, but ignoring any [`crate::Event::PointerGone`]
|
||||
/// if there were interactions this pass.
|
||||
@@ -2953,7 +2953,7 @@ impl Context {
|
||||
|
||||
/// Moves the given area to the top in its [`Order`].
|
||||
///
|
||||
/// [`crate::Area`]:s and [`crate::Window`]:s also do this automatically when being clicked on or interacted with.
|
||||
/// [`crate::Area`]s and [`crate::Window`]s also do this automatically when being clicked on or interacted with.
|
||||
pub fn move_to_top(&self, layer_id: LayerId) {
|
||||
self.memory_mut(|mem| mem.areas_mut().move_to_top(layer_id));
|
||||
}
|
||||
@@ -3072,7 +3072,7 @@ impl Context {
|
||||
/// for a responsive start and a slow end.
|
||||
///
|
||||
/// The easing function flips when `target_value` is `false`,
|
||||
/// so that when going back towards 0.0, we get
|
||||
/// so that when going back towards 0.0, we get the reverse behavior.
|
||||
#[track_caller] // To track repaint cause
|
||||
pub fn animate_bool_with_time_and_easing(
|
||||
&self,
|
||||
@@ -3953,7 +3953,7 @@ impl Context {
|
||||
/// Show an immediate viewport, creating a new native window, if possible.
|
||||
///
|
||||
/// This is the easier type of viewport to use, but it is less performant
|
||||
/// at it requires both parent and child to repaint if any one of them needs repainting,
|
||||
/// as it requires both parent and child to repaint if any one of them needs repainting,
|
||||
/// which effectively produce double work for two viewports, and triple work for three viewports, etc.
|
||||
/// To avoid this, use [`Self::show_viewport_deferred`] instead.
|
||||
///
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
//! * lays out the letters `click me` in order to figure out the size of the button
|
||||
//! * decides where on screen to place the button
|
||||
//! * check if the mouse is hovering or clicking that location
|
||||
//! * chose button colors based on if it is being hovered or clicked
|
||||
//! * choose button colors based on if it is being hovered or clicked
|
||||
//! * add a [`Shape::Rect`] and [`Shape::Text`] to the list of shapes to be painted later this frame
|
||||
//! * return a [`Response`] with the [`clicked`](`Response::clicked`) member so the user can check for interactions
|
||||
//!
|
||||
|
||||
@@ -21,7 +21,7 @@ pub use theme::{Theme, ThemePreference};
|
||||
/// how far the user has scrolled in a [`ScrollArea`](crate::ScrollArea) etc.
|
||||
///
|
||||
/// If you want this to persist when closing your app, you should serialize [`Memory`] and store it.
|
||||
/// For this you need to enable the `persistence`.
|
||||
/// For this you need to enable the `persistence` feature.
|
||||
///
|
||||
/// If you want to store data for your widgets, you should look at [`Memory::data`]
|
||||
#[derive(Clone, Debug)]
|
||||
|
||||
@@ -74,14 +74,14 @@ pub struct Ui {
|
||||
/// This value is based on where in the hierarchy of widgets this Ui is in,
|
||||
/// and the value is increment with each added child widget.
|
||||
/// This works as an Id source only as long as new widgets aren't added or removed.
|
||||
/// They are therefore only good for Id:s that has no state.
|
||||
/// They are therefore only good for Id:s that have no state.
|
||||
next_auto_id_salt: u64,
|
||||
|
||||
/// Specifies paint layer, clip rectangle and a reference to [`Context`].
|
||||
painter: Painter,
|
||||
|
||||
/// The [`Style`] (visuals, spacing, etc) of this ui.
|
||||
/// Commonly many [`Ui`]:s share the same [`Style`].
|
||||
/// Commonly many [`Ui`]s share the same [`Style`].
|
||||
/// The [`Ui`] implements copy-on-write for this.
|
||||
style: Arc<Style>,
|
||||
|
||||
@@ -428,7 +428,7 @@ impl Ui {
|
||||
/// Mutably borrow internal [`Style`].
|
||||
/// Changes apply to this [`Ui`] and its subsequent children.
|
||||
///
|
||||
/// To set the style of all [`Ui`]:s, use [`Context::set_style_of`].
|
||||
/// To set the style of all [`Ui`]s, use [`Context::set_style_of`].
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
@@ -442,7 +442,7 @@ impl Ui {
|
||||
|
||||
/// Changes apply to this [`Ui`] and its subsequent children.
|
||||
///
|
||||
/// To set the visuals of all [`Ui`]:s, use [`Context::set_visuals_of`].
|
||||
/// To set the style of all [`Ui`]s, use [`Context::set_style_of`].
|
||||
pub fn set_style(&mut self, style: impl Into<Arc<Style>>) {
|
||||
self.style = style.into();
|
||||
}
|
||||
@@ -482,7 +482,7 @@ impl Ui {
|
||||
/// Mutably borrow internal `visuals`.
|
||||
/// Changes apply to this [`Ui`] and its subsequent children.
|
||||
///
|
||||
/// To set the visuals of all [`Ui`]:s, use [`Context::set_visuals_of`].
|
||||
/// To set the visuals of all [`Ui`]s, use [`Context::set_visuals_of`].
|
||||
///
|
||||
/// Example:
|
||||
/// ```
|
||||
@@ -1150,8 +1150,8 @@ impl Ui {
|
||||
self.interact(rect, id, sense)
|
||||
}
|
||||
|
||||
/// Read the [`Ui`]s background [`Response`].
|
||||
/// It's [`Sense`] will be based on the [`UiBuilder::sense`] used to create this [`Ui`].
|
||||
/// Read the [`Ui`]'s background [`Response`].
|
||||
/// Its [`Sense`] will be based on the [`UiBuilder::sense`] used to create this [`Ui`].
|
||||
///
|
||||
/// The rectangle of the [`Response`] (and interactive area) will be [`Self::min_rect`]
|
||||
/// of the last pass.
|
||||
@@ -1251,7 +1251,7 @@ impl Ui {
|
||||
/// [`crate::Area`], [`crate::Window`], [`crate::CollapsingHeader`], etc.
|
||||
///
|
||||
/// What exactly happens when you close a container depends on the container implementation.
|
||||
/// [`crate::Area`] e.g. will return true from it's [`Response::should_close`] method.
|
||||
/// [`crate::Area`] e.g. will return true from its [`Response::should_close`] method.
|
||||
///
|
||||
/// If you want to close a specific kind of container, use [`Ui::close_kind`] instead.
|
||||
///
|
||||
@@ -2292,7 +2292,7 @@ impl Ui {
|
||||
/// Show an image available at the given `uri`.
|
||||
///
|
||||
/// ⚠ This will do nothing unless you install some image loaders first!
|
||||
/// The easiest way to do this is via [`egui_extras::install_image_loaders`](https://docs.rs/egui_extras/latest/egui_extras/fn.install_image_loaders.html).
|
||||
/// The easiest way to do this is via [`egui_extras::install_image_loaders`](https://docs.rs/egui_extras/latest/egui_extras/loaders/fn.install_image_loaders.html).
|
||||
///
|
||||
/// The loaders handle caching image data, sampled textures, etc. across frames, so calling this is immediate-mode safe.
|
||||
///
|
||||
@@ -2368,7 +2368,7 @@ impl Ui {
|
||||
///
|
||||
/// If the user clicks the button, a full color picker is shown.
|
||||
/// The given color is in `sRGBA` space without premultiplied alpha.
|
||||
/// If unsure, what "premultiplied alpha" is, then this is probably the function you want to use.
|
||||
/// If unsure what "premultiplied alpha" is, then this is probably the function you want to use.
|
||||
pub fn color_edit_button_srgba_unmultiplied(&mut self, srgba: &mut [u8; 4]) -> Response {
|
||||
let mut rgba = Rgba::from_srgba_unmultiplied(srgba[0], srgba[1], srgba[2], srgba[3]);
|
||||
let response =
|
||||
|
||||
Reference in New Issue
Block a user