diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-02 20:41:29 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-02 20:41:29 +0200 |
| commit | 219c560c7c0ad9e3960298ec125d4e64637fe84b (patch) | |
| tree | b04df9aa63b68739383528a77c229828bdb95773 /src/state/editor/mod.rs | |
| parent | 595bcac243cb9cdd87e7484ab102c86f3235db8a (diff) | |
add editor theme and state lua bindings
Diffstat (limited to 'src/state/editor/mod.rs')
| -rw-r--r-- | src/state/editor/mod.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/state/editor/mod.rs b/src/state/editor/mod.rs index 6fbd2b9..279a164 100644 --- a/src/state/editor/mod.rs +++ b/src/state/editor/mod.rs @@ -1,14 +1,16 @@ -use self::buffer::Buffer; +use self::{bar::EditorBarState, buffer::Buffer}; -use super::GlobalState; +use super::{GlobalState, DUMMY_STATE}; use mlua::{Lua, UserData}; pub mod buffer; +pub mod bar; #[derive(Default, Debug)] pub struct EditorState { pub visible: bool, pub buffer: Buffer, + pub bar: EditorBarState, } macro_rules! cfg { @@ -28,6 +30,7 @@ impl EditorState { Self { visible: false, buffer: Buffer::new(), + bar: EditorBarState::new(), } } @@ -45,7 +48,9 @@ impl UserData for EditorState { fields.add_field_function_set("visible", |_, _, visible: bool| { cfg_mut!().visible = visible; Ok(()) - }) + }); + + fields.add_field_function_get("bar", |_, _| Ok(DUMMY_STATE.editor.bar)); } fn add_methods<'lua, M: mlua::prelude::LuaUserDataMethods<'lua, Self>>(methods: &mut M) { |