Browse Source

Notice dialog + dialog style

flabbet 3 năm trước cách đây
mục cha
commit
8eb2d7ad0e

+ 2 - 0
PixiEditor/Models/ExternalServices/LospecPaletteFetcher.cs

@@ -6,6 +6,7 @@ using System.Collections.Generic;
 using System.Net;
 using System.Net.Http;
 using System.Threading.Tasks;
+using PixiEditor.Models.Dialogs;
 
 namespace PixiEditor.Models.ExternalServices
 {
@@ -36,6 +37,7 @@ namespace PixiEditor.Models.ExternalServices
             }
             catch(HttpRequestException)
             {
+                NoticeDialog.Show("Failed to download palette.", "Error");
                 return null;
             }
 

+ 14 - 15
PixiEditor/Views/Dialogs/PalettesBrowser.xaml

@@ -6,7 +6,9 @@
              xmlns:local="clr-namespace:PixiEditor.Views.UserControls.Palettes" xmlns:converters="clr-namespace:PixiEditor.Helpers.Converters" 
              xmlns:gif="http://wpfanimatedgif.codeplex.com" xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls" xmlns:views="clr-namespace:PixiEditor.Views"
              xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
-             xmlns:PixiEditor="clr-namespace:PixiEditor" x:Class="PixiEditor.Views.Dialogs.PalettesBrowser"
+             xmlns:PixiEditor="clr-namespace:PixiEditor"
+             xmlns:dialogs="clr-namespace:PixiEditor.Views.Dialogs"
+             x:Class="PixiEditor.Views.Dialogs.PalettesBrowser"
              mc:Ignorable="d"
              Title="Palettes Browser" WindowStartupLocation="CenterScreen" MinWidth="200" Height="600" Width="850" WindowStyle="None"
              x:Name="palettesBrowser">
@@ -26,19 +28,16 @@
     <Grid Background="{StaticResource AccentColor}" FocusVisualStyle="{x:Null}" Focusable="True" MouseDown="Grid_MouseDown">
         <Grid.RowDefinitions>
             <RowDefinition Height="35" />
-            <RowDefinition Height="55"/>
+            <RowDefinition Height="45"/>
             <RowDefinition Height="1*"/>
         </Grid.RowDefinitions>
 
-        <DockPanel Grid.Row="0" Background="{StaticResource MainColor}">
-            <Button DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource CloseButtonStyle}"
-                    WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="Close"
-                    Command="{x:Static SystemCommands.CloseWindowCommand}" />
-        </DockPanel>
+        <dialogs:DialogTitleBar TitleText="Palette Browser" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+
         <DockPanel Background="{StaticResource MainColor}" Grid.Row="1">
             <StackPanel HorizontalAlignment="Left" Margin="10" Orientation="Horizontal" VerticalAlignment="Center">
-                <Label Content="Sort by:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center" FontSize="16"/>
-                <ComboBox x:Name="sortingComboBox" FontSize="16" VerticalAlignment="Center" SelectionChanged="SortingComboBox_SelectionChanged">
+                <Label Content="Sort by:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center"/>
+                <ComboBox x:Name="sortingComboBox" VerticalAlignment="Center" SelectionChanged="SortingComboBox_SelectionChanged">
                     <ComboBoxItem IsSelected="True" Content="Default"/>
                     <ComboBoxItem Content="Alphabetical"/>
                     <ComboBoxItem Content="Color Count"/>
@@ -67,23 +66,23 @@
                         </Image.Style>
                     </Image>
                 </ToggleButton>
-                <Label Margin="10 0 0 0" Content="Name:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center" FontSize="16"/>
-                <usercontrols:InputBox FontSize="16"
+                <Label Margin="10 0 0 0" Content="Name:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center"/>
+                <usercontrols:InputBox
                                        Text="{Binding NameFilter, Delay=100, ElementName=palettesBrowser, UpdateSourceTrigger=PropertyChanged}"
                                        VerticalAlignment="Center"
                                        Style="{StaticResource DarkTextBoxStyle}" Width="150" />
 
-                <Label Margin="10 0 0 0" Content="Colors:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center" FontSize="16"/>
-                <ComboBox x:Name="colorsComboBox" FontSize="16" VerticalAlignment="Center" SelectionChanged="ColorsComboBox_SelectionChanged">
+                <Label Margin="10 0 0 0" Content="Colors:" Style="{StaticResource BaseLabel}" VerticalAlignment="Center"/>
+                <ComboBox x:Name="colorsComboBox" VerticalAlignment="Center" SelectionChanged="ColorsComboBox_SelectionChanged">
                     <ComboBoxItem IsSelected="True" Content="Any"/>
                     <ComboBoxItem Content="Max"/>
                     <ComboBoxItem Content="Min"/>
                     <ComboBoxItem Content="Exact"/>
                 </ComboBox>
-                <views:NumberInput Width="50" FontSize="16" VerticalAlignment="Center" Margin="10 0 0 0"
+                <views:NumberInput Width="50" VerticalAlignment="Center" Margin="10 0 0 0"
                                    FocusNext="True"
                                    Value="{Binding ColorsNumber, ElementName=palettesBrowser, Mode=TwoWay}"/>
-                <CheckBox Margin="10 0 0 0" VerticalAlignment="Center" FontSize="16"
+                <CheckBox Margin="10 0 0 0" VerticalAlignment="Center"
                           IsChecked="{Binding ShowOnlyFavourites, ElementName=palettesBrowser}" Content="Favourites"/>
             </StackPanel>
             <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 10 0">

+ 3 - 3
PixiEditor/Views/MainWindow.xaml

@@ -359,8 +359,8 @@
 
                                 <LayoutAnchorablePane x:Name="colorPane">
                                     <LayoutAnchorable ContentId="colorPicker" Title="Color Picker" CanHide="False"
-                                                             CanClose="False" CanAutoHide="False" x:Name="colorPickerPanel"
-                                                             CanDockAsTabbedDocument="False" CanFloat="True">
+                                                      CanClose="False" CanAutoHide="False" x:Name="colorPickerPanel"
+                                                      CanDockAsTabbedDocument="False" CanFloat="True">
                                         <usercontrols:SmallColorPicker SelectedColor="{Binding ColorsSubViewModel.PrimaryColor, Mode=TwoWay, Converter={StaticResource SKColorToMediaColorConverter}}"
                                                                          SecondaryColor="{Binding ColorsSubViewModel.SecondaryColor, Mode=TwoWay, Converter={StaticResource SKColorToMediaColorConverter}}" 
                                                                          Style="{StaticResource DefaultColorPickerStyle}" x:Name="mainColorPicker">
@@ -380,7 +380,7 @@
                                         </colorpicker:ColorSliders>
                                     </LayoutAnchorable>
                                     <avalondock:LayoutAnchorable ContentId="palette" Title="Palette" CanHide="False"
-                                                                 CanClose="False" CanAutoHide="False"
+                                                                 CanClose="False" CanAutoHide="False" x:Name="paletteAnchorable"
                                                                  CanDockAsTabbedDocument="False" CanFloat="True">
                                         <Grid>
                                             <palettes:CompactPaletteViewer IsEnabled="{Binding DocumentSubViewModel.Owner.BitmapManager.ActiveDocument,

+ 3 - 0
PixiEditor/Views/MainWindow.xaml.cs

@@ -11,9 +11,12 @@ using System.ComponentModel;
 using System.Diagnostics;
 using System.Linq;
 using System.Windows;
+using System.Windows.Controls;
 using System.Windows.Input;
 using System.Windows.Interop;
+using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using AvalonDock.Layout;
 
 namespace PixiEditor
 {