pub struct Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,{ /* private fields */ }
Implementations§
source§impl<COMM, SETT> Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
impl<COMM, SETT> Mg<COMM, SETT>where COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static, SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
sourcepub fn default_completers() -> Completers
pub fn default_completers() -> Completers
Get the default completers. One to complete the commands, the other to complete the settings.
sourcepub fn delete_current_completion_item(&self)
pub fn delete_current_completion_item(&self)
Delete the current completion item.
sourcepub fn show_completion(&self)
pub fn show_completion(&self)
Show the completion view.
sourcepub fn update_completions(&self)
pub fn update_completions(&self)
Update the items of the completion view.
source§impl<COMM, SETT> Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
impl<COMM, SETT> Mg<COMM, SETT>where COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static, SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
sourcepub fn get_foreground_color(&self) -> RGBA
pub fn get_foreground_color(&self) -> RGBA
Get the color of the text.
sourcepub fn reset_colors(&self)
pub fn reset_colors(&self)
Reset the background and foreground colors of the status bar.
sourcepub fn set_dark_theme(&mut self, use_dark: bool)
pub fn set_dark_theme(&mut self, use_dark: bool)
Use the dark variant of the theme if available.
source§impl<COMM, SETT> Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
impl<COMM, SETT> Mg<COMM, SETT>where COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static, SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
sourcepub fn action_to_command(&self, action: &str) -> ShortcutCommand
pub fn action_to_command(&self, action: &str) -> ShortcutCommand
Convert an action String to a command String.
sourcepub fn command_activate(&mut self, input: String)
pub fn command_activate(&mut self, input: String)
Handle the command entry activate event.
sourcepub fn execute_commands(
&mut self,
parse_result: ParseResult<COMM>,
activated: bool
)
pub fn execute_commands( &mut self, parse_result: ParseResult<COMM>, activated: bool )
Execute the commands and show the errors contained in the parse result.
sourcepub fn handle_command(
&mut self,
command: String,
activated: bool,
prefix: Option<u32>
) -> Option<Msg<COMM, SETT>>
pub fn handle_command( &mut self, command: String, activated: bool, prefix: Option<u32> ) -> Option<Msg<COMM, SETT>>
Handle the command activate event.
sourcepub fn handle_special_command(
&mut self,
activation_type: ActivationType,
command: &str
) -> Option<Msg<COMM, SETT>>
pub fn handle_special_command( &mut self, activation_type: ActivationType, command: &str ) -> Option<Msg<COMM, SETT>>
Handle a special command activate or key press event.
source§impl<COMM, SETT> Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
impl<COMM, SETT> Mg<COMM, SETT>where COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static, SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
sourcepub fn blocking_custom_dialog(
&mut self,
responder: Box<dyn Responder>,
builder: DialogBuilder
)
pub fn blocking_custom_dialog( &mut self, responder: Box<dyn Responder>, builder: DialogBuilder )
Ask a question to the user and block until the user provides it (or cancel).
sourcepub fn blocking_input(
&mut self,
responder: Box<dyn Responder>,
message: String,
default_answer: String
)
pub fn blocking_input( &mut self, responder: Box<dyn Responder>, message: String, default_answer: String )
Ask a question to the user and block until the user provides it (or cancel).
sourcepub fn blocking_question(
&mut self,
responder: Box<dyn Responder>,
message: String,
choices: Vec<char>
)
pub fn blocking_question( &mut self, responder: Box<dyn Responder>, message: String, choices: Vec<char> )
Ask a multiple-choice question to the user and block until the user provides it (or cancel).
sourcepub fn blocking_yes_no_question(
&mut self,
responder: Box<dyn Responder>,
message: String
)
pub fn blocking_yes_no_question( &mut self, responder: Box<dyn Responder>, message: String )
Show a blocking yes/no question.
sourcepub fn input(
&mut self,
responder: Box<dyn Responder>,
message: String,
default_answer: String
)
pub fn input( &mut self, responder: Box<dyn Responder>, message: String, default_answer: String )
Ask a question to the user.
sourcepub fn question(
&mut self,
responder: Box<dyn Responder>,
message: String,
choices: &[char]
)
pub fn question( &mut self, responder: Box<dyn Responder>, message: String, choices: &[char] )
Ask a multiple-choice question to the user.
sourcepub fn set_dialog_answer(&mut self, answer: &str)
pub fn set_dialog_answer(&mut self, answer: &str)
Set the answer to return to the caller of the dialog.
sourcepub fn show_dialog(&mut self, dialog_builder: DialogBuilder)
pub fn show_dialog(&mut self, dialog_builder: DialogBuilder)
Show a dialog created with a DialogBuilder
.
sourcepub fn show_dialog_without_shortcuts(&mut self, dialog_builder: DialogBuilder)
pub fn show_dialog_without_shortcuts(&mut self, dialog_builder: DialogBuilder)
Show a dialog created with a DialogBuilder
which does not contain shortcut.
sourcepub fn yes_no_question(
&mut self,
responder: Box<dyn Responder>,
message: String
)
pub fn yes_no_question( &mut self, responder: Box<dyn Responder>, message: String )
Show a yes/no question.
source§impl<COMM, SETT> Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
impl<COMM, SETT> Mg<COMM, SETT>where COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static, SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
source§impl<COMM, SETT> Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
impl<COMM, SETT> Mg<COMM, SETT>where COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static, SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
sourcepub fn add_to_shortcut(&mut self, key: Key)
pub fn add_to_shortcut(&mut self, key: Key)
Add the key to the current shortcut.
sourcepub fn clear_shortcut(&mut self)
pub fn clear_shortcut(&mut self)
Clear the current shortcut buffer.
sourcepub fn handle_input_shortcut(&mut self, key: &EventKey) -> bool
pub fn handle_input_shortcut(&mut self, key: &EventKey) -> bool
Handle a shortcut in input mode.
sourcepub fn inhibit_handle_shortcut(
current_mode: &Rc<Cell<Mode>>,
key: &EventKey
) -> Inhibit
pub fn inhibit_handle_shortcut( current_mode: &Rc<Cell<Mode>>, key: &EventKey ) -> Inhibit
Check if the key should be inhibitted for the shortcut.
sourcepub fn handle_shortcut(&mut self, key: &EventKey) -> Option<Msg<COMM, SETT>>
pub fn handle_shortcut(&mut self, key: &EventKey) -> Option<Msg<COMM, SETT>>
Handle a possible input of a shortcut.
Trait Implementations§
source§impl<COMM, SETT> Container for Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
impl<COMM, SETT> Container for Mg<COMM, SETT>where COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static, SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
§type Containers = MgContainers
type Containers = MgContainers
source§fn container(&self) -> &Self::Container
fn container(&self) -> &Self::Container
source§fn other_containers(&self) -> Self::Containers
fn other_containers(&self) -> Self::Containers
source§fn add_widget<WIDGET: Widget>(
container: &ContainerComponent<Self>,
widget: &Component<WIDGET>
) -> Container
fn add_widget<WIDGET: Widget>( container: &ContainerComponent<Self>, widget: &Component<WIDGET> ) -> Container
source§impl<COMM, SETT> Update for Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
impl<COMM, SETT> Update for Mg<COMM, SETT>where COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static, SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
§type ModelParam = (&'static [Mode], Result<PathBuf, Error>, Option<PathBuf>, Vec<DefaultConfig, Global>)
type ModelParam = (&'static [Mode], Result<PathBuf, Error>, Option<PathBuf>, Vec<DefaultConfig, Global>)
source§fn update(&mut self, event: Msg<COMM, SETT>)
fn update(&mut self, event: Msg<COMM, SETT>)
source§fn model(
relm: &Relm<Self>,
(user_modes, settings_filename, include_path, default_config): (Modes, Result<PathBuf>, Option<PathBuf>, Vec<DefaultConfig>)
) -> Model<COMM, SETT>
fn model( relm: &Relm<Self>, (user_modes, settings_filename, include_path, default_config): (Modes, Result<PathBuf>, Option<PathBuf>, Vec<DefaultConfig>) ) -> Model<COMM, SETT>
source§fn subscriptions(&mut self, _relm: &Relm<Self>)
fn subscriptions(&mut self, _relm: &Relm<Self>)
Future
/Stream
that are spawn when the object is created.source§impl<COMM, SETT> Widget for Mg<COMM, SETT>where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
impl<COMM, SETT> Widget for Mg<COMM, SETT>where COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static, SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
An Mg application window contains a status bar where the user can type a command and a central widget.
source§fn init_view(&mut self)
fn init_view(&mut self)
#[widget]
attribute, because when not using it,
you can use the view()
method instead.