diff options
author | Shav Kinderlehrer <[email protected]> | 2024-02-21 14:45:48 -0500 |
---|---|---|
committer | Shav Kinderlehrer <[email protected]> | 2024-02-21 14:45:48 -0500 |
commit | 2619848a70d1c1cf366a288dcb889103b7464f1c (patch) | |
tree | 9dc2664015f0038d8358f5b2f26dbdd3a828e7ca /Jel/Views/Item/Series/ItemSeriesEpisodeIconView.swift | |
parent | ed056435427f8a3699f55ca77adcad6dd3c2f246 (diff) | |
download | jel-2619848a70d1c1cf366a288dcb889103b7464f1c.tar.gz jel-2619848a70d1c1cf366a288dcb889103b7464f1c.zip |
Finish ItemSeriesEpisodeIconView + make geo size globally available
Diffstat (limited to 'Jel/Views/Item/Series/ItemSeriesEpisodeIconView.swift')
-rw-r--r-- | Jel/Views/Item/Series/ItemSeriesEpisodeIconView.swift | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/Jel/Views/Item/Series/ItemSeriesEpisodeIconView.swift b/Jel/Views/Item/Series/ItemSeriesEpisodeIconView.swift index fea8997..9217bea 100644 --- a/Jel/Views/Item/Series/ItemSeriesEpisodeIconView.swift +++ b/Jel/Views/Item/Series/ItemSeriesEpisodeIconView.swift @@ -12,23 +12,30 @@ import ExpandableText struct ItemSeriesEpisodeIconView: View { var item: BaseItemDto + @EnvironmentObject var size: ScreenSize + + var iconWidthMultiplier: CGFloat = 0.35 + var body: some View { - HStack(alignment: .top) { - VStack(alignment: .leading) { - Text("Episode \(item.indexNumber ?? 0)") - .foregroundStyle(Color.secondary) - .font(.callout) - ItemIconView(item: item, width: UIScreen.screenWidth * 0.5, contentMode: .fill) - .setAspectRatio(item.primaryImageAspectRatio ?? 1.7) - } - .frame(width: UIScreen.screenWidth * 0.5) - - VStack(alignment: .leading) { - Text(item.name ?? "Episode \(item.indexNumber ?? 0)") - .font(.callout) - .bold() - Text(item.overview ?? "") - .frame(height: (UIScreen.screenWidth * 0.5) / (item.primaryImageAspectRatio ?? 1.7)) // Calculate optimal amount of lines based on episode image + VStack(alignment: .leading) { + HStack(alignment: .top) { + ItemIconView(item: item, width: (size.size.width * iconWidthMultiplier), height: (size.size.width * iconWidthMultiplier) / 1.7) + + VStack(alignment: .leading) { + Text("Episode \(item.indexNumber ?? 0)") + .foregroundStyle(Color.secondary) + .font(.caption) + Text(item.name ?? "---") + .bold() + .lineLimit(nil) + + Text(item.overview ?? "") + .foregroundStyle(Color.secondary) + .font(.callout) + + Spacer() + } + .frame(height: (size.size.width * iconWidthMultiplier) / 1.7) } } } |