Add UI window icon
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -3806,6 +3806,7 @@ dependencies = [
|
||||
"egui-wgpu",
|
||||
"encase",
|
||||
"goo_format",
|
||||
"image 0.25.1",
|
||||
"nalgebra",
|
||||
"rfd",
|
||||
"slicer",
|
||||
|
@@ -10,6 +10,7 @@ eframe = { version = "0.27.2", features = ["wgpu"] }
|
||||
egui = "0.27.2"
|
||||
egui-wgpu = "0.27.2"
|
||||
encase = "0.8.0"
|
||||
image = "0.25.1"
|
||||
nalgebra = "0.32.6"
|
||||
rfd = "0.14.1"
|
||||
wgpu = "0.19.4"
|
||||
|
BIN
ui/src/assets/icon.png
Normal file
BIN
ui/src/assets/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 721 B |
@@ -1,6 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use eframe::NativeOptions;
|
||||
use egui::Vec2;
|
||||
use egui::{IconData, Vec2, ViewportBuilder};
|
||||
use wgpu::TextureFormat;
|
||||
|
||||
const TEXTURE_FORMAT: TextureFormat = TextureFormat::Bgra8Unorm;
|
||||
@@ -12,14 +12,20 @@ mod workspace;
|
||||
use app::App;
|
||||
use workspace::render;
|
||||
|
||||
const ICON: &[u8] = include_bytes!("assets/icon.png");
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let icon = image::load_from_memory(ICON)?;
|
||||
eframe::run_native(
|
||||
"mslicer",
|
||||
NativeOptions {
|
||||
window_builder: Some(Box::new(|builder| {
|
||||
builder.with_inner_size(Vec2::new(1920.0, 1080.0))
|
||||
})),
|
||||
|
||||
viewport: ViewportBuilder::default()
|
||||
.with_inner_size(Vec2::new(1920.0, 1080.0))
|
||||
.with_icon(IconData {
|
||||
rgba: icon.to_rgba8().to_vec(),
|
||||
width: icon.width(),
|
||||
height: icon.height(),
|
||||
}),
|
||||
depth_buffer: 24,
|
||||
stencil_buffer: 8,
|
||||
..Default::default()
|
||||
|
Reference in New Issue
Block a user