Fix minor documentation issues in pane_grid
This commit is contained in:
parent
bb898fa2e2
commit
420275793e
@ -93,6 +93,7 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> {
|
||||
///
|
||||
/// [`PaneGrid`]: struct.PaneGrid.html
|
||||
/// [`State`]: struct.State.html
|
||||
/// [`Pane`]: struct.Pane.html
|
||||
pub fn new<T>(
|
||||
state: &'a mut State<T>,
|
||||
view: impl Fn(
|
||||
@ -219,7 +220,7 @@ impl<'a, Message, Renderer> PaneGrid<'a, Message, Renderer> {
|
||||
/// If the function returns `None`, the key press event will be discarded
|
||||
/// without producing any message.
|
||||
///
|
||||
/// This function is particularly useful to implement hotkey interactions.
|
||||
/// This method is particularly useful to implement hotkey interactions.
|
||||
/// For instance, you can use it to enable splitting, swapping, or resizing
|
||||
/// panes by pressing combinations of keys.
|
||||
///
|
||||
@ -319,12 +320,16 @@ pub enum DragEvent {
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct ResizeEvent {
|
||||
/// The [`Split`] that is being dragged for resizing.
|
||||
///
|
||||
/// [`Split`]: struct.Split.html
|
||||
pub split: Split,
|
||||
|
||||
/// The new ratio of the [`Split`].
|
||||
///
|
||||
/// The ratio is a value in [0, 1], representing the exact position of a
|
||||
/// [`Split`] between two panes.
|
||||
///
|
||||
/// [`Split`]: struct.Split.html
|
||||
pub ratio: f32,
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,9 @@ use std::collections::HashMap;
|
||||
///
|
||||
/// [`PaneGrid`]: struct.PaneGrid.html
|
||||
/// [`PaneGrid::new`]: struct.PaneGrid.html#method.new
|
||||
/// [`State`]: struct.State.html
|
||||
/// [`Pane`]: struct.Pane.html
|
||||
/// [`Split`]: struct.Split.html
|
||||
/// [`State`]: struct.State.html
|
||||
#[derive(Debug)]
|
||||
pub struct State<T> {
|
||||
pub(super) panes: HashMap<Pane, T>,
|
||||
@ -28,6 +29,8 @@ pub struct State<T> {
|
||||
}
|
||||
|
||||
/// The current focus of a [`Pane`].
|
||||
///
|
||||
/// [`Pane`]: struct.Pane.html
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Focus {
|
||||
/// The [`Pane`] is just focused.
|
||||
|
Loading…
Reference in New Issue
Block a user