pub struct EntryDialogState {Show 19 fields
pub entry_key: String,
pub map_path: String,
pub title: String,
pub is_new: bool,
pub items: Vec<SettingItem>,
pub selected_item: usize,
pub sub_focus: Option<usize>,
pub editing_text: bool,
pub focused_button: usize,
pub focus_on_buttons: bool,
pub delete_requested: bool,
pub scroll_offset: usize,
pub viewport_height: usize,
pub hover_item: Option<usize>,
pub hover_button: Option<usize>,
pub original_value: Value,
pub first_editable_index: usize,
pub no_delete: bool,
pub is_single_value: bool,
}Expand description
State for the entry detail dialog
Fields§
§entry_key: StringThe entry key (e.g., “rust” for language)
map_path: StringThe map path this entry belongs to (e.g., “/languages”, “/lsp”)
title: StringHuman-readable title for the dialog
is_new: boolWhether this is a new entry (vs editing existing)
items: Vec<SettingItem>Items in the dialog (using same SettingItem structure as main settings)
selected_item: usizeCurrently selected item index
sub_focus: Option<usize>Sub-focus index within the selected item (for TextList/Map navigation)
editing_text: boolWhether we’re in text editing mode
Currently focused button (0=Save, 1=Delete, 2=Cancel for existing; 0=Save, 1=Cancel for new)
Whether focus is on buttons (true) or items (false)
delete_requested: boolWhether deletion was requested
scroll_offset: usizeScroll offset for the items area
viewport_height: usizeLast known viewport height (updated during render)
hover_item: Option<usize>Hovered item index (for mouse hover feedback)
Hovered button index (for mouse hover feedback)
original_value: ValueOriginal value when dialog was opened (for Cancel to restore)
first_editable_index: usizeIndex of first editable item (items before this are read-only) Used for rendering separator and focus navigation
no_delete: boolWhether deletion is disabled (for auto-managed entries like plugins)
is_single_value: boolWhen true, the dialog wraps a single non-Object value (e.g., an ObjectArray).
to_value() returns the raw control value instead of wrapping in an Object.
Implementations§
Source§impl EntryDialogState
impl EntryDialogState
Sourcepub fn from_schema(
key: String,
value: &Value,
schema: &SettingSchema,
map_path: &str,
is_new: bool,
no_delete: bool,
) -> Self
pub fn from_schema( key: String, value: &Value, schema: &SettingSchema, map_path: &str, is_new: bool, no_delete: bool, ) -> Self
Create a dialog from a schema definition
This is the primary, schema-driven constructor. It builds items dynamically from the SettingSchema’s properties using the same build logic as the main settings UI.
Sourcepub fn for_array_item(
index: Option<usize>,
value: &Value,
schema: &SettingSchema,
array_path: &str,
is_new: bool,
) -> Self
pub fn for_array_item( index: Option<usize>, value: &Value, schema: &SettingSchema, array_path: &str, is_new: bool, ) -> Self
Create a dialog for an array item (no key field)
Used for ObjectArray controls where items are identified by index, not key.
Get button count (3 for existing entries with Delete, 2 for new/no_delete entries)
Sourcepub fn to_value(&self) -> Value
pub fn to_value(&self) -> Value
Convert dialog state back to JSON value (excludes the key item)
Sourcepub fn current_item(&self) -> Option<&SettingItem>
pub fn current_item(&self) -> Option<&SettingItem>
Get currently selected item
Sourcepub fn current_item_mut(&mut self) -> Option<&mut SettingItem>
pub fn current_item_mut(&mut self) -> Option<&mut SettingItem>
Get currently selected item mutably
Sourcepub fn focus_next(&mut self)
pub fn focus_next(&mut self)
Move focus to next editable item, navigating within composite controls first.
For composite controls (Map, ObjectArray, TextList), Down first navigates through their internal entries and [+] Add new row before moving to the next dialog item. When at the last editable item, wraps to buttons. When on the last button, wraps back to the first editable item.
Sourcepub fn focus_prev(&mut self)
pub fn focus_prev(&mut self)
Move focus to previous editable item, navigating within composite controls first.
For composite controls, Up first navigates backwards through their internal entries before moving to the previous dialog item. When at the first editable item, wraps to buttons. When on the first button, wraps back to the last item.
Sourcepub fn toggle_focus_region(&mut self)
pub fn toggle_focus_region(&mut self)
Toggle focus between items region and buttons region. Used by Tab key to provide region-level navigation.
Sourcepub fn toggle_focus_region_direction(&mut self, forward: bool)
pub fn toggle_focus_region_direction(&mut self, forward: bool)
Toggle between items and buttons regions.
When in buttons region, Tab cycles through buttons before returning to items.
forward controls direction: true = Tab, false = Shift+Tab.
Sourcepub fn update_focus_states(&mut self)
pub fn update_focus_states(&mut self)
Update focus states for all items
Sourcepub fn total_content_height(&self) -> usize
pub fn total_content_height(&self) -> usize
Calculate total content height for all items (including separator and section headers)
Sourcepub fn selected_item_offset(&self) -> usize
pub fn selected_item_offset(&self) -> usize
Calculate the Y offset of the selected item (including separator and section headers)
Sourcepub fn selected_item_height(&self) -> usize
pub fn selected_item_height(&self) -> usize
Calculate the height of the selected item
Sourcepub fn ensure_selected_visible(&mut self, viewport_height: usize)
pub fn ensure_selected_visible(&mut self, viewport_height: usize)
Ensure the selected item is visible within the viewport
Sourcepub fn ensure_cursor_visible(&mut self)
pub fn ensure_cursor_visible(&mut self)
Ensure the cursor within a JSON editor is visible
When editing a multiline JSON control, this adjusts scroll_offset to keep the cursor row visible within the viewport.
Sourcepub fn scroll_down(&mut self, viewport_height: usize)
pub fn scroll_down(&mut self, viewport_height: usize)
Scroll down by one line
Sourcepub fn scroll_to_ratio(&mut self, ratio: f32)
pub fn scroll_to_ratio(&mut self, ratio: f32)
Scroll to a position based on ratio (0.0 = top, 1.0 = bottom)
Used for scrollbar drag operations.
Sourcepub fn start_editing(&mut self)
pub fn start_editing(&mut self)
Start text editing mode for the current control
Sourcepub fn stop_editing(&mut self)
pub fn stop_editing(&mut self)
Stop text editing mode
Sourcepub fn insert_char(&mut self, c: char)
pub fn insert_char(&mut self, c: char)
Handle character input
pub fn insert_str(&mut self, s: &str)
Sourcepub fn cursor_left(&mut self)
pub fn cursor_left(&mut self)
Handle cursor left
Sourcepub fn cursor_left_selecting(&mut self)
pub fn cursor_left_selecting(&mut self)
Handle cursor left with selection (Shift+Left)
Sourcepub fn cursor_right(&mut self)
pub fn cursor_right(&mut self)
Handle cursor right
Sourcepub fn cursor_right_selecting(&mut self)
pub fn cursor_right_selecting(&mut self)
Handle cursor right with selection (Shift+Right)
Sourcepub fn cursor_up_selecting(&mut self)
pub fn cursor_up_selecting(&mut self)
Handle cursor up with selection (Shift+Up)
Sourcepub fn cursor_down(&mut self)
pub fn cursor_down(&mut self)
Handle cursor down (for multiline controls)
Sourcepub fn cursor_down_selecting(&mut self)
pub fn cursor_down_selecting(&mut self)
Handle cursor down with selection (Shift+Down)
Sourcepub fn insert_newline(&mut self)
pub fn insert_newline(&mut self)
Insert newline in JSON editor
Sourcepub fn revert_json_and_stop(&mut self)
pub fn revert_json_and_stop(&mut self)
Revert JSON changes to original and stop editing
Sourcepub fn is_editing_json(&self) -> bool
pub fn is_editing_json(&self) -> bool
Check if current control is a JSON editor
Sourcepub fn toggle_bool(&mut self)
pub fn toggle_bool(&mut self)
Toggle boolean value
Sourcepub fn toggle_dropdown(&mut self)
pub fn toggle_dropdown(&mut self)
Toggle dropdown open state
Sourcepub fn dropdown_prev(&mut self)
pub fn dropdown_prev(&mut self)
Move dropdown selection up
Sourcepub fn dropdown_next(&mut self)
pub fn dropdown_next(&mut self)
Move dropdown selection down
Sourcepub fn dropdown_confirm(&mut self)
pub fn dropdown_confirm(&mut self)
Confirm dropdown selection
Sourcepub fn increment_number(&mut self)
pub fn increment_number(&mut self)
Increment number value
Sourcepub fn decrement_number(&mut self)
pub fn decrement_number(&mut self)
Decrement number value
Sourcepub fn delete_list_item(&mut self)
pub fn delete_list_item(&mut self)
Delete the currently focused item from a TextList control
Sourcepub fn cursor_home(&mut self)
pub fn cursor_home(&mut self)
Move cursor to beginning of line
Sourcepub fn cursor_end(&mut self)
pub fn cursor_end(&mut self)
Move cursor to end of line
Sourcepub fn select_all(&mut self)
pub fn select_all(&mut self)
Select all text in current control
Sourcepub fn selected_text(&self) -> Option<String>
pub fn selected_text(&self) -> Option<String>
Get selected text from current JSON control
Sourcepub fn is_editing(&self) -> bool
pub fn is_editing(&self) -> bool
Check if any field is currently in edit mode
Trait Implementations§
Source§impl Clone for EntryDialogState
impl Clone for EntryDialogState
Source§fn clone(&self) -> EntryDialogState
fn clone(&self) -> EntryDialogState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for EntryDialogState
impl RefUnwindSafe for EntryDialogState
impl Send for EntryDialogState
impl Sync for EntryDialogState
impl Unpin for EntryDialogState
impl UnsafeUnpin for EntryDialogState
impl UnwindSafe for EntryDialogState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more