1 unstable release
Uses new Rust 2024
new 0.1.1 | Apr 2, 2025 |
---|
#4 in #drag
43 downloads per month
Used in 126 crates
(9 directly)
1.5MB
10K
SLoC
Aloe Viewport
Aloe Viewport is a Rust crate that offers advanced viewport functionalities, allowing seamless scrolling and viewing of large components within a confined space. With integrated scrollbar management and mouse interaction listening, it effectively enables design and development of complex GUI elements.
Features
- Dynamic Scrolling: Automatically adjust visible areas as child components change size.
- Advanced Event Handling: Comprehensive mouse and drag event management with
ViewportDragPositionListener
andMouseListener
traits. - Flexible Scrollbar Configuration: Customizable scrollbar positions, thickness, and visibility for refined control.
- Proportional Viewing: Position views as proportions of their movable distances, enabling smooth navigation.
- Robust Component Management: Efficiently manage components through sophisticated memory and event handling.
Usage
use aloe_viewport::Viewport;
let mut viewport = Viewport::new(Some("my_viewport"));
// Assume `component` is a valid mutable reference to a Component
viewport.set_viewed_component(component, Some(true));
viewport.set_scroll_on_drag_enabled(true);
Handling Mouse Events
Implement various listener traits to handle and respond to mouse activities:
impl MouseListener for MyMouseListener {
fn mouse_up(&mut self, event: &MouseEvent) {
// Your implementation
}
}
Configuring Scrollbars
Customize scrollbar positioning and appearance:
viewport.set_scroll_bars_shown(true, true, Some(true), Some(false));
Installation
Add the following line to your Cargo.toml
under dependencies:
aloe-viewport = "0.1.0"
License
Licensed under the GPL-3.0 license.
Contributions
Contributions, suggestions, and improvements are welcome! Please submit issues at GitHub Repository.
This README.md file was generated by an AI model and may not be 100% accurate; however, 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
~24–38MB
~579K SLoC