mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Animate foldable regions
This commit is contained in:
@@ -1,14 +1,30 @@
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::{window::WindowState, *};
|
||||
|
||||
// TODO: move together with foldable code into own file
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct FoldableState {
|
||||
pub open: bool,
|
||||
pub toggle_time: f64,
|
||||
}
|
||||
|
||||
impl Default for FoldableState {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
open: false,
|
||||
toggle_time: -std::f64::INFINITY,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct Memory {
|
||||
/// The widget being interacted with (e.g. dragged, in case of a slider).
|
||||
pub(crate) active_id: Option<Id>,
|
||||
|
||||
/// Which foldable regions are open.
|
||||
pub(crate) open_foldables: HashSet<Id>,
|
||||
pub(crate) foldables: HashMap<Id, FoldableState>,
|
||||
|
||||
windows: HashMap<Id, WindowState>,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user