From 020f19bf9319631515d36608c6617751a6c80168 Mon Sep 17 00:00:00 2001 From: jasonchenwork Date: Wed, 18 Jun 2025 15:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=A0=81=E7=A2=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PrimaryFormParts/PrimaryForm.MultiPagePanel.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/PrimaryFormParts/PrimaryForm.MultiPagePanel.cs b/PrimaryFormParts/PrimaryForm.MultiPagePanel.cs index 93418dc..0f8774a 100644 --- a/PrimaryFormParts/PrimaryForm.MultiPagePanel.cs +++ b/PrimaryFormParts/PrimaryForm.MultiPagePanel.cs @@ -158,10 +158,10 @@ namespace DualScreenDemo } public void LoadPreviousPage() { - if (currentPageIndex > 0) + if (currentPageIndex - 1 >= 0) { currentPageIndex--; - if(currentSongList.Count == 0) + if(_isShowingSinger) { RefreshDisplayBase_Singer(); } @@ -358,6 +358,10 @@ namespace DualScreenDemo // 添加滑鼠事件 artistLabel.MouseEnter += mouseEnter; artistLabel.MouseLeave += mouseLeave; + // 滑動 + artistLabel.MouseDown += MultiPagePanel_MouseDown; + artistLabel.MouseMove += MultiPagePanel_MouseMove; + artistLabel.MouseUp += MultiPagePanel_MouseUp; separatorPanel.MouseEnter += mouseEnter; separatorPanel.MouseLeave += mouseLeave; // 添加到畫面上 @@ -612,10 +616,18 @@ namespace DualScreenDemo // 添加事件处理 songLabel.Click += PrimaryForm.Instance.Label_Click; artistLabel.Click += PrimaryForm.Instance.Label_Click; + // 滑動事件調整位置 + songLabel.MouseDown += MultiPagePanel_MouseDown; + songLabel.MouseMove += MultiPagePanel_MouseMove; + songLabel.MouseUp += MultiPagePanel_MouseUp; songLabel.MouseEnter += mouseEnter; songLabel.MouseLeave += mouseLeave; artistLabel.MouseEnter += mouseEnter; artistLabel.MouseLeave += mouseLeave; + // 滑動事件調整位置 + artistLabel.MouseDown += MultiPagePanel_MouseDown; + artistLabel.MouseMove += MultiPagePanel_MouseMove; + artistLabel.MouseUp += MultiPagePanel_MouseUp; separatorPanel.MouseEnter += mouseEnter; separatorPanel.MouseLeave += mouseLeave; // 按正确顺序添加控件