diff --git a/CharacterMap/CharacterMap/App.xaml b/CharacterMap/CharacterMap/App.xaml index a5d58fe0..ed997bbd 100644 --- a/CharacterMap/CharacterMap/App.xaml +++ b/CharacterMap/CharacterMap/App.xaml @@ -20,6 +20,7 @@ + + + + + + + - + @@ -193,7 +185,7 @@ VerticalAlignment="Center" FontSize="12" FontWeight="Normal" - Foreground="White" + Foreground="{ThemeResource ControlHighlightContrastForegroundBrush}" IsHitTestVisible="False" Style="{StaticResource BaseTextStyle}" Text="Character Map UWP" @@ -831,6 +823,8 @@ + --> + - - - - - + @@ -2357,6 +2449,22 @@ Orientation="Horizontal" Spacing="8"> + + + + + + + + + + + + + + + + @@ -2379,12 +2487,12 @@ @@ -2393,7 +2501,7 @@ Width="9" Height="9" helpers:CompositionFactory.OpacityDuration="{StaticResource BrushDuration}" - Fill="{ThemeResource CheckBoxBorderBrush}" + Fill="{ThemeResource ControlGlyphBrush}" Opacity="0" RadiusX="10" RadiusY="10" @@ -2401,6 +2509,7 @@ @@ -4686,20 +4795,15 @@ - - - - - - - - - - - - - - + + + + + + + + + @@ -4961,7 +5065,7 @@ RadiusX="4" RadiusY="4" Stroke="Transparent" - StrokeThickness="2" /> + StrokeThickness="1" /> @@ -4980,7 +5084,7 @@ x:Name="SwitchKnobOff" Width="10" Height="10" - Fill="{ThemeResource CheckBoxBorderBrush}" + Fill="{ThemeResource ControlGlyphBrush}" RadiusX="2" RadiusY="2" /> @@ -4998,11 +5102,8 @@ - - - diff --git a/CharacterMap/CharacterMap/Views/FontMapView.xaml.cs b/CharacterMap/CharacterMap/Views/FontMapView.xaml.cs index 6e6b978f..84632728 100644 --- a/CharacterMap/CharacterMap/Views/FontMapView.xaml.cs +++ b/CharacterMap/CharacterMap/Views/FontMapView.xaml.cs @@ -228,6 +228,9 @@ private void ViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e { try { + if (PreviewGrid.Visibility == Visibility.Collapsed || PreviewGridContent.Visibility == Visibility.Collapsed) + return; + // Empty glyphs will cause the connected animation service to crash, so manually // check if the rendered glyph contains content if (CharGrid.ContainerFromItem(ViewModel.SelectedChar) is FrameworkElement container diff --git a/CharacterMap/CharacterMap/Views/MainPage.xaml b/CharacterMap/CharacterMap/Views/MainPage.xaml index 7165bf39..ff136879 100644 --- a/CharacterMap/CharacterMap/Views/MainPage.xaml +++ b/CharacterMap/CharacterMap/Views/MainPage.xaml @@ -27,6 +27,10 @@ IsSourceGrouped="True" Source="{Binding GroupedFontList}" /> + - + - + + + + + + @@ -374,6 +393,7 @@ - + + Text="{core:Localizer Key=TxtLoadingFonts/Text, Casing={StaticResource TitleCasing}}" /> @@ -748,6 +768,8 @@ + + diff --git a/CharacterMap/CharacterMap/Views/MainPage.xaml.cs b/CharacterMap/CharacterMap/Views/MainPage.xaml.cs index c02d1a14..1c4cd52d 100644 --- a/CharacterMap/CharacterMap/Views/MainPage.xaml.cs +++ b/CharacterMap/CharacterMap/Views/MainPage.xaml.cs @@ -18,12 +18,14 @@ using System.Windows.Input; using Windows.ApplicationModel.Core; using Windows.ApplicationModel.DataTransfer; +using Windows.Foundation; using Windows.Storage.Pickers; using Windows.System; using Windows.UI.Core; using Windows.UI.ViewManagement; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Navigation; @@ -465,6 +467,47 @@ private void FontCompareButton_Click(object sender, RoutedEventArgs e) _ = QuickCompareView.CreateWindowAsync(false); } + private void LstFontFamily_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args) + { + args.ItemContainer.PointerPressed -= ItemContainer_PointerPressed; + args.ItemContainer.PointerPressed += ItemContainer_PointerPressed; + + args.ItemContainer.ContextRequested -= ItemContainer_ContextRequested; + args.ItemContainer.ContextRequested += ItemContainer_ContextRequested; + } + + private void ItemContainer_PointerPressed(object sender, PointerRoutedEventArgs e) + { + /* MIDDLE CLICK FOR FONT LIST */ + var pointer = e.GetCurrentPoint(sender as FrameworkElement); + if (pointer.Properties.IsMiddleButtonPressed + && sender is ListViewItem f + && f.Content is InstalledFont font) + { + _ = FontMapView.CreateNewViewForFontAsync(font); + } + } + + private void ItemContainer_ContextRequested(UIElement sender, ContextRequestedEventArgs args) + { + /* RIGHT CLICK FOR FONT LIST */ + if (sender is ListViewItem f + && f.Content is InstalledFont font) + { + args.Handled = true; + FlyoutBase.SetAttachedFlyout(f, FontListFlyout); + FlyoutHelper.CreateMenu( + FontListFlyout, + font, + null, + null, + false); + + args.TryGetPosition(sender, out Point pos); + FontListFlyout.ShowAt(sender, pos); + } + } + diff --git a/CharacterMap/CharacterMap/Views/QuickCompareView.xaml b/CharacterMap/CharacterMap/Views/QuickCompareView.xaml index 47ea88d9..10720d3f 100644 --- a/CharacterMap/CharacterMap/Views/QuickCompareView.xaml +++ b/CharacterMap/CharacterMap/Views/QuickCompareView.xaml @@ -34,68 +34,6 @@ Icon="NewWindow" /> - - @@ -550,7 +489,7 @@ Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContextRequested="ItemContextRequested" - Style="{StaticResource ChromelessButtonStyle}" /> + Style="{StaticResource QuickCompareContainerStyle}" /> @@ -625,7 +564,7 @@ - +