#desktop #shadow #component

aloe-shadow

Provides a system for adding realistic drop-shadows to GUI components, enhancing visual depth and integration with desktop environments. This crate is a translation of the c++ juce module serving the same function.

1 unstable release

Uses new Rust 2024

new 0.1.1 Apr 2, 2025

#16 in #shadow

43 downloads per month
Used in 66 crates (2 directly)

GPL-3.0 license

1MB
9K SLoC

Aloe-Shadow

The aloe-shadow crate provides a sophisticated system for managing drop shadows around graphical components in GUI applications. Its inherent architecture ensures seamless integration with the component lifecycle, effectively augmenting components with dynamic, Gaussian blurs that mimic realistic shadow effects.

Features

  • Dynamic Shadow Management: Automatically creates and manages shadow components around target components, ensuring shadows adapt to movement and layering changes.
  • Efficient Rendering: Leverages desktop settings and parent component structures to efficiently render shadows without unnecessary resource consumption.
  • Comprehensive API: Offers straightforward APIs for integrating and controlling shadow behavior within your application.

Getting Started

To leverage the shadowing capabilities, instantiate the DropShadower and attach it to your component:

use aloe_shadow::{DropShadow, DropShadower, Component};

let shadow = DropShadow::default();
let drop_shadower = DropShadower::new(&shadow);

// Assuming `component` is your target graphical component
unsafe { drop_shadower.set_owner(component); }

Technical Details

The crate operates by creating ShadowWindow instances that obscure component outlines with calculated shadow effects. Shadows maintain position and visibility parity with their associated components, and adapt to changes in the component hierarchy.

Core Structures

  • ShadowWindow: Manages the shadow rendering for individual graphical components.
  • DropShadower: A high-level manager that coordinates shadow windows for entire applications.

Requirements

Ensure that your graphical components are compatible with the Component trait from the environment you operate in. The crate is optimized for desktop GUI systems that permit transparent window layering.


This README.md file was generated by an AI model and may not be 100% accurate, but it should be pretty good.

This crate is a translation of the JUCE module.

JUCE is a c++ software framework for developing high performance audio applications.

Usage falls under the GPLv3 as well as the JUCE commercial license.

See github.com/juce-framework/JUCE and the JUCE license page for details.

This crate is in the process of being translated from c++ to rust. For progress updates, please see the workspacer rust project. designed specifically for rust projects.

Dependencies

~25–39MB
~600K SLoC