Skip to content

Commit

Permalink
UI: Upgrade Dock package
Browse files Browse the repository at this point in the history
Fixes issue that allowed floating dock windows when they were meant to be disabled (because they're not supported properly by the debugger)
  • Loading branch information
SourMesen committed Jun 1, 2024
1 parent 950c1d8 commit f5959be
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 27 deletions.
72 changes: 47 additions & 25 deletions UI/Styles/DockStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
Padding="{TemplateBinding Padding}"
Grid.Row="1" />
<Border x:Name="PART_Border"
BorderBrush="{TemplateBinding BorderBrush}"
VerticalAlignment="Top"
Grid.Row="{Binding GripMode, Converter={x:Static converters:GripModeConverters.GridRowAutoHideConverter}}">
BorderBrush="{TemplateBinding BorderBrush}"
VerticalAlignment="Top"
ContextFlyout="{DynamicResource ToolChromeControlContextMenu}"
Grid.Row="{Binding GripMode, Converter={x:Static converters:GripModeConverters.GridRowAutoHideConverter}}">
<Grid x:Name="PART_Grip">
<DockPanel LastChildFill="True" Margin="8 0">
<Panel DockPanel.Dock="Left">
Expand All @@ -69,33 +70,54 @@
</ContentControl>
</WrapPanel>
</Panel>
<Button x:Name="PART_CloseButton"
Command="{Binding Owner.Factory.CloseDockable}"
CommandParameter="{Binding ActiveDockable}"
IsVisible="{Binding ActiveDockable.CanClose, FallbackValue=False}"
DockPanel.Dock="Right">
<Viewbox>
<Path x:Name="PART_ClosePath" />
</Viewbox>
</Button>
<Button x:Name="PART_PinButton"
Command="{Binding Owner.Factory.PinDockable}"
CommandParameter="{Binding ActiveDockable}"
IsVisible="{Binding ActiveDockable.CanPin, FallbackValue=False}"
DockPanel.Dock="Right">
<Viewbox>
<Path x:Name="PART_PinPath" />
</Viewbox>
</Button>
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal">
<Button x:Name="PART_MenuButton" IsVisible="False"
Theme="{StaticResource ChromeButton}"
Flyout="{StaticResource ToolChromeControlContextMenu}">
<Viewbox Margin="2">
<Path x:Name="PART_MenuPath" />
</Viewbox>
</Button>
<Button x:Name="PART_PinButton"
Command="{Binding Owner.Factory.PinDockable}"
CommandParameter="{Binding ActiveDockable}"
Theme="{StaticResource ChromeButton}">
<Button.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="ActiveDockable.CanPin" FallbackValue="{x:False}" />
<TemplateBinding Property="IsFloating" Converter="{x:Static BoolConverters.Not}" />
</MultiBinding>
</Button.IsVisible>
<Viewbox>
<Path x:Name="PART_PinPath" />
</Viewbox>
</Button>
<Button x:Name="PART_MaximizeRestoreButton"
IsVisible="{TemplateBinding IsFloating}"
Theme="{StaticResource ChromeButton}">
<Viewbox>
<Path x:Name="PART_MaximizeRestorePath" />
</Viewbox>
</Button>
<Button x:Name="PART_CloseButton"
Command="{Binding Owner.Factory.CloseDockable}"
CommandParameter="{Binding ActiveDockable}"
IsVisible="{Binding ActiveDockable.CanClose, FallbackValue=False}"
Theme="{StaticResource ChromeButton}">
<Viewbox>
<Path x:Name="PART_ClosePath" />
</Viewbox>
</Button>
</StackPanel>
<Grid x:Name="PART_Grid" />
</DockPanel>
</Grid>
</Border>
<Panel x:Name="PART_Panel"
Background="{TemplateBinding BorderBrush}"
Height="1"
VerticalAlignment="Top"
Grid.Row="{Binding GripMode, Converter={x:Static converters:GripModeConverters.GridRowAutoHideConverter}}" />
Background="{TemplateBinding BorderBrush}"
Height="1"
VerticalAlignment="Top"
Grid.Row="{Binding GripMode, Converter={x:Static converters:GripModeConverters.GridRowAutoHideConverter}}" />
</Grid>
</ControlTemplate>
</Setter>
Expand Down
4 changes: 2 additions & 2 deletions UI/UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
<PackageReference Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0045373-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0045373-beta" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.999-cibuild0045373-beta" />
<PackageReference Include="Dock.Avalonia" Version="11.0.0.5" />
<PackageReference Include="Dock.Model.Mvvm" Version="11.0.0.5" />
<PackageReference Include="Dock.Avalonia" Version="11.0.0.7" />
<PackageReference Include="Dock.Model.Mvvm" Version="11.0.0.7" />
<PackageReference Include="Dotnet.Bundle" Version="*" />
<PackageReference Include="ELFSharp" Version="2.17.3" />
<PackageReference Include="Microsoft.Win32.Registry" Version="6.0.0-preview.5.21301.5" />
Expand Down

0 comments on commit f5959be

Please sign in to comment.