Feat: documentation, UI/UX
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::cell::Cell;
|
||||
use std::ops::RangeInclusive;
|
||||
|
||||
use cagire_ratatui::Editor;
|
||||
@@ -101,20 +101,11 @@ pub struct EditorContext {
|
||||
pub editor: Editor,
|
||||
pub selection_anchor: Option<usize>,
|
||||
pub copied_steps: Option<CopiedSteps>,
|
||||
pub show_stack: bool,
|
||||
pub stack_cache: RefCell<Option<StackCache>>,
|
||||
pub target: EditorTarget,
|
||||
pub steps_per_page: Cell<usize>,
|
||||
pub mouse_selecting: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct StackCache {
|
||||
pub cursor_line: usize,
|
||||
pub lines_hash: u64,
|
||||
pub result: String,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct CopiedSteps {
|
||||
pub bank: usize,
|
||||
@@ -153,8 +144,6 @@ impl Default for EditorContext {
|
||||
editor: Editor::new(),
|
||||
selection_anchor: None,
|
||||
copied_steps: None,
|
||||
show_stack: false,
|
||||
stack_cache: RefCell::new(None),
|
||||
target: EditorTarget::default(),
|
||||
steps_per_page: Cell::new(32),
|
||||
mouse_selecting: false,
|
||||
@@ -164,8 +153,6 @@ impl Default for EditorContext {
|
||||
|
||||
pub struct ScriptEditorState {
|
||||
pub editor: Editor,
|
||||
pub show_stack: bool,
|
||||
pub stack_cache: RefCell<Option<StackCache>>,
|
||||
pub dirty: bool,
|
||||
pub focused: bool,
|
||||
pub mouse_selecting: bool,
|
||||
@@ -175,8 +162,6 @@ impl Default for ScriptEditorState {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
editor: Editor::new(),
|
||||
show_stack: false,
|
||||
stack_cache: RefCell::new(None),
|
||||
dirty: false,
|
||||
focused: true,
|
||||
mouse_selecting: false,
|
||||
|
||||
@@ -33,7 +33,7 @@ pub use audio::{AudioSettings, DeviceKind, EngineSection, LinkSetting, MainLayou
|
||||
pub use color_scheme::ColorScheme;
|
||||
pub use editor::{
|
||||
CopiedStepData, CopiedSteps, EditorContext, EditorTarget, EuclideanField, PatternField,
|
||||
PatternPropsField, ScriptEditorState, ScriptField, StackCache,
|
||||
PatternPropsField, ScriptEditorState, ScriptField,
|
||||
};
|
||||
pub use live_keys::LiveKeyState;
|
||||
pub use modal::{ConfirmAction, Modal, RenameTarget};
|
||||
|
||||
@@ -51,6 +51,7 @@ pub struct UiState {
|
||||
pub help_search_active: bool,
|
||||
pub help_search_query: String,
|
||||
pub help_focused_block: Option<usize>,
|
||||
pub help_block_output: Option<(usize, usize, String)>,
|
||||
pub help_parsed: RefCell<Vec<Option<ParsedMarkdown>>>,
|
||||
pub dict_focus: DictFocus,
|
||||
pub dict_category: usize,
|
||||
@@ -102,6 +103,7 @@ impl Default for UiState {
|
||||
help_search_active: false,
|
||||
help_search_query: String::new(),
|
||||
help_focused_block: None,
|
||||
help_block_output: None,
|
||||
help_parsed: RefCell::new(
|
||||
(0..crate::model::docs::topic_count())
|
||||
.map(|_| None)
|
||||
|
||||
Reference in New Issue
Block a user