private bool UpdatePopup() { if (CurrentTrack == null || ArtworkManager == null) { HidePopup(); return(false); } Gdk.Pixbuf pixbuf = ArtworkManager.LookupPixbuf(CurrentTrack.ArtworkId); if (pixbuf == null) { HidePopup(); return(false); } if (popup == null) { popup = new ArtworkPopup(); popup.EnterNotifyEvent += OnPopupEnterNotifyEvent; popup.LeaveNotifyEvent += OnPopupLeaveNotifyEvent; } popup.Label = String.Format("{0} - {1}", CurrentTrack.DisplayArtistName, CurrentTrack.DisplayAlbumTitle); popup.Image = pixbuf; if (in_thumbnail_region) { popup.Show(); } return(true); }
private void HidePopup() { if (popup != null) { ArtworkManager.DisposePixbuf(popup.Image); popup.Destroy(); popup.EnterNotifyEvent -= OnPopupEnterNotifyEvent; popup.LeaveNotifyEvent -= OnPopupLeaveNotifyEvent; popup = null; } }
private bool UpdatePopup() { if (CurrentTrack == null || ArtworkManager == null || !in_thumbnail_region) { HidePopup (); return false; } Gdk.Pixbuf pixbuf = ArtworkManager.LookupPixbuf (CurrentTrack.ArtworkId); if (pixbuf == null) { HidePopup (); return false; } if (popup == null) { popup = new ArtworkPopup (); popup.EnterNotifyEvent += OnPopupEnterNotifyEvent; popup.LeaveNotifyEvent += OnPopupLeaveNotifyEvent; } popup.Label = String.Format ("{0} - {1}", CurrentTrack.DisplayArtistName, CurrentTrack.DisplayAlbumTitle); if (popup.Image != null) { ArtworkManager.DisposePixbuf (popup.Image); } popup.Image = pixbuf; if (in_thumbnail_region) { popup.Show (); } return true; }
private void HidePopup() { if (popup != null) { ArtworkManager.DisposePixbuf (popup.Image); popup.Destroy (); popup.EnterNotifyEvent -= OnPopupEnterNotifyEvent; popup.LeaveNotifyEvent -= OnPopupLeaveNotifyEvent; popup = null; } }