mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-13 03:34:55 +08:00
fix #63
This commit is contained in:
@@ -50,10 +50,10 @@ namespace BetterLyrics.WinUI3
|
||||
|
||||
_logger = Ioc.Default.GetRequiredService<ILogger<App>>();
|
||||
|
||||
UnhandledException += App_UnhandledException;
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
|
||||
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||
//UnhandledException += App_UnhandledException;
|
||||
//AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
//AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
|
||||
//TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
|
||||
}
|
||||
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs args)
|
||||
|
||||
@@ -50,10 +50,10 @@ namespace BetterLyrics.WinUI3
|
||||
_dockWindowHeight = _settingsService.DockWindowHeight;
|
||||
OnIsImmersiveModeChanged(_settingsService.IsImmersiveMode);
|
||||
|
||||
_playbackService.SongInfoChanged += PlaybackService_SongInfoChanged;
|
||||
_playbackService.IsPlayingChanged += PlaybackService_IsPlayingChanged;
|
||||
}
|
||||
|
||||
private void PlaybackService_SongInfoChanged(object? sender, Events.SongInfoChangedEventArgs e)
|
||||
private void PlaybackService_IsPlayingChanged(object? sender, Events.IsPlayingChangedEventArgs e)
|
||||
{
|
||||
AutoHideOrShowWindow();
|
||||
}
|
||||
@@ -103,7 +103,7 @@ namespace BetterLyrics.WinUI3
|
||||
|
||||
if (IsDockMode || IsDesktopMode)
|
||||
{
|
||||
if (_hideWindowWhenNotPlaying && _playbackService.SongInfo == null)
|
||||
if (_hideWindowWhenNotPlaying && !_playbackService.IsPlaying)
|
||||
{
|
||||
if (IsDockMode)
|
||||
{
|
||||
|
||||
@@ -259,10 +259,10 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
|
||||
private void PlayTrack(Track? track)
|
||||
{
|
||||
_timelineController.Pause();
|
||||
_mediaPlayer.Source = null;
|
||||
if (track == null)
|
||||
{
|
||||
_timelineController.Pause();
|
||||
_mediaPlayer.Source = null;
|
||||
_smtc.IsEnabled = false;
|
||||
}
|
||||
else
|
||||
@@ -279,6 +279,10 @@ namespace BetterLyrics.WinUI3.ViewModels
|
||||
{
|
||||
updater.Thumbnail = ImageHelper.ByteArrayToRandomAccessStreamReference(pictureData);
|
||||
}
|
||||
else
|
||||
{
|
||||
updater.Thumbnail = null;
|
||||
}
|
||||
updater.Update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,7 +327,24 @@
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<SemanticZoom Margin="0,48,0,0">
|
||||
<StackPanel
|
||||
Margin="12,58,12,0"
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Horizontal"
|
||||
Spacing="12">
|
||||
<Button>
|
||||
<Button.Content>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="添加到播放列表" />
|
||||
<TextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}" Text="{x:Bind TracksByTitleCVS.View.Count, Mode=OneWay}" />
|
||||
<TextBlock Foreground="{ThemeResource TextFillColorSecondaryBrush}" Text=" 项" />
|
||||
</StackPanel>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Content="多选" />
|
||||
</StackPanel>
|
||||
|
||||
<SemanticZoom Margin="0,96,0,0">
|
||||
<SemanticZoom.ZoomedInView>
|
||||
<ListView
|
||||
x:Name="SongListView"
|
||||
@@ -431,7 +448,7 @@
|
||||
Style="{StaticResource GhostButtonStyle}">
|
||||
<Button.Flyout>
|
||||
<MenuFlyout>
|
||||
<MenuFlyoutItem x:Uid="MusicGalleryPageRemoveFromPlayingQueue" Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}" />
|
||||
<MenuFlyoutItem Click="RemoveFromPlayingQueueMenuFlyoutItem_Click" x:Uid="MusicGalleryPageRemoveFromPlayingQueue" Icon="{ui:FontIcon FontFamily={StaticResource IconFontFamily}, Glyph=}" />
|
||||
</MenuFlyout>
|
||||
</Button.Flyout>
|
||||
</Button>
|
||||
|
||||
@@ -72,5 +72,11 @@ namespace BetterLyrics.WinUI3.Views
|
||||
if (ViewModel.PlayingTrack == null) return;
|
||||
PlayingQueueListView.ScrollIntoView(ViewModel.PlayingTrack, ScrollIntoViewAlignment.Leading);
|
||||
}
|
||||
|
||||
private void RemoveFromPlayingQueueMenuFlyoutItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var track = (Track)((FrameworkElement)sender).DataContext;
|
||||
ViewModel.TrackPlayingQueue.Remove(track);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user