vod頁面上下頁循環
This commit is contained in:
parent
f8a6e5c40d
commit
74740b1048
@ -6,7 +6,8 @@ using System.Text;
|
||||
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
public partial class PrimaryForm : Form{
|
||||
public partial class PrimaryForm : Form
|
||||
{
|
||||
public class MultiPagePanel : Panel
|
||||
{
|
||||
private const int ItemHeight = 70;
|
||||
@ -57,7 +58,8 @@ namespace DualScreenDemo
|
||||
}
|
||||
private bool _isShowingSinger = true;
|
||||
private List<SongData> currentSongList = new List<SongData>();
|
||||
public List<SongData> get_currentSongList(){
|
||||
public List<SongData> get_currentSongList()
|
||||
{
|
||||
return currentSongList;
|
||||
}
|
||||
private List<Artist> currentArtistList = new List<Artist>();
|
||||
@ -125,12 +127,12 @@ namespace DualScreenDemo
|
||||
int deltaX = e.X - mouseDownLocation.X;
|
||||
if (Math.Abs(deltaX) > 20) // 滑動距離超過50像素才觸發
|
||||
{
|
||||
if (deltaX > 0 && currentPageIndex > 0)
|
||||
if (deltaX > 0 )
|
||||
{
|
||||
// 向右滑動,上一頁
|
||||
LoadPreviousPage();
|
||||
}
|
||||
else if (deltaX < 0 && currentPageIndex < totalPages - 1)
|
||||
else if (deltaX < 0)
|
||||
{
|
||||
// 向左滑動,下一頁
|
||||
LoadNextPage();
|
||||
@ -158,6 +160,15 @@ namespace DualScreenDemo
|
||||
RefreshDisplay();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalPages > 1)
|
||||
{
|
||||
currentPageIndex = -1;
|
||||
LoadNextPage();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public void LoadPreviousPage()
|
||||
{
|
||||
@ -168,11 +179,22 @@ namespace DualScreenDemo
|
||||
{
|
||||
RefreshDisplayBase_Singer();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
RefreshDisplay();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (totalPages > 1)
|
||||
{
|
||||
currentPageIndex = totalPages;
|
||||
LoadPreviousPage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void LoadSongs(List<SongData> songs, bool clearHistory = false)
|
||||
@ -308,14 +330,16 @@ namespace DualScreenDemo
|
||||
artistLabel.BackColor = Color.Transparent;
|
||||
|
||||
// 設置滑鼠事件
|
||||
EventHandler mouseEnter = (sender, e) => {
|
||||
EventHandler mouseEnter = (sender, e) =>
|
||||
{
|
||||
// 變更歌手名稱為黃色
|
||||
artistLabel.ForeColor = Color.Yellow;
|
||||
// 增強分隔線的亮度,使其更明顯
|
||||
separatorPanel.BackColor = Color.FromArgb(120, 255, 255, 255);
|
||||
|
||||
};
|
||||
EventHandler mouseLeave = (sender, e) => {
|
||||
EventHandler mouseLeave = (sender, e) =>
|
||||
{
|
||||
// 還原歌手名稱為白色
|
||||
artistLabel.ForeColor = Color.White;
|
||||
// 還原分隔線的亮度
|
||||
@ -455,18 +479,20 @@ namespace DualScreenDemo
|
||||
// 歌手標籤位置調整
|
||||
artistLabel.Location = new Point(artistX, y + 33);
|
||||
artistLabel.Size = new Size(artistWidth - 10, ItemHeight - 35);
|
||||
if (artistText.Length > 3)
|
||||
{
|
||||
artistLabel.Location = new Point(artistX - 95, y + 33);
|
||||
artistLabel.Size = new Size(artistWidth + 90, ItemHeight - 35);
|
||||
}
|
||||
|
||||
if (song.getB() != null)
|
||||
{
|
||||
artistText += " + " + song.getArtist_B(IsSimplified);
|
||||
artistLabel.Location = new Point(artistX - 95, y + 33);
|
||||
artistLabel.Size = new Size(artistWidth + 90, ItemHeight - 35);
|
||||
|
||||
//artistLabel.Location = new Point(artistX - 95, y + 33);
|
||||
//artistLabel.Size = new Size(artistWidth + 90, ItemHeight - 35);
|
||||
}
|
||||
|
||||
if (artistText.Length > 3)
|
||||
{
|
||||
artistLabel.Location = new Point(artistX - 581, y + 33);
|
||||
artistLabel.Size = new Size(artistWidth + 573, ItemHeight - 35);
|
||||
}
|
||||
|
||||
artistLabel.Text = artistText;
|
||||
// 創建分隔線面板
|
||||
Panel separatorPanel = new Panel
|
||||
@ -494,14 +520,16 @@ namespace DualScreenDemo
|
||||
songLabel.BackColor = Color.Transparent;
|
||||
artistLabel.BackColor = Color.Transparent;
|
||||
// 定義滑鼠進入 (MouseEnter) 事件的處理程序
|
||||
EventHandler mouseEnter = (sender, e) => {
|
||||
EventHandler mouseEnter = (sender, e) =>
|
||||
{
|
||||
songLabel.ForeColor = Color.Yellow;
|
||||
artistLabel.ForeColor = Color.Yellow;
|
||||
separatorPanel.BackColor = Color.FromArgb(120, 255, 255, 255);
|
||||
|
||||
};
|
||||
// 定義滑鼠離開 (MouseLeave) 事件的處理程序
|
||||
EventHandler mouseLeave = (sender, e) => {
|
||||
EventHandler mouseLeave = (sender, e) =>
|
||||
{
|
||||
songLabel.ForeColor = color;
|
||||
//artistLabel.ForeColor = Color.FromArgb(30, 144, 255);
|
||||
artistLabel.ForeColor = Color.FromArgb(36, 209, 216);
|
||||
|
Loading…
x
Reference in New Issue
Block a user