💡 Mejora legibilidad de comentarios
This commit is contained in:
parent
af52de8149
commit
d2a8a169e6
21 changed files with 74 additions and 68 deletions
|
|
@ -5,12 +5,12 @@ use parking_lot::RwLock;
|
|||
use std::collections::HashMap;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
// ACCIONES ****************************************************************************************
|
||||
// **< ACCIONES >***********************************************************************************
|
||||
|
||||
static ACTIONS: LazyLock<RwLock<HashMap<ActionKey, ActionsList>>> =
|
||||
LazyLock::new(|| RwLock::new(HashMap::new()));
|
||||
|
||||
// AÑADIR ACCIONES *********************************************************************************
|
||||
// **< AÑADIR ACCIONES >****************************************************************************
|
||||
|
||||
// Registra una nueva acción en el sistema.
|
||||
//
|
||||
|
|
@ -36,7 +36,7 @@ pub fn add_action(action: ActionBox) {
|
|||
}
|
||||
}
|
||||
|
||||
// DESPLEGAR ACCIONES ******************************************************************************
|
||||
// **< DESPLEGAR ACCIONES >*************************************************************************
|
||||
|
||||
/// Despacha y ejecuta las funciones asociadas a una [`ActionKey`].
|
||||
///
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ impl Child {
|
|||
Child(Some(Arc::new(RwLock::new(component))))
|
||||
}
|
||||
|
||||
// Child BUILDER *******************************************************************************
|
||||
// **< Child BUILDER >**************************************************************************
|
||||
|
||||
/// Establece un componente nuevo, o lo vacía.
|
||||
///
|
||||
|
|
@ -35,7 +35,7 @@ impl Child {
|
|||
self
|
||||
}
|
||||
|
||||
// Child GETTERS *******************************************************************************
|
||||
// **< Child GETTERS >**************************************************************************
|
||||
|
||||
/// Devuelve el identificador del componente, si existe y está definido.
|
||||
#[inline]
|
||||
|
|
@ -43,14 +43,14 @@ impl Child {
|
|||
self.0.as_ref().and_then(|c| c.read().id())
|
||||
}
|
||||
|
||||
// Child RENDER ********************************************************************************
|
||||
// **< Child RENDER >***************************************************************************
|
||||
|
||||
/// Renderiza el componente con el contexto proporcionado.
|
||||
pub fn render(&self, cx: &mut Context) -> Markup {
|
||||
self.0.as_ref().map_or(html! {}, |c| c.write().render(cx))
|
||||
}
|
||||
|
||||
// Child HELPERS *******************************************************************************
|
||||
// **< Child HELPERS >**************************************************************************
|
||||
|
||||
// Devuelve el [`UniqueId`] del tipo del componente, si existe.
|
||||
#[inline]
|
||||
|
|
@ -74,7 +74,7 @@ impl<C: Component> Typed<C> {
|
|||
Typed(Some(Arc::new(RwLock::new(component))))
|
||||
}
|
||||
|
||||
// Typed BUILDER *******************************************************************************
|
||||
// **< Typed BUILDER >**************************************************************************
|
||||
|
||||
/// Establece un componente nuevo, o lo vacía.
|
||||
///
|
||||
|
|
@ -85,7 +85,7 @@ impl<C: Component> Typed<C> {
|
|||
self
|
||||
}
|
||||
|
||||
// Typed GETTERS *******************************************************************************
|
||||
// **< Typed GETTERS >**************************************************************************
|
||||
|
||||
/// Devuelve el identificador del componente, si existe y está definido.
|
||||
#[inline]
|
||||
|
|
@ -93,14 +93,14 @@ impl<C: Component> Typed<C> {
|
|||
self.0.as_ref().and_then(|c| c.read().id())
|
||||
}
|
||||
|
||||
// Typed RENDER ********************************************************************************
|
||||
// **< Typed RENDER >***************************************************************************
|
||||
|
||||
/// Renderiza el componente con el contexto proporcionado.
|
||||
pub fn render(&self, cx: &mut Context) -> Markup {
|
||||
self.0.as_ref().map_or(html! {}, |c| c.write().render(cx))
|
||||
}
|
||||
|
||||
// Typed HELPERS *******************************************************************************
|
||||
// **< Typed HELPERS >**************************************************************************
|
||||
|
||||
// Convierte el componente tipado en un [`Child`].
|
||||
#[inline]
|
||||
|
|
@ -165,7 +165,7 @@ impl Children {
|
|||
opt
|
||||
}
|
||||
|
||||
// Children BUILDER ****************************************************************************
|
||||
// **< Children BUILDER >***********************************************************************
|
||||
|
||||
/// Ejecuta una operación con [`ChildOp`] en la lista.
|
||||
#[builder_fn]
|
||||
|
|
@ -204,7 +204,7 @@ impl Children {
|
|||
self
|
||||
}
|
||||
|
||||
// Children GETTERS ****************************************************************************
|
||||
// **< Children GETTERS >***********************************************************************
|
||||
|
||||
/// Devuelve el número de componentes hijo de la lista.
|
||||
pub fn len(&self) -> usize {
|
||||
|
|
@ -233,7 +233,7 @@ impl Children {
|
|||
self.0.iter().filter(move |&c| c.type_id() == Some(type_id))
|
||||
}
|
||||
|
||||
// Children RENDER *****************************************************************************
|
||||
// **< Children RENDER >************************************************************************
|
||||
|
||||
/// Renderiza todos los componentes hijo, en orden.
|
||||
pub fn render(&self, cx: &mut Context) -> Markup {
|
||||
|
|
@ -244,7 +244,7 @@ impl Children {
|
|||
}
|
||||
}
|
||||
|
||||
// Children HELPERS ****************************************************************************
|
||||
// **< Children HELPERS >***********************************************************************
|
||||
|
||||
// Inserta un hijo después del componente con el `id` dado, o al final si no se encuentra.
|
||||
#[inline]
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use parking_lot::RwLock;
|
|||
|
||||
use std::sync::LazyLock;
|
||||
|
||||
// EXTENSIONES *************************************************************************************
|
||||
// **< EXTENSIONES >********************************************************************************
|
||||
|
||||
static ENABLED_EXTENSIONS: LazyLock<RwLock<Vec<ExtensionRef>>> =
|
||||
LazyLock::new(|| RwLock::new(Vec::new()));
|
||||
|
|
@ -15,7 +15,7 @@ static ENABLED_EXTENSIONS: LazyLock<RwLock<Vec<ExtensionRef>>> =
|
|||
static DROPPED_EXTENSIONS: LazyLock<RwLock<Vec<ExtensionRef>>> =
|
||||
LazyLock::new(|| RwLock::new(Vec::new()));
|
||||
|
||||
// REGISTRO DE LAS EXTENSIONES *********************************************************************
|
||||
// **< REGISTRO DE LAS EXTENSIONES >****************************************************************
|
||||
|
||||
pub fn register_extensions(root_extension: Option<ExtensionRef>) {
|
||||
// Prepara la lista de extensiones habilitadas.
|
||||
|
|
@ -104,7 +104,7 @@ fn add_to_dropped(list: &mut Vec<ExtensionRef>, extension: ExtensionRef) {
|
|||
}
|
||||
}
|
||||
|
||||
// REGISTRO DE LAS ACCIONES ************************************************************************
|
||||
// **< REGISTRO DE LAS ACCIONES >*******************************************************************
|
||||
|
||||
pub fn register_actions() {
|
||||
for extension in ENABLED_EXTENSIONS.read().iter() {
|
||||
|
|
@ -114,7 +114,7 @@ pub fn register_actions() {
|
|||
}
|
||||
}
|
||||
|
||||
// INICIALIZA LAS EXTENSIONES **********************************************************************
|
||||
// **< INICIALIZA LAS EXTENSIONES >*****************************************************************
|
||||
|
||||
pub fn initialize_extensions() {
|
||||
trace::info!("Calling application bootstrap");
|
||||
|
|
@ -123,7 +123,7 @@ pub fn initialize_extensions() {
|
|||
}
|
||||
}
|
||||
|
||||
// CONFIGURA LOS SERVICIOS *************************************************************************
|
||||
// **< CONFIGURA LOS SERVICIOS >********************************************************************
|
||||
|
||||
pub fn configure_services(scfg: &mut service::web::ServiceConfig) {
|
||||
// Sólo compila durante el desarrollo, para evitar errores 400 en la traza de eventos.
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ use parking_lot::RwLock;
|
|||
|
||||
use std::sync::LazyLock;
|
||||
|
||||
// TEMAS *******************************************************************************************
|
||||
// **< TEMAS >**************************************************************************************
|
||||
|
||||
pub static THEMES: LazyLock<RwLock<Vec<ThemeRef>>> = LazyLock::new(|| RwLock::new(Vec::new()));
|
||||
|
||||
// TEMA PREDETERMINADO *****************************************************************************
|
||||
// **< TEMA PREDETERMINADO >************************************************************************
|
||||
|
||||
pub static DEFAULT_THEME: LazyLock<ThemeRef> =
|
||||
LazyLock::new(|| match theme_by_short_name(&global::SETTINGS.app.theme) {
|
||||
|
|
@ -17,7 +17,7 @@ pub static DEFAULT_THEME: LazyLock<ThemeRef> =
|
|||
None => &crate::base::theme::Basic,
|
||||
});
|
||||
|
||||
// TEMA POR NOMBRE *********************************************************************************
|
||||
// **< TEMA POR NOMBRE >****************************************************************************
|
||||
|
||||
// Devuelve el tema identificado por su [`short_name()`](AnyInfo::short_name).
|
||||
pub fn theme_by_short_name(short_name: &'static str) -> Option<ThemeRef> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue