Browse Source

Fix icons in shortcuts popup and settings, limit shortcuts popup size

Equbuxu 3 years ago
parent
commit
e8b90ff06b

+ 1 - 1
PixiEditor/Styles/Fonts.xaml

@@ -1,4 +1,4 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
     <FontFamily x:Key="Feather">pack://application:,,,/Fonts/#feather</FontFamily>
-</ResourceDictionary>
+</ResourceDictionary>

+ 2 - 2
PixiEditor/Views/Dialogs/SettingsWindow.xaml

@@ -137,8 +137,8 @@
                     IsChecked="{Binding SettingsSubViewModel.General.IsDebugModeEnabled}">Enable Debug Mode</CheckBox>
                 <Label Grid.Row="14" Grid.Column="1" Style="{StaticResource SettingsText}" VerticalAlignment="Center">
                     <Hyperlink Command="{cmds:Command PixiEditor.Debug.OpenCrashReportsDirectory}" Style="{StaticResource SettingsLink}">
-                               <Run Text="Open Crash Reports Directory"/>
-                               <Run Text="" FontFamily="Feather"/>
+                        <Run Text="Open Crash Reports Directory"/>
+                        <Run Text="" FontFamily="{StaticResource Feather}"/>
                     </Hyperlink>
                 </Label>
             </Grid>

+ 57 - 54
PixiEditor/Views/Dialogs/ShortcutPopup.xaml

@@ -12,8 +12,9 @@
         mc:Ignorable="d"
         WindowStartupLocation="CenterScreen"
         SizeToContent="Height"
-        Title="ShortcutPopup" Width="1220" WindowStyle="None"
+        Title="ShortcutPopup" WindowStyle="None"
         MinHeight="780" MinWidth="620" Topmost="{Binding IsTopmost}"
+        Width="950" MaxHeight="1000"
         KeyDown="ShortcutPopup_OnKeyDown">
     <Window.Resources>
         <BoolToVisibilityConverter x:Key="BoolToVisibility"/>
@@ -78,59 +79,61 @@
 
         <TextBlock Grid.Row="0" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Center">Shortcuts</TextBlock>
 
-        <ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Auto">
-            <WrapPanel HorizontalAlignment="Center" Margin="2">
-                <ItemsControl ItemsSource="{Binding Controller.CommandGroups}" Background="Transparent">
-                    <ItemsControl.ItemTemplate>
-                        <DataTemplate DataType="{x:Type commands:CommandGroup}">
-                            <StackPanel Visibility="{Binding HasAssignedShortcuts, Converter={StaticResource BoolToVisibility}}">
-                                <TextBlock Text="{Binding DisplayName}" Foreground="White" FontSize="15" FontWeight="Medium" Margin="10,8,0,5"/>
-                                <ItemsControl ItemsSource="{Binding VisibleCommands}">
-                                    <ItemsControl.ItemTemplate>
-                                        <DataTemplate DataType="{x:Type commands:Command}">
-                                            <StackPanel Orientation="Horizontal" Margin="20,0,0,0" Visibility="{Binding Shortcut.Key, ConverterParameter=None, Converter={converters:EqualityBoolToVisibilityConverter Invert=True}}"
-                                                        ToolTip="{Binding Description}">
-                                                <ItemsControl ItemsSource="{Binding Shortcut.Modifiers, Converter={converters:ModifierFlagToModifiersConverter}}">
-                                                    <ItemsControl.ItemTemplate>
-                                                        <DataTemplate DataType="{x:Type ModifierKeys}">
-                                                            <Border Style="{StaticResource KeyBorder}">
-                                                                <TextBlock Text="{Binding BindsDirectlyToSource=True, Converter={converters:KeyToStringConverter}}" Style="{StaticResource KeyBorderText}"/>
-                                                            </Border>
-                                                        </DataTemplate>
-                                                    </ItemsControl.ItemTemplate>
-                                                    <ItemsControl.ItemsPanel>
-                                                        <ItemsPanelTemplate>
-                                                            <StackPanel Orientation="Horizontal"/>
-                                                        </ItemsPanelTemplate>
-                                                    </ItemsControl.ItemsPanel>
-                                                </ItemsControl>
-                                                <Border Style="{StaticResource KeyBorderLast}">
-                                                    <TextBlock Text="{Binding Shortcut.Key, Converter={converters:KeyToStringConverter}}" Style="{StaticResource KeyBorderText}"/>
-                                                </Border>
+        <DockPanel Grid.Row="3">
+            <TextBlock FontSize="14" Margin="10" Foreground="LightGray" HorizontalAlignment="Left" DockPanel.Dock="Bottom">
+                <Hyperlink Style="{StaticResource SettingsLink}"
+                            Command="{cmds:Command PixiEditor.Window.OpenSettingsWindow, UseProvided=True}"
+                            CommandParameter="Keybinds">
+                    <Run Text="Edit"/>
+                    <Run Text="" FontFamily="{StaticResource Feather}"/>
+                </Hyperlink>
+            </TextBlock>
+            <ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Auto">
+                <WrapPanel HorizontalAlignment="Center" Margin="2">
+                    <ItemsControl ItemsSource="{Binding Controller.CommandGroups}" Background="Transparent">
+                        <ItemsControl.ItemTemplate>
+                            <DataTemplate DataType="{x:Type commands:CommandGroup}">
+                                <StackPanel Visibility="{Binding HasAssignedShortcuts, Converter={StaticResource BoolToVisibility}}">
+                                    <TextBlock Text="{Binding DisplayName}" Foreground="White" FontSize="15" FontWeight="Medium" Margin="10,8,0,5"/>
+                                    <ItemsControl ItemsSource="{Binding VisibleCommands}">
+                                        <ItemsControl.ItemTemplate>
+                                            <DataTemplate DataType="{x:Type commands:Command}">
+                                                <StackPanel Orientation="Horizontal" Margin="20,0,0,0" Visibility="{Binding Shortcut.Key, ConverterParameter=None, Converter={converters:EqualityBoolToVisibilityConverter Invert=True}}"
+                                                            ToolTip="{Binding Description}">
+                                                    <ItemsControl ItemsSource="{Binding Shortcut.Modifiers, Converter={converters:ModifierFlagToModifiersConverter}}">
+                                                        <ItemsControl.ItemTemplate>
+                                                            <DataTemplate DataType="{x:Type ModifierKeys}">
+                                                                <Border Style="{StaticResource KeyBorder}">
+                                                                    <TextBlock Text="{Binding BindsDirectlyToSource=True, Converter={converters:KeyToStringConverter}}" Style="{StaticResource KeyBorderText}"/>
+                                                                </Border>
+                                                            </DataTemplate>
+                                                        </ItemsControl.ItemTemplate>
+                                                        <ItemsControl.ItemsPanel>
+                                                            <ItemsPanelTemplate>
+                                                                <StackPanel Orientation="Horizontal"/>
+                                                            </ItemsPanelTemplate>
+                                                        </ItemsControl.ItemsPanel>
+                                                    </ItemsControl>
+                                                    <Border Style="{StaticResource KeyBorderLast}">
+                                                        <TextBlock Text="{Binding Shortcut.Key, Converter={converters:KeyToStringConverter}}" Style="{StaticResource KeyBorderText}"/>
+                                                    </Border>
 
-                                                <TextBlock Text="{Binding DisplayName}" Foreground="#FFEEEEEE" VerticalAlignment="Center" FontSize="14" Margin="8,0,0,0"/>
-                                            </StackPanel>
-                                        </DataTemplate>
-                                    </ItemsControl.ItemTemplate>
-                                </ItemsControl>
-                            </StackPanel>
-                        </DataTemplate>
-                    </ItemsControl.ItemTemplate>
-                    <ItemsControl.ItemsPanel>
-                        <ItemsPanelTemplate>
-                            <WrapPanel ItemWidth="300"/>
-                        </ItemsPanelTemplate>
-                    </ItemsControl.ItemsPanel>
-                </ItemsControl>
-                <TextBlock FontSize="14" Margin="5" Foreground="LightGray" HorizontalAlignment="Left">
-                    <Hyperlink Style="{StaticResource SettingsLink}"
-                               Command="{cmds:Command PixiEditor.Window.OpenSettingsWindow, UseProvided=True}"
-                               CommandParameter="Keybinds">
-                        <Run Text="Edit"/>
-                        <Run Text="" FontFamily="Feather"/>
-                    </Hyperlink>
-                </TextBlock>
-            </WrapPanel>
-        </ScrollViewer>
+                                                    <TextBlock Text="{Binding DisplayName}" Foreground="#FFEEEEEE" VerticalAlignment="Center" FontSize="14" Margin="8,0,0,0"/>
+                                                </StackPanel>
+                                            </DataTemplate>
+                                        </ItemsControl.ItemTemplate>
+                                    </ItemsControl>
+                                </StackPanel>
+                            </DataTemplate>
+                        </ItemsControl.ItemTemplate>
+                        <ItemsControl.ItemsPanel>
+                            <ItemsPanelTemplate>
+                                <WrapPanel ItemWidth="300"/>
+                            </ItemsPanelTemplate>
+                        </ItemsControl.ItemsPanel>
+                    </ItemsControl>
+                </WrapPanel>
+            </ScrollViewer>
+        </DockPanel>
     </Grid>
 </Window>