Browse Source

Improve some docs

pull/3622/head
Emil Ernerfeldt 12 months ago
parent
commit
185e18ad4f
  1. 3
      crates/egui/src/data/output.rs
  2. 7
      crates/egui/src/viewport.rs

3
crates/egui/src/data/output.rs

@ -27,6 +27,9 @@ pub struct FullOutput {
pub pixels_per_point: f32,
/// All the active viewports, including the root.
///
/// It is up to the integration to spawn a native window for each viewport,
/// and to close any window that no longer has a viewport in this map.
pub viewport_output: ViewportIdMap<ViewportOutput>,
}

7
crates/egui/src/viewport.rs

@ -964,6 +964,9 @@ impl ViewportCommand {
}
/// Describes a viewport, i.e. a native window.
///
/// This is returned by [`crate::Context::run`] on each frame, and should be applied
/// by the integration.
#[derive(Clone)]
pub struct ViewportOutput {
/// Id of our parent viewport.
@ -976,6 +979,10 @@ pub struct ViewportOutput {
pub class: ViewportClass,
/// The window attrbiutes such as title, position, size, etc.
///
/// Use this when first constructing the native window.
/// Also check for changes in it using [`ViewportBuilder::patch`],
/// and apply them as needed.
pub builder: ViewportBuilder,
/// The user-code that shows the GUI, used for deferred viewports.

Loading…
Cancel
Save