Use BTreeMap for Ord iteration of panes
This ensures continuity in how panes are iterated on when building widget state
This commit is contained in:
parent
f4d03870dd
commit
415fd4f643
1 changed files with 4 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ use crate::pane_grid::{
|
||||||
Axis, Configuration, Direction, Edge, Node, Pane, Region, Split, Target,
|
Axis, Configuration, Direction, Edge, Node, Pane, Region, Split, Target,
|
||||||
};
|
};
|
||||||
|
|
||||||
use rustc_hash::FxHashMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
/// The state of a [`PaneGrid`].
|
/// The state of a [`PaneGrid`].
|
||||||
///
|
///
|
||||||
|
|
@ -25,7 +25,7 @@ pub struct State<T> {
|
||||||
/// The panes of the [`PaneGrid`].
|
/// The panes of the [`PaneGrid`].
|
||||||
///
|
///
|
||||||
/// [`PaneGrid`]: super::PaneGrid
|
/// [`PaneGrid`]: super::PaneGrid
|
||||||
pub panes: FxHashMap<Pane, T>,
|
pub panes: BTreeMap<Pane, T>,
|
||||||
|
|
||||||
/// The internal state of the [`PaneGrid`].
|
/// The internal state of the [`PaneGrid`].
|
||||||
///
|
///
|
||||||
|
|
@ -52,7 +52,7 @@ impl<T> State<T> {
|
||||||
|
|
||||||
/// Creates a new [`State`] with the given [`Configuration`].
|
/// Creates a new [`State`] with the given [`Configuration`].
|
||||||
pub fn with_configuration(config: impl Into<Configuration<T>>) -> Self {
|
pub fn with_configuration(config: impl Into<Configuration<T>>) -> Self {
|
||||||
let mut panes = FxHashMap::default();
|
let mut panes = BTreeMap::default();
|
||||||
|
|
||||||
let internal =
|
let internal =
|
||||||
Internal::from_configuration(&mut panes, config.into(), 0);
|
Internal::from_configuration(&mut panes, config.into(), 0);
|
||||||
|
|
@ -353,7 +353,7 @@ impl Internal {
|
||||||
///
|
///
|
||||||
/// [`PaneGrid`]: super::PaneGrid
|
/// [`PaneGrid`]: super::PaneGrid
|
||||||
pub fn from_configuration<T>(
|
pub fn from_configuration<T>(
|
||||||
panes: &mut FxHashMap<Pane, T>,
|
panes: &mut BTreeMap<Pane, T>,
|
||||||
content: Configuration<T>,
|
content: Configuration<T>,
|
||||||
next_id: usize,
|
next_id: usize,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue