Add zoom serialization to the workspace
This commit is contained in:
parent
790d995381
commit
6662066821
3 changed files with 59 additions and 9 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue