From 04926c41fc66793a264c0706fcb3e63b76f11e4d Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Mon, 5 Oct 2020 12:00:25 +0200 Subject: [PATCH] Keyed images --- src/Views.elm | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/Views.elm b/src/Views.elm index 94110e6..f6a702c 100644 --- a/src/Views.elm +++ b/src/Views.elm @@ -125,13 +125,19 @@ playlistsView device playlists = playlistView : Twitch.Playlist -> Element Core.Msg playlistView playlist = let + src = + Twitch.playlistMiniatureUrl playlist + image = - Element.image - [ Element.width Element.fill - , Element.height Element.fill - , Element.inFront inFront - ] - { description = "", src = Twitch.playlistMiniatureUrl playlist } + Keyed.el [ Element.width Element.fill, Element.height Element.fill ] + ( src + , Element.image + [ Element.width Element.fill + , Element.height Element.fill + , Element.inFront inFront + ] + { description = "", src = src } + ) length = List.length playlist.videos @@ -217,13 +223,19 @@ videoMiniature playlist video = , Element.padding 5 ] + src = + Twitch.videoMiniatureUrl playlist video + image = - Element.image - [ Element.width Element.fill - , Element.height Element.fill - , Element.inFront inFront - ] - { description = "", src = Twitch.videoMiniatureUrl playlist video } + Keyed.el [ Element.width Element.fill, Element.height Element.fill ] + ( src + , Element.image + [ Element.width Element.fill + , Element.height Element.fill + , Element.inFront inFront + ] + { description = "", src = src } + ) label = formatTime video.duration