Add Radios to the systray

This commit is contained in:
Théo Marchal 2021-10-04 14:06:20 +02:00
parent 196b93c7f3
commit 62835065c0
6 changed files with 31 additions and 2 deletions

View File

@ -369,7 +369,7 @@ namespace unison
{
_cover = BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
}
catch (System.NotSupportedException e)
catch (System.NotSupportedException)
{
_cover = null;
}

View File

@ -141,6 +141,15 @@ namespace unison.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Radios.
/// </summary>
public static string Radios {
get {
return ResourceManager.GetString("Radios", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Settings.
/// </summary>

View File

@ -120,6 +120,9 @@
<data name="Exit" xml:space="preserve">
<value>Quitter</value>
</data>
<data name="Radios" xml:space="preserve">
<value>Radios</value>
</data>
<data name="Radio_Country" xml:space="preserve">
<value>Pays</value>
</data>

View File

@ -120,7 +120,7 @@
<Button x:Name="Radio" Padding="5, 2" HorizontalAlignment="Left" Click="Radios_Clicked" Margin="5,0,10,0" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<StackPanel Orientation="Horizontal">
<emoji:TextBlock Text="📻" Padding="0,0,0,2"/>
<TextBlock Text="Radios" Margin="5, 0, 0, 0"/>
<TextBlock Text="{x:Static properties:Resources.Radios}" Margin="5, 0, 0, 0"/>
</StackPanel>
</Button>
</StackPanel>

View File

@ -25,6 +25,11 @@
<Image Width="16" Height="16" emoji:Image.Source="🔊" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{x:Static properties:Resources.Radios}" Command="{Binding Radios}">
<MenuItem.Icon>
<Image Width="16" Height="16" emoji:Image.Source="📻" />
</MenuItem.Icon>
</MenuItem>
<!--<MenuItem Header="Shuffle" Command="{Binding Shuffle}">
<MenuItem.Icon>
<Image Width="16" Height="16" emoji:Image.Source="🔀" />

View File

@ -59,6 +59,18 @@ namespace unison
}
}
public ICommand Radios
{
get
{
return new DelegateCommand
{
CommandAction = () => ((MainWindow)Application.Current.MainWindow).Radios_Clicked(null, null),
CanExecuteFunc = () => true
};
}
}
public ICommand Settings
{
get