-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a9b6bb
commit 43f583c
Showing
9 changed files
with
41 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,13 @@ | ||
use eframe::egui::ColorImage; | ||
//TODO remove egui dependency | ||
pub struct About { | ||
pub(crate) github_url: String, | ||
pub(crate) logo: ColorImage, | ||
pub(crate) discord_url: String | ||
} | ||
|
||
impl Default for About { | ||
fn default() -> Self { | ||
let mut logo_path = image::io::Reader::open("graphics\\logo\\edcas.png"); | ||
if cfg!(target_os = "linux") { | ||
match image::io::Reader::open("/usr/share/edcas-client/graphics/logo/edcas.png") { | ||
Ok(_) => { | ||
logo_path = | ||
image::io::Reader::open("/usr/share/edcas-client/graphics/logo/edcas.png"); | ||
} | ||
Err(_) => { | ||
logo_path = image::io::Reader::open("graphics/logo/edcas.png"); | ||
} | ||
} | ||
} | ||
let image = logo_path.unwrap().decode().unwrap(); | ||
let size = [image.width() as _, image.height() as _]; | ||
let image_buffer = image.to_rgba8(); | ||
let pixels = image_buffer.as_flat_samples(); | ||
let color_image = ColorImage::from_rgba_unmultiplied(size, pixels.as_slice()); | ||
Self { | ||
github_url: "https://github.com/arne-fuchs/edcas-client".to_owned(), | ||
logo: color_image, | ||
discord_url: "https://discord.gg/fsstTkAw".to_owned() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters