mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-12-27 04:33:29 +08:00
0dd3b84e4a
# Conflicts: # BililiveRecorder.WPF/Controls/AddRoomFailedDialog.xaml.cs # BililiveRecorder.WPF/Controls/RoomCard.xaml # BililiveRecorder.WPF/Controls/TaskbarIconControl.xaml # BililiveRecorder.WPF/Controls/TaskbarIconControl.xaml.cs # BililiveRecorder.WPF/NewMainWindow.xaml.cs # BililiveRecorder.WPF/Pages/AnnouncementPage.xaml.cs # BililiveRecorder.WPF/Pages/RootPage.xaml.cs
84 lines
5.5 KiB
XML
84 lines
5.5 KiB
XML
<UserControl
|
|
x:Class="BililiveRecorder.WPF.Controls.TaskbarIconControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
|
xmlns:l="https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension"
|
|
l:LocalizeDictionary.DesignCulture=""
|
|
l:ResxLocalizationProvider.DefaultAssembly="BililiveRecorder.WPF"
|
|
l:ResxLocalizationProvider.DefaultDictionary="Strings"
|
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
|
xmlns:local="clr-namespace:BililiveRecorder.WPF.Controls"
|
|
mc:Ignorable="d">
|
|
<tb:TaskbarIcon
|
|
x:Name="TaskbarIcon" TrayLeftMouseUp="TaskbarIcon_TrayLeftMouseUp"
|
|
Visibility="{Binding Recorder, Converter={StaticResource IsNullToVisibilityCollapsedConverter}}"
|
|
ToolTipText="{l:Loc TaskbarIconControl_Title}" MenuActivation="RightClick"
|
|
>
|
|
<tb:TaskbarIcon.ContextMenu>
|
|
<ContextMenu l:ResxLocalizationProvider.DefaultDictionary="Strings">
|
|
<MenuItem Header="{l:Loc TaskbarIconControl_MenuItem_OpenMainWindow}" Click="MenuItem_OpenMainWindow_Click"/>
|
|
<Separator/>
|
|
<MenuItem Header="{l:Loc Global_Quit}" Click="MenuItem_Quit_Click"/>
|
|
</ContextMenu>
|
|
</tb:TaskbarIcon.ContextMenu>
|
|
<tb:TaskbarIcon.TrayToolTip>
|
|
<Border
|
|
Background="{DynamicResource SystemControlBackgroundAltHighBrush}"
|
|
BorderBrush="{DynamicResource SystemControlBackgroundAccentBrush}"
|
|
MinWidth="250"
|
|
BorderThickness="2"
|
|
CornerRadius="5">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<StackPanel Margin="10">
|
|
<TextBlock Style="{DynamicResource SubtitleTextBlockStyle}" Text="{l:Loc TaskbarIconControl_Title}" FontFamily="Microsoft Yahei"/>
|
|
<TextBlock Text="{Binding Recorder.Config.Global.WorkDirectory,Mode=OneWay}" TextWrapping="NoWrap" FontFamily="Microsoft Yahei"/>
|
|
</StackPanel>
|
|
<Separator Grid.Row="1" Grid.ColumnSpan="2" />
|
|
<ItemsControl Grid.Row="2" Grid.ColumnSpan="2" Margin="10,0,10,10" ItemsSource="{Binding Recorder, Mode=OneWay}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,5,0,0">
|
|
<ui:PathIcon
|
|
Visibility="{Binding IsMonitoring,Converter={StaticResource BooleanToVisibilityHiddenConverter}}"
|
|
Style="{StaticResource PathIconDataCctv}" Foreground="DarkOrange" Width="15"/>
|
|
<ui:PathIcon
|
|
Visibility="{Binding IsRecording,Converter={StaticResource BooleanToVisibilityHiddenConverter}}"
|
|
Style="{StaticResource PathIconDataRecordRec}" Foreground="Red" Width="15" Margin="3,0"/>
|
|
<TextBlock Text="{Binding StreamerName, Mode=OneWay}" TextWrapping="NoWrap"
|
|
FontFamily="Microsoft Yahei" TextTrimming="CharacterEllipsis"/>
|
|
<Border VerticalAlignment="Center" MinWidth="80"
|
|
Visibility="{Binding IsRecording,Converter={StaticResource BooleanToVisibilityHiddenConverter}}"
|
|
Background="{Binding DownloadSpeedPersentage, Converter={StaticResource PercentageToColorBrushConverter},Mode=OneWay}"
|
|
BorderThickness="1" BorderBrush="{DynamicResource SystemControlBackgroundChromeBlackMediumBrush}" Margin="2,0" CornerRadius="5">
|
|
<TextBlock HorizontalAlignment="Center" Foreground="Black" FontFamily="Microsoft Yahei">
|
|
<TextBlock.Text>
|
|
<MultiBinding Converter="{l:StringFormatConverter}">
|
|
<l:BLoc Key="RoomCard_Status_SpeedIndicator_SpeedInMbps"/>
|
|
<Binding Path="DownloadSpeedMegaBitps" Mode="OneWay"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
</Border>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<VirtualizingStackPanel IsItemsHost="True"/>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
</ItemsControl>
|
|
</Grid>
|
|
</Border>
|
|
</tb:TaskbarIcon.TrayToolTip>
|
|
</tb:TaskbarIcon>
|
|
</UserControl>
|