The diff viewer used ShowDialog at both call sites (task details, worktrees overview), blocking navigation of the rest of the app while open. Switch both to Window.Show(owner) and reuse the one open window (swap DataContext, Activate()) instead of stacking a second one on re-open. Add an opt-in maximize/restore button + double-click-titlebar toggle to ModalShell (ShowMaximizeButton, default false so other modals are untouched), wired on for DiffViewerView only. Reuses the existing Icon.WinMax/WinRestore geometry and OffScreenMargin inset from MainWindow's own maximize handling. The review gate (Approve & Merge locked until the diff is opened) already fires DiffViewed before the dialog/window is shown, so it is unaffected by the modal-to-non-modal change.
49 lines
2.5 KiB
XML
49 lines
2.5 KiB
XML
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls">
|
|
<ControlTheme x:Key="{x:Type ctl:ModalShell}" TargetType="ctl:ModalShell">
|
|
<Setter Property="Template">
|
|
<ControlTemplate>
|
|
<Border Background="{DynamicResource SurfaceBrush}"
|
|
BorderBrush="{DynamicResource LineBrush}"
|
|
BorderThickness="1"
|
|
CornerRadius="{DynamicResource ModalCornerRadius}"
|
|
ClipToBounds="True">
|
|
<DockPanel>
|
|
<Border Name="PART_TitleBar" DockPanel.Dock="Top" Height="36"
|
|
Background="{DynamicResource DeepBrush}"
|
|
BorderBrush="{DynamicResource LineBrush}"
|
|
BorderThickness="0,0,0,1">
|
|
<Grid ColumnDefinitions="*,Auto,Auto" Margin="14,0">
|
|
<TextBlock Text="{TemplateBinding Title}"
|
|
FontFamily="{DynamicResource MonoFont}"
|
|
FontSize="{DynamicResource FontSizeMono}"
|
|
LetterSpacing="1.4"
|
|
Foreground="{DynamicResource TextBrush}"
|
|
VerticalAlignment="Center"/>
|
|
<Button Name="PART_MaxButton" Grid.Column="1" Classes="icon-btn"
|
|
IsVisible="{TemplateBinding ShowMaximizeButton}"
|
|
VerticalAlignment="Center">
|
|
<PathIcon Name="PART_MaxIcon" Data="{StaticResource Icon.WinMax}" Width="10" Height="10"/>
|
|
</Button>
|
|
<Button Grid.Column="2" Classes="icon-btn" Content="✕"
|
|
FontSize="{DynamicResource FontSizeBody}"
|
|
Command="{TemplateBinding CloseCommand}"
|
|
VerticalAlignment="Center"/>
|
|
</Grid>
|
|
</Border>
|
|
<Border Name="PART_Footer" DockPanel.Dock="Bottom"
|
|
Background="{DynamicResource DeepBrush}"
|
|
BorderBrush="{DynamicResource LineBrush}"
|
|
BorderThickness="0,1,0,0"
|
|
IsVisible="{TemplateBinding Footer, Converter={x:Static ObjectConverters.IsNotNull}}">
|
|
<ContentPresenter Content="{TemplateBinding Footer}" Margin="16,8"/>
|
|
</Border>
|
|
<ContentPresenter Content="{TemplateBinding Content}"/>
|
|
</DockPanel>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
</ControlTheme>
|
|
</ResourceDictionary>
|