mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-21 10:25:00 +00:00
Tried to unify looks of file viewer and history file content
This commit is contained in:
parent
eebadd67a1
commit
714aad2e10
7 changed files with 68 additions and 42 deletions
30
src/Views/FileContentViewer.axaml
Normal file
30
src/Views/FileContentViewer.axaml
Normal file
|
@ -0,0 +1,30 @@
|
|||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:m="using:SourceGit.Models"
|
||||
xmlns:v="using:SourceGit.Views"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="SourceGit.Views.FileContentViewer"
|
||||
x:DataType="vm:FileContent">
|
||||
<Border BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
||||
<Grid RowDefinitions="26,*">
|
||||
<Border Grid.Row="0"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border2}"
|
||||
Background="{DynamicResource Brush.Window}">
|
||||
<Grid ColumnDefinitions="Auto,*">
|
||||
<Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.File}" Margin="8,0,0,0"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Classes="primary"
|
||||
Margin="4,0,0,0"
|
||||
Text="{Binding Path}"
|
||||
FontSize="11"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<v:RevisionFileContentViewer Grid.Row="1" Content="{Binding Content}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
12
src/Views/FileContentViewer.axaml.cs
Normal file
12
src/Views/FileContentViewer.axaml.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using Avalonia.Controls;
|
||||
|
||||
namespace SourceGit.Views
|
||||
{
|
||||
public partial class FileContentViewer : UserControl
|
||||
{
|
||||
public FileContentViewer()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -133,26 +133,8 @@
|
|||
<v:DiffView/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="vm:FileHistoriesRevisionFile">
|
||||
<Border BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
||||
<Grid RowDefinitions="26,*">
|
||||
<Border Grid.Row="0"
|
||||
BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Brush.Border2}"
|
||||
Background="{DynamicResource Brush.Window}">
|
||||
<Grid ColumnDefinitions="Auto,*">
|
||||
<Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.File}" Margin="8,0,0,0"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Classes="primary"
|
||||
Margin="4,0,0,0"
|
||||
Text="{Binding Path}"
|
||||
FontSize="11"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<v:RevisionFileContentViewer Grid.Row="1" Content="{Binding Content}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DataTemplate DataType="vm:FileContent">
|
||||
<v:FileContentViewer />
|
||||
</DataTemplate>
|
||||
</ContentControl.DataTemplates>
|
||||
</ContentControl>
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
<!-- Right: File Content Viewer -->
|
||||
<Grid Grid.Column="2">
|
||||
<Border BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
||||
<v:RevisionFileContentViewer Content="{Binding ViewRevisionFileContent}"/>
|
||||
<v:FileContentViewer DataContext="{Binding ViewRevisionFileContent}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue