Skip to content

Commit

Permalink
fix window icon
Browse files Browse the repository at this point in the history
  • Loading branch information
fralonra committed Aug 6, 2023
1 parent 191654c commit f0463a0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 26 deletions.
Binary file added build/logo/ppd-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/logo/ppd-viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 8 additions & 13 deletions src/bin/editor.rs
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
#![windows_subsystem = "windows"]

use eframe::IconData;
use ppd_editor::editor;

fn main() {
env_logger::init();

let mut native_options = eframe::NativeOptions {
let native_options = eframe::NativeOptions {
centered: true,
initial_window_size: Some(eframe::epaint::vec2(1200.0, 700.0)),
..Default::default()
};

#[cfg(not(target_os = "macos"))]
{
use eframe::IconData;

native_options.icon_data = match IconData::try_from_png_bytes(include_bytes!(
"../../build/windows/ppd-editor.ico"
icon_data: match IconData::try_from_png_bytes(include_bytes!(
"../../build/logo/ppd-editor.png"
)) {
Ok(icon) => Some(icon),
Err(err) => {
log::warn!("Failed to load window icon: {}", err);
None
}
};
}
},
initial_window_size: Some(eframe::epaint::vec2(1200.0, 700.0)),
..Default::default()
};

eframe::run_native(
editor::APP_TITLE,
Expand Down
21 changes: 8 additions & 13 deletions src/bin/viewer.rs
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
#![windows_subsystem = "windows"]

use eframe::IconData;
use ppd_editor::viewer;

fn main() {
env_logger::init();

let mut native_options = eframe::NativeOptions {
let native_options = eframe::NativeOptions {
centered: true,
initial_window_size: Some(eframe::epaint::vec2(1200.0, 700.0)),
..Default::default()
};

#[cfg(not(target_os = "macos"))]
{
use eframe::IconData;

native_options.icon_data = match IconData::try_from_png_bytes(include_bytes!(
"../../build/windows/ppd-viewer.ico"
icon_data: match IconData::try_from_png_bytes(include_bytes!(
"../../build/logo/ppd-viewer.png"
)) {
Ok(icon) => Some(icon),
Err(err) => {
log::warn!("Failed to load window icon: {}", err);
None
}
};
}
},
initial_window_size: Some(eframe::epaint::vec2(1200.0, 700.0)),
..Default::default()
};

eframe::run_native(
viewer::APP_TITLE,
Expand Down

0 comments on commit f0463a0

Please sign in to comment.