| Crates.io | cairodrag |
| lib.rs | cairodrag |
| version | 0.2.0 |
| created_at | 2024-12-03 08:22:27.736276+00 |
| updated_at | 2024-12-31 22:26:46.418908+00 |
| description | Unofficial drag-and-drop implementation for cairo-rs |
| homepage | |
| repository | https://github.com/UxuginPython/cairodrag |
| max_upload_size | |
| id | 1469767 |
| size | 49,561 |
An unofficial drag-and-drop implementation for cairo-rs and gtk4.
Drag-and-drop interfaces are useful in many places, and Rust's GTK 4 bindings have some support for them. However, there are some cases in which GTK's drag-and-drop is not sufficient, requiring the use of Cairo, its drawing library. Unfortunately, Cairo does not have drag-and-drop support by default. This crate adds this functionality. Read the documentation and the examples (found in the repository) to get started.
This basically means that you can do whatever you want as long as you give me attribution and you don't remove the license notices or use my name to endorse stuff I don't. Read the actual license for details though.
DragArea::push_(box|rc|rc_ref_cell) to &self instead of &mut self since they only rely on interior mutability internally.DragArea optionally scrollable. Use DragArea::new_scrollable instead of new to construct a scrollable DragArea.on_(double|middle|right)_click methods to Draggable for handling mouse clicks on specific draggable objects.retain method to Draggable to allow for removal of objects from their DragArea.set_(pre|post)_draw_func methods to DragArea that are run immediately before and after drawing and corresponding unset_(pre|post)_draw_func methods.DrawingArea draw function to CairoDrag pre- and post-draw functions (set with set_pre_draw_func and set_post_draw_func).