An open API service indexing awesome lists of open source software.

https://github.com/hacknus/egui-circular-progress-bar

A simple circular progress bar widget for egui.
https://github.com/hacknus/egui-circular-progress-bar

Last synced: about 2 months ago
JSON representation

A simple circular progress bar widget for egui.

Awesome Lists containing this project

README

          

# egui Circular Progress Bar

[![crates.io](https://img.shields.io/crates/v/egui-circular-progress-bar.svg)](https://crates.io/crates/egui-circular-progress-bar)
[![Docs](https://docs.rs/egui-circular-progress-bar/badge.svg)](https://docs.rs/egui-circular-progress-bar)
[![Rust](https://github.com/hacknus/egui-circular-progress-bar/actions/workflows/rust.yml/badge.svg)](https://github.com/hacknus/egui-circular-progress-bar/actions/workflows/rust.yml)

A customizable circular progress bar widget for [egui](https://github.com/emilk/egui), the immediate mode GUI library for Rust.

![Circular Progress Bar Demo](demo.gif)

## Features

- Easy integration with existing egui applications

## Installation

Add this to your `Cargo.toml`:

```toml
[dependencies]
egui-circular-progress-bar = "0.3.0"
egui = "0.33"
```

## Quick Start

```rust
use egui_circular_progress_bar::CircularProgressBar;

fn main() -> Result<(), eframe::Error> {
let options = eframe::NativeOptions::default();
eframe::run_native(
"Circular Progress Bar Demo",
options,
Box::new(|_cc| Box::new(MyApp::default())),
)
}

struct MyApp {
progress: f32,
}

impl Default for MyApp {
fn default() -> Self {
Self { progress: 0.3 }
}
}

impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("Circular Progress Bar Demo");

// Basic usage
CircularProgressBar::new(self.progress)
.size(100.0)
.show(ui);

ui.slider(&mut self.progress, 0.0..=1.0, "Progress");
});
}
}
```

## Examples

Check out the `examples/` directory for more detailed usage examples:

- `demo.rs` - Simple demo for the circular progress bar

Run examples with:
```bash
cargo run --example demo
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

## Acknowledgments

- [egui](https://github.com/emilk/egui) - The amazing immediate mode GUI library