Browse Source

Fixed window extending too much while maximized

Krzysztof Krysiński 1 year ago
parent
commit
c7ba2cfd0b

+ 1 - 1
src/PixiEditor.AvaloniaUI.Desktop/PixiEditor.AvaloniaUI.Desktop.csproj

@@ -25,6 +25,6 @@
     </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.2.0" />
+    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
   </ItemGroup>
 </Project>

+ 4 - 7
src/PixiEditor.AvaloniaUI/PixiEditor.AvaloniaUI.csproj

@@ -32,10 +32,11 @@
         <PackageReference Include="CLSEncoderDecoder" Version="1.0.0" />
         <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
         <PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />
-        <PackageReference Include="Dock.Avalonia" Version="11.0.0.3" />
-        <PackageReference Include="Dock.Model.Avalonia" Version="11.0.0.3" />
+        <PackageReference Include="Dock.Avalonia" Version="11.0.0.5" />
+        <PackageReference Include="Dock.Model.Avalonia" Version="11.0.0.5" />
         <PackageReference Include="Hardware.Info" Version="11.0.0" />
-        <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.2.0" />
+        <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.8.0" />
+        <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
         <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
         <PackageReference Include="PixiEditor.ColorPicker.Models" Version="1.0.5" />
         <PackageReference Include="PixiEditor.Parser" Version="3.3.0" />
@@ -62,10 +63,6 @@
       <ProjectReference Include="..\PixiEditorGen\PixiEditorGen.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
     </ItemGroup>
   
-    <ItemGroup>
-      <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.2.0" />
-    </ItemGroup>
-  
     <ItemGroup>
       <AvaloniaResource Include="Images\**" />
       <AvaloniaResource Include="Fonts\**" />

+ 5 - 15
src/PixiEditor.AvaloniaUI/Views/Windows/PalettesBrowser.axaml

@@ -1,4 +1,4 @@
-<Window
+<dialogs:PixiEditorPopup
     x:Class="PixiEditor.AvaloniaUI.Views.Windows.PalettesBrowser"
     x:ClassModifier="internal"
     xmlns="https://github.com/avaloniaui"
@@ -16,26 +16,16 @@
     xmlns:palettes1="clr-namespace:PixiEditor.AvaloniaUI.Views.Palettes"
     xmlns:indicators1="clr-namespace:PixiEditor.AvaloniaUI.Views.Indicators"
     mc:Ignorable="d"
-    WindowStartupLocation="CenterScreen"
     Height="600" Width="850"
     x:Name="palettesBrowser"
-    FlowDirection="{markupExtensions:Localization FlowDirection}"
-    ui:Translator.Key="PALETTE_BROWSER">
-    <!--<WindowChrome.WindowChrome>
-        <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"
-                      ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
-    </WindowChrome.WindowChrome>-->
-
+    Title="PALETTE_BROWSER">
     <Grid Background="{DynamicResource ThemeBackgroundBrush1}" Focusable="True" PointerPressed="Grid_MouseDown">
         <Grid.RowDefinitions>
-            <RowDefinition Height="35" />
             <RowDefinition Height="45"/>
             <RowDefinition Height="1*"/>
         </Grid.RowDefinitions>
 
-        <dialogs:DialogTitleBar TitleKey="PALETTE_BROWSER" CloseCommand="{x:Static viewModels:SystemCommands.CloseWindowCommand}"/>
-
-        <DockPanel Background="{DynamicResource ThemeBackgroundBrush}" Grid.Row="1">
+        <DockPanel Background="{DynamicResource ThemeBackgroundBrush}" Grid.Row="0">
             <StackPanel HorizontalAlignment="Left" Margin="10" Orientation="Horizontal" VerticalAlignment="Center">
                 <Label ui:Translator.Key="SORT_BY" VerticalAlignment="Center"/>
                 <ComboBox x:Name="sortingComboBox" VerticalAlignment="Center" SelectionChanged="SortingComboBox_SelectionChanged">
@@ -108,7 +98,7 @@
                 </Button>
             </StackPanel>
         </DockPanel>
-        <Grid Grid.Row="2" Margin="10">
+        <Grid Grid.Row="1" Margin="10">
             <TextBlock ui:Translator.Key="COULD_NOT_LOAD_PALETTE" Foreground="White" FontSize="20" HorizontalAlignment="Center"
                        VerticalAlignment="Center" IsVisible="{Binding !Visibility, ElementName=itemsControl}"/>
             <StackPanel Panel.ZIndex="10" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"
@@ -140,4 +130,4 @@
                 Height="50"/>
         </Grid>
     </Grid>
-</Window>
+</dialogs:PixiEditorPopup>

+ 1 - 1
src/PixiEditor.AvaloniaUI/Views/Windows/PalettesBrowser.axaml.cs

@@ -33,7 +33,7 @@ using ViewModelMain = PixiEditor.AvaloniaUI.ViewModels.ViewModelMain;
 
 namespace PixiEditor.AvaloniaUI.Views.Windows;
 
-internal partial class PalettesBrowser : Window, IPopupWindow
+internal partial class PalettesBrowser : PixiEditorPopup, IPopupWindow
 {
     public static string UniqueId => "PixiEditor.BrowserPalette";
     string IPopupWindow.UniqueId => UniqueId;

+ 3 - 0
src/PixiEditor.UI.Common/Controls/Window.axaml

@@ -34,5 +34,8 @@
                 </Panel>
             </ControlTemplate>
         </Setter>
+        <Style Selector="^Window[WindowState=Maximized] /template/ ContentPresenter#PART_ContentPresenter">
+            <Setter Property="Padding" Value="5"/>
+        </Style>
     </ControlTheme>
 </ResourceDictionary>