Sechs Markdown-Sheets (git, Conventional Commits, Claude CLI, Claude-Config, dotnet CLI, PowerShell) als EmbeddedResource, gerendert im modelosen, per Topmost anpinnbaren CheatSheetsWindow. MarkdownView bekommt dafuer das Opt-in CommandRows: `befehl` - beschreibung wird zu Mono-Chip + Copy-Button, jede ##-Sektion landet in einem Expander. Enthaelt ausserdem: Mission Control wird beim Oeffnen aus dem Minimiert-Zustand geholt, nicht nur aktiviert.
46 lines
2.1 KiB
XML
46 lines
2.1 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Modals"
|
|
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
|
|
xmlns:loc="using:ClaudeDo.Ui.Localization"
|
|
x:Class="ClaudeDo.Ui.Views.Modals.CheatSheetsWindow"
|
|
x:DataType="vm:CheatSheetsViewModel"
|
|
Title="{loc:Tr modals.cheatSheets.windowTitle}"
|
|
Width="480" Height="820" MinWidth="320" MinHeight="300"
|
|
CanResize="True"
|
|
Topmost="{Binding IsPinned}"
|
|
WindowDecorations="BorderOnly"
|
|
ExtendClientAreaToDecorationsHint="True"
|
|
ExtendClientAreaTitleBarHeightHint="-1"
|
|
WindowStartupLocation="CenterOwner"
|
|
Background="{DynamicResource SurfaceBrush}">
|
|
|
|
<Window.KeyBindings>
|
|
<KeyBinding Gesture="Escape" Command="{Binding CloseCommand}"/>
|
|
</Window.KeyBindings>
|
|
|
|
<ctl:ModalShell Title="{loc:Tr modals.cheatSheets.title}" CloseCommand="{Binding CloseCommand}">
|
|
<DockPanel>
|
|
<!-- Sheet picker + pin. Pin keeps the window above the shell while it sits at a screen edge. -->
|
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Spacing="8" Margin="16,10,16,0">
|
|
<ComboBox ItemsSource="{Binding Sheets}"
|
|
SelectedItem="{Binding SelectedSheet}"
|
|
DisplayMemberBinding="{Binding Title}"
|
|
MinWidth="180"
|
|
VerticalAlignment="Center"/>
|
|
<ToggleButton Content="{loc:Tr modals.cheatSheets.pin}"
|
|
IsChecked="{Binding IsPinned}"
|
|
VerticalAlignment="Center"
|
|
ToolTip.Tip="{loc:Tr modals.cheatSheets.pinTooltip}"/>
|
|
</StackPanel>
|
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="Disabled">
|
|
<!-- Inset on the content, not the ScrollViewer: Avalonia 12 leaves ScrollViewer.Padding
|
|
out of the Extent, which clips the last lines at max scroll. -->
|
|
<ctl:MarkdownView Markdown="{Binding SelectedSheet.Body}" CommandRows="True"
|
|
Margin="16,12,16,16"/>
|
|
</ScrollViewer>
|
|
</DockPanel>
|
|
</ctl:ModalShell>
|
|
</Window>
|