Module cosmic::iced_widget::pane_grid
source · Expand description
Pane grids let your users split regions of your application and organize layout dynamically.
This distribution of space is common in tiling window managers (like
awesome
, i3
, or even
tmux
).
A PaneGrid
supports:
- Vertical and horizontal splits
- Tracking of the last active pane
- Mouse-based resizing
- Drag and drop to reorganize panes
- Hotkey support
- Configurable modifier keys
State
API to perform actions programmatically (split
,swap
,resize
, etc.)
§Example
use iced::widget::{pane_grid, text};
struct State {
panes: pane_grid::State<Pane>,
}
enum Pane {
SomePane,
AnotherKindOfPane,
}
enum Message {
PaneDragged(pane_grid::DragEvent),
PaneResized(pane_grid::ResizeEvent),
}
fn view(state: &State) -> Element<'_, Message> {
pane_grid(&state.panes, |pane, state, is_maximized| {
pane_grid::Content::new(match state {
Pane::SomePane => text("This is some pane"),
Pane::AnotherKindOfPane => text("This is another kind of pane"),
})
})
.on_drag(Message::PaneDragged)
.on_resize(10, Message::PaneResized)
.into()
}
The pane_grid
example showcases how to use a PaneGrid
with resizing,
drag and drop, and hotkey support.
Modules§
- The state of a
PaneGrid
.
Structs§
- The content of a
Pane
. - The controls of a
Pane
. - The appearance of a highlight of the
PaneGrid
. - A line.
- A rectangular region in a
PaneGrid
used to display widgets. - A collection of panes distributed using either vertical or horizontal splits to completely fill the space available.
- An event produced during a resize interaction of a
PaneGrid
. - A divider that splits a region in a
PaneGrid
into two different panes. - The state of a
PaneGrid
. - The appearance of a
PaneGrid
. - The title bar of a
Pane
.
Enums§
- A fixed reference line for the measurement of coordinates.
- The arrangement of a
PaneGrid
. - The visible contents of the
PaneGrid
- A four cardinal direction.
- An event produced during a drag and drop interaction of a
PaneGrid
. - The edges of an area.
- A layout node of a
PaneGrid
. - The region of a
Pane
. - The
Target
area a pane can be dropped on.
Traits§
- The theme catalog of a
PaneGrid
. - A pane that can be dragged.
Functions§
- The default style of a
PaneGrid
.
Type Aliases§
- A styling function for a
PaneGrid
.