add readme
This commit is contained in:
parent
a5cf8679c3
commit
e54cf8a1bd
@ -4,8 +4,8 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
egui = { version = "0.29.1", default-features = false }
|
||||
egui = { version = "0.29.0", default-features = false }
|
||||
qrcode = { version = "0.14.1", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
eframe = "0.29.1"
|
||||
eframe = "0.29.0"
|
10
README.md
Normal file
10
README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# egui_qr
|
||||
|
||||
Simple egui painter that renders QR Codes
|
||||
|
||||
## Example
|
||||
|
||||
```rust
|
||||
QrCodeWidget::from_data(b"https://google.com")?
|
||||
.ui(ui);
|
||||
```
|
@ -6,7 +6,7 @@ fn main() {
|
||||
let _ = eframe::run_native(
|
||||
"egui_qr",
|
||||
NativeOptions::default(),
|
||||
Box::new(|_| Box::new(App::new())),
|
||||
Box::new(|_| Ok(Box::new(App::new()))),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -40,12 +40,7 @@ impl Widget for QrCodeWidget<'_> {
|
||||
let (response, painter) =
|
||||
ui.allocate_painter(vec2(w as f32 * scale, w as f32 * scale), Sense::click());
|
||||
|
||||
painter.rect(
|
||||
response.rect,
|
||||
Rounding::ZERO,
|
||||
Color32::WHITE,
|
||||
Stroke::NONE,
|
||||
);
|
||||
painter.rect(response.rect, Rounding::ZERO, Color32::WHITE, Stroke::NONE);
|
||||
let mut ctr = 0;
|
||||
for c in code_ref.to_colors() {
|
||||
let row = ctr / w;
|
||||
|
Loading…
x
Reference in New Issue
Block a user