Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Oct 10, 2024
1 parent 97798dc commit 38b0c23
Show file tree
Hide file tree
Showing 12 changed files with 304 additions and 305 deletions.
4 changes: 2 additions & 2 deletions crates/components/src/tabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub enum TabStatus {
Hovering,
}

/// Clickable Tab. Usually used in combination with [`Tabsbar`], [`Link`] and [`ActivableRoute`].
/// Clickable Tab. Usually used in combination with [`Tabsbar`], [`crate::Link`] and [`crate::ActivableRoute`].
///
/// # Styling
/// Inherits the [`TabTheme`](freya_hooks::TabTheme) theme.
Expand Down Expand Up @@ -164,7 +164,7 @@ pub fn Tab(
}

/// Clickable BottomTab. Same thing as Tab but designed to be placed in the bottom of your app,
/// usually used in combination with [`Tabsbar`], [`Link`] and [`ActivableRoute`].
/// usually used in combination with [`Tabsbar`], [`crate::Link`] and [`crate::ActivableRoute`].
///
/// # Styling
/// Inherits the [`BottomTabTheme`](freya_hooks::BottomTabTheme) theme.
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/elements/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub trait ElementUtils {

/// Check if this element requires any kind of special caching.
/// Mainly used for text-like elements with shadows.
/// See [crate::compositor::CompositorCache].
/// See [crate::render::CompositorCache].
/// Default to `false`.
#[inline]
fn element_needs_cached_area(&self, _node_ref: &DioxusNode) -> bool {
Expand Down
4 changes: 3 additions & 1 deletion crates/freya/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords = ["gui", "ui", "desktop", "skia", "dioxus"]
categories = ["gui", "asynchronous"]

[package.metadata.docs.rs]
features = ["freya-engine/mocked-engine"]
features = ["freya-engine/mocked-engine", "docs"]
no-default-features = true

[features]
Expand All @@ -27,6 +27,7 @@ default = ["skia"]
performance-overlay = []
fade-cached-incremental-areas = ["freya-core/fade-cached-incremental-areas"]
disable-zoom-shortcuts = ["freya-renderer/disable-zoom-shortcuts"]
docs = ["dep:freya-testing"]

[dependencies]
freya-devtools = { workspace = true, optional = true }
Expand All @@ -39,6 +40,7 @@ freya-core = { workspace = true }
freya-components = { workspace = true }
freya-engine = { workspace = true }
torin = { workspace = true }
freya-testing = { workspace = true, optional = true }

dioxus = { workspace = true }
dioxus-core-macro = { workspace = true }
Expand Down
12 changes: 6 additions & 6 deletions crates/freya/src/_docs/accessibility.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! # Accessibility
//!
//!
//! TODO
//!
//!
//! ### `use_focus` hook
//!
//! ```rs
//!
//! ```rust
//! fn app() -> Element {
//! let mut my_focus = use_focus();
//!
//!
//! rsx!(
//! rect {
//! width: "100%",
Expand All @@ -20,4 +20,4 @@
//! }
//! )
//! }
//! ```
//! ```
30 changes: 15 additions & 15 deletions crates/freya/src/_docs/dioxus_fundamentals.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//!
//! # Dioxus Fundamentals
//!
//! As you should know by now, Freya runs on 🧬 [Dioxus](https://dioxuslabs.com), a renderer-agnostic UI library for Rust.
//!
//! - [UI](self::_docs::ui)
//! - [Components](self::_docs::components_and_props)
//! - [Hooks](self::_docs::hooks)
//! - [State Management](self::_docs::state_management)
//! - [Signals](self::_docs::state_management::signals)
//! - [Global Signals](self::_docs::state_management::global_signals)
//! - [Lifecycle](self::_docs::state_management::lifecycle)
//! - [Context](self::_docs::state_management::context)
//! - [Memoization](self::_docs::state_management::memoization)
//!
//!
//! # Dioxus Fundamentals
//!
//! As you should know by now, Freya runs on 🧬 [Dioxus](https://dioxuslabs.com), a renderer-agnostic UI library for Rust.
//!
//! - [UI](crate::_docs::ui)
//! - [Components](crate::_docs::components_and_props)
//! - [Hooks](crate::_docs::hooks)
//! - [State Management](crate::_docs::state_management)
//! - [Signals](crate::_docs::state_management::signals)
//! - [Global Signals](crate::_docs::state_management::global_signals)
//! - [Lifecycle](crate::_docs::state_management::lifecycle)
//! - [Context](crate::_docs::state_management::context)
//! - [Memoization](crate::_docs::state_management::memoization)
//! - [Async Tasks](crate::_docs::async_tasks)
92 changes: 44 additions & 48 deletions crates/freya/src/_docs/elements.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
//! # Elements
//!
//! This is an overview of the elements supported in Freya.
//!
//! > For more info check the [API Reference](https://docs.rs/freya/latest/freya/elements/index.html#structs).
//!
//!
//! This is an overview of the elements supported in Freya.
//!
//! > For more info check the [API Reference](freya_elements::elements#structs).
//!
//! ### `rect`
//!
//! [`rect`](https://docs.rs/freya/latest/freya/elements/struct.rect.html) is a generic element that acts as a container for other elements.
//!
//!
//! [`rect`](freya_elements::elements::rect) is a generic element that acts as a container for other elements.
//!
//! You can specify things like **width**, **padding** or even in what **direction** the inner elements are stacked.
//!
//!
//! Example:
//!
//!
//! ```rust
//! fn app() -> Element {
//! rsx!(
Expand All @@ -22,13 +22,13 @@
//! )
//! }
//! ```
//!
//!
//! ### `label`
//!
//! [`label`](https://docs.rs/freya/latest/freya/elements/struct.label.html) simply let's you display some text.
//!
//!
//! [`label`](freya_elements::elements::label) simply let's you display some text.
//!
//! Example:
//!
//!
//! ```rust
//! fn app() -> Element {
//! rsx!(
Expand All @@ -38,15 +38,15 @@
//! )
//! }
//! ```
//!
//!
//! ### `paragraph`
//!
//! [`paragraph`](https://docs.rs/freya/latest/freya/elements/struct.paragraph.html) element let's you build texts with different styles.
//!
//!
//! [`paragraph`](freya_elements::elements::paragraph) element let's you build texts with different styles.
//!
//! This used used with the `text` element.
//!
//!
//! Example:
//!
//!
//! ```rust
//! fn app() -> Element {
//! rsx!(
Expand All @@ -63,45 +63,41 @@
//! )
//! }
//! ```
//!
//!
//! ### `image`
//!
//! [`image`](https://docs.rs/freya/latest/freya/elements/struct.image.html) element let's you show an image.
//!
//!
//! [`image`](freya_elements::elements::image) element let's you show an image.
//!
//! Example:
//!
//!
//! ```rust
//! static RUST_LOGO: &[u8] = include_bytes!("./rust_logo.png");
//!
//!
//! fn app() -> Element {
//! let image_data = static_bytes(RUST_LOGO);
//! rsx!(
//! image {
//! image_data: image_data,
//! width: "100%",
//! height: "100%",
//! }
//! )
//! rsx!(image {
//! image_data: image_data,
//! width: "100%",
//! height: "100%",
//! })
//! }
//! ```
//!
//!
//! ### `svg`
//!
//! [`svg`](https://docs.rs/freya/latest/freya/elements/struct.svg.html) element let's you display an SVG.
//!
//!
//! [`svg`](freya_elements::elements::svg) element let's you display an SVG.
//!
//! Example:
//!
//!
//! ```rust
//! static FERRIS: &[u8] = static_bytes!("./ferris.svg");
//!
//!
//! fn app() -> Element {
//! let ferris = static_bytes(FERRIS);
//! rsx!(
//! svg {
//! svg_data: ferris,
//! width: "100%",
//! height: "100%",
//! }
//! )
//! rsx!(svg {
//! svg_data: ferris,
//! width: "100%",
//! height: "100%",
//! })
//! }
//! ```
//! ```
Loading

0 comments on commit 38b0c23

Please sign in to comment.