44using System . Windows . Markup ;
55using System . Windows . Media ;
66using System . Windows . Media . Imaging ;
7+ using Diffusion . Common ;
78using Diffusion . Toolkit . Models ;
89using Diffusion . Toolkit . Themes ;
910
@@ -21,6 +22,9 @@ public class ThumbnailIcons : FrameworkElement
2122 private static BitmapImage ? _darkHideIcon ;
2223 private static BitmapImage ? _lightHideIcon ;
2324
25+ private static BitmapImage ? _darkVideoIcon ;
26+ private static BitmapImage ? _lightVideoIcon ;
27+
2428 private static Typeface _typeFace = new Typeface ( new FontFamily ( "Arial" ) , FontStyles . Normal , FontWeights . Normal , FontStretches . Normal ) ;
2529 private static Typeface _typeFaceBoldCondensed = new Typeface ( new FontFamily ( "Arial" ) , FontStyles . Normal , FontWeights . Bold , FontStretches . Condensed ) ;
2630
@@ -42,6 +46,7 @@ private static void PropertyChangedCallback(DependencyObject d, DependencyProper
4246 case nameof ( ImageEntry . ForDeletion ) :
4347 case nameof ( ImageEntry . Favorite ) :
4448 case nameof ( ImageEntry . Rating ) :
49+ case nameof ( ImageEntry . Type ) :
4550 var thumb = d as ThumbnailIcons ;
4651 thumb . InvalidateVisual ( ) ;
4752 break ;
@@ -84,6 +89,10 @@ private static void InitIcons()
8489 _darkHideIcon = new BitmapImage ( darkHideIconUri ) ;
8590 Uri lightHideIconUri = GetUri ( "/Icons/Light/hide-24.png" ) ;
8691 _lightHideIcon = new BitmapImage ( lightHideIconUri ) ;
92+ Uri darkVideoIconUri = GetUri ( "/Icons/Dark/video-24.png" ) ;
93+ _darkVideoIcon = new BitmapImage ( darkVideoIconUri ) ;
94+ Uri lightVideoIconUri = GetUri ( "/Icons/Light/video-24.png" ) ;
95+ _lightVideoIcon = new BitmapImage ( lightVideoIconUri ) ;
8796 Uri errorIconUri = GetUri ( "/Icons/error-32.png" ) ;
8897 _errorIcon = new BitmapImage ( errorIconUri ) ;
8998 }
@@ -119,6 +128,21 @@ protected override void OnRender(DrawingContext drawingContext)
119128 }
120129
121130
131+
132+ if ( Data . Type == ImageType . Video )
133+ {
134+ if ( ThemeManager . CurrentTheme == "Dark" )
135+ {
136+ drawingContext . DrawImage ( _darkVideoIcon , new Rect ( new Point ( x , y ) , new Size ( 24 , 24 ) ) ) ;
137+ }
138+ else if ( ThemeManager . CurrentTheme == "Light" )
139+ {
140+ drawingContext . DrawImage ( _lightVideoIcon , new Rect ( new Point ( x , y ) , new Size ( 24 , 24 ) ) ) ;
141+ }
142+ x += xOffset ;
143+ }
144+
145+
122146 if ( Data . NSFW )
123147 {
124148 if ( ThemeManager . CurrentTheme == "Dark" )
0 commit comments