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:
Philip Kristoffersen
2022-12-30 09:22:33 +01:00
committed by GitHub
parent ef72451289
commit 90c0185c8f
8 changed files with 251 additions and 217 deletions
+11
View File
@@ -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",