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