Add zoom serialization to the workspace

This commit is contained in:
Mikayla Maki 2023-06-14 23:43:45 -07:00
parent 790d995381
commit 6662066821
No known key found for this signature in database
3 changed files with 59 additions and 9 deletions

View file

@ -100,16 +100,19 @@ impl Bind for DockStructure {
pub struct DockData {
pub(crate) visible: bool,
pub(crate) active_panel: Option<String>,
pub(crate) zoom: bool
}
impl Column for DockData {
fn column(statement: &mut Statement, start_index: i32) -> Result<(Self, i32)> {
let (visible, next_index) = Option::<bool>::column(statement, start_index)?;
let (active_panel, next_index) = Option::<String>::column(statement, next_index)?;
let (zoom, next_index) = Option::<bool>::column(statement, next_index)?;
Ok((
DockData {
visible: visible.unwrap_or(false),
active_panel,
zoom: zoom.unwrap_or(false)
},
next_index,
))
@ -119,7 +122,8 @@ impl Column for DockData {
impl Bind for DockData {
fn bind(&self, statement: &Statement, start_index: i32) -> Result<i32> {
let next_index = statement.bind(&self.visible, start_index)?;
statement.bind(&self.active_panel, next_index)
let next_index = statement.bind(&self.active_panel, next_index)?;
statement.bind(&self.zoom, next_index)
}
}