mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-29 08:04:59 +00:00
feature<WorkingCopy>: add grid layout for unstaged and staged files mode
This commit is contained in:
parent
ab98191875
commit
8a6d970498
8 changed files with 278 additions and 30 deletions
49
src/UI/FilesDisplayModeSwitch.xaml
Normal file
49
src/UI/FilesDisplayModeSwitch.xaml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<UserControl x:Class="SourceGit.UI.FilesDisplayModeSwitch"
|
||||
x:Name="me"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:converters="clr-namespace:SourceGit.Converters"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<converters:FilesDisplayModeToIcon x:Key="FilesDisplayModeToIcon"/>
|
||||
<Style x:Key="Style.Icon.DisplayMode" TargetType="{x:Type Path}" BasedOn="{StaticResource Style.Icon}">
|
||||
<Setter Property="Fill" Value="Transparent"/>
|
||||
<Setter Property="Stroke" Value="{StaticResource Brush.FG}"/>
|
||||
<Setter Property="StrokeThickness" Value=".4"/>
|
||||
<Setter Property="Width" Value="12"/>
|
||||
<Setter Property="Height" Value="12"/>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
|
||||
<Button Click="OpenModeSelector" ToolTip="CHANGE FILES DISPLAY MODE" Margin="4,0">
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu x:Name="selector" Placement="Bottom" StaysOpen="False" Focusable="True">
|
||||
<MenuItem Header="Show As Grid" Click="UseGrid">
|
||||
<MenuItem.Icon>
|
||||
<Path Style="{StaticResource Style.Icon.DisplayMode}" Data="{StaticResource Icon.Grid}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem Header="Show As List" Click="UseList">
|
||||
<MenuItem.Icon>
|
||||
<Path Style="{StaticResource Style.Icon.DisplayMode}" Data="{StaticResource Icon.List}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem Header="Show As Tree" Click="UseTree">
|
||||
<MenuItem.Icon>
|
||||
<Path Style="{StaticResource Style.Icon.DisplayMode}" Data="{StaticResource Icon.Tree}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
|
||||
<Path
|
||||
Style="{StaticResource Style.Icon.DisplayMode}"
|
||||
Data="{Binding ElementName=me, Path=Mode, Converter={StaticResource FilesDisplayModeToIcon}}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</UserControl>
|
Loading…
Add table
Add a link
Reference in a new issue