@@ -50,6 +50,11 @@ public partial class TweetThumbnail : UserControl
5050 public event EventHandler < ThumbnailDoubleClickEventArgs > ? ThumbnailDoubleClick ;
5151 public event EventHandler < ThumbnailImageSearchEventArgs > ? ThumbnailImageSearchClick ;
5252
53+ private TweetThumbnailWindow ? _thumbWindow ;
54+ private TweetThumbnailWindow ThumbnailWindow
55+ => _thumbWindow ??= CreateTweetThumbnailWindow ( ) ;
56+
57+
5358 public ThumbnailInfo Thumbnail
5459 => ( ThumbnailInfo ) this . pictureBox [ this . scrollBar . Value ] . Tag ;
5560
@@ -142,6 +147,7 @@ protected void SetThumbnailCount(int count)
142147
143148 picbox . MouseWheel -= this . pictureBox_MouseWheel ;
144149 picbox . DoubleClick -= this . pictureBox_DoubleClick ;
150+ picbox . MouseClick -= this . pictureBox_MouseClick ;
145151 picbox . Dispose ( ) ;
146152
147153 memoryImage ? . Dispose ( ) ;
@@ -160,6 +166,7 @@ protected void SetThumbnailCount(int count)
160166 picbox . Visible = ( i == 0 ) ;
161167 picbox . MouseWheel += this . pictureBox_MouseWheel ;
162168 picbox . DoubleClick += this . pictureBox_DoubleClick ;
169+ picbox . MouseClick += this . pictureBox_MouseClick ;
163170
164171 filter . Register ( picbox ) ;
165172
@@ -231,6 +238,36 @@ private void pictureBox_MouseWheel(object sender, MouseEventArgs e)
231238 this . ScrollDown ( ) ;
232239 }
233240
241+ private void pictureBox_MouseClick ( object sender , MouseEventArgs e )
242+ {
243+ var picBox = sender as PictureBox ;
244+ if ( picBox == null ) return ;
245+
246+ var thumb = picBox . Tag as ThumbnailInfo ;
247+ if ( thumb == null || thumb . IsPlayable ) return ;
248+
249+ this . ShowThubWindow ( picBox . Image , thumb ) ;
250+ }
251+
252+ private void ShowThubWindow ( Image image , ThumbnailInfo thumbnailInfo )
253+ {
254+ var thumbWindow = this . ThumbnailWindow ;
255+ if ( thumbWindow . Image == image )
256+ {
257+ ThumbnailWindow . HideAndClear ( ) ;
258+ return ;
259+ }
260+
261+ thumbWindow . Image = image ;
262+ thumbWindow . Show ( ) ;
263+ }
264+ private TweetThumbnailWindow CreateTweetThumbnailWindow ( )
265+ {
266+ var window = new TweetThumbnailWindow ( this . ParentForm ) ;
267+ this . components . Add ( window ) ;
268+ return window ;
269+ }
270+
234271 private void pictureBox_DoubleClick ( object sender , EventArgs e )
235272 {
236273 if ( ( ( PictureBox ) sender ) . Tag is ThumbnailInfo thumb )
0 commit comments