mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 14:03:42 +02:00
Pick image component (#295)
* Extract render_possible_image into function * Seperate render_image into reusable functions * Seperate game image into component * Use image component in shortcut overview * Reuse image pick component in type select * Reuse component across select_image_type * Use image type to scale image buttons Use image type to scale * Remove old functions
This commit is contained in:
@@ -22,6 +22,17 @@ impl ImageType {
|
||||
&ALL_TYPES
|
||||
}
|
||||
|
||||
pub fn ratio(&self) -> f32{
|
||||
match self {
|
||||
ImageType::Hero => 0.3,
|
||||
ImageType::Grid => 1.6,
|
||||
ImageType::WideGrid => 0.5,
|
||||
ImageType::Logo => 0.2,
|
||||
ImageType::BigPicture => 0.5,
|
||||
ImageType::Icon => 1.0,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn name(&self) -> &str {
|
||||
match self {
|
||||
ImageType::Hero => "Hero",
|
||||
|
||||
Reference in New Issue
Block a user