Skip to content
Browse files

Improved application UI.

  • Loading branch information...
1 parent f270f59 commit 9ee5d0d72f12354d2b1e7b63849508f75201c3a1 @kaisellgren committed Apr 22, 2012
View
1 App.xaml
@@ -16,6 +16,7 @@
<ResourceDictionary Source="Styles/NewTabButton.xaml"/>
<ResourceDictionary Source="Styles/Panel.xaml"/>
<ResourceDictionary Source="Styles/GridSplitter.xaml"/>
+ <ResourceDictionary Source="Styles/DisplayTags.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
View
8 DesignData/SampleApplication.xaml
@@ -1,8 +1,12 @@
-<local:MainWindowViewModel xmlns:local="clr-namespace:GG">
+<local:MainWindowViewModel xmlns:local="clr-namespace:GG" xmlns:sys="clr-namespace:System;assembly=mscorlib">
<local:MainWindowViewModel.RepositoryViewModels>
<local:RepositoryViewModel Name="Sample" FullPath="Z:/www/git1">
<local:RepositoryViewModel.Commits>
- <local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" FormattedDate="One minute ago" Description="Foo" Hash="123" Source="asdasd" />
+ <local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" FormattedDate="One minute ago" Description="Foo" Hash="123" Source="asdasd">
+ <local:Commit.DisplayTags>
+ <sys:String>master</sys:String>
+ </local:Commit.DisplayTags>
+ </local:Commit>
<local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" FormattedDate="5 minutes ago" Description="Foo 2" Hash="456" Source="asdasd" />
<local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" FormattedDate="6 hours ago" Description="Foo 3 " Hash="789" Source="asdasd" />
</local:RepositoryViewModel.Commits>
View
9 Git-GUI.csproj
@@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GG</RootNamespace>
<AssemblyName>Git-GUI</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
@@ -130,6 +131,10 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
+ <Page Include="Styles\DisplayTags.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Styles\GridSplitter.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
View
2 MainWindow.xaml
@@ -5,7 +5,7 @@
xmlns:local="clr-namespace:GG"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
- Title="Git-GUI" Icon="Resources/Icons/Git-GUI.png" WindowState="Normal" Style="{StaticResource WindowGlassStyle}" Loaded="OnLoad">
+ Title="Git-GUI" Icon="Resources/Icons/Git-GUI.png" WindowState="Normal" Style="{StaticResource WindowGlassStyle}" Loaded="OnLoad" d:DesignWidth="1027" d:DesignHeight="549">
<DockPanel Margin="0,-24,0,0" d:DataContext="{d:DesignData Source=./DesignData/SampleApplication.xaml}">
<TabControl x:Name="RepositoryTabs"
View
108 Models/Commit.cs
@@ -9,19 +9,115 @@ namespace GG
{
public class Commit
{
- public string AuthorEmail { set; get; }
- public string AuthorName { set; get; }
- public DateTime Date { set; get; }
- public string Description { set; get; }
- public string Hash { set; get; }
- public string Source { set; get; }
+ public string AuthorEmail { set; get; }
+ public string AuthorName { set; get; }
+ public DateTime Date { set; get; }
+ public string Description { set; get; }
+ public List<String> DisplayTags { get; set; }
+ public string Hash { set; get; }
+ public string Source { get; set; }
+ /// <summary>
+ /// Returns the date of this changeset in relative format.
+ /// </summary>
public string FormattedDate
{
get
{
return DateUtil.GetRelativeDate(Date);
}
}
+
+ /// <summary>
+ /// Returns a 7 character wide hash string.
+ /// </summary>
+ public string HashShort
+ {
+ get
+ {
+ return Hash.Substring(0, 7);
+ }
+ }
+
+ /// <summary>
+ /// Returns the author in format "name &lt;email&gt;".
+ /// </summary>
+ public string Author
+ {
+ get
+ {
+ return AuthorName + " <" + AuthorEmail + ">";
+ }
+ }
+
+ /// <summary>
+ /// Creates a new commit object from the given parameters.
+ /// </summary>
+ /// <param name="repo"></param>
+ /// <param name="commit"></param>
+ /// <returns></returns>
+ public static Commit Create(LibGit2Sharp.Repository repo, LibGit2Sharp.Commit commit)
+ {
+ // Fetch branches.
+ IEnumerable<LibGit2Sharp.Branch> branches = ListBranchesContaininingCommit(repo, commit.Sha);
+
+ // Process DisplayTags (tags to display next to the commit description).
+ List<String> tags = new List<String>();
+ foreach (LibGit2Sharp.Branch branch in branches)
+ {
+ tags.Add(branch.Name);
+ }
+
+ // Create new commit model.
+ Commit c = new Commit();
+
+ c.AuthorEmail = commit.Author.Email;
+ c.AuthorName = commit.Author.Name;
+ c.Date = commit.Author.When.DateTime;
+ c.Description = commit.MessageShort;
+ c.Hash = commit.Sha;
+ c.Source = branches.ElementAt(0).ToString();
+ c.DisplayTags = tags;
+
+ return c;
+ }
+
+ /// <summary>
+ /// A helper method for listing branches that contain the given commit.
+ /// </summary>
+ /// <param name="repo"></param>
+ /// <param name="commitSha"></param>
+ /// <returns></returns>
+ private static IEnumerable<LibGit2Sharp.Branch> ListBranchesContaininingCommit(LibGit2Sharp.Repository repo, string commitSha)
+ {
+ bool directBranchHasBeenFound = false;
+ foreach (var branch in repo.Branches)
+ {
+ if (branch.Tip.Sha != commitSha)
+ {
+ continue;
+ }
+
+ directBranchHasBeenFound = true;
+ yield return branch;
+ }
+
+ if (directBranchHasBeenFound)
+ {
+ yield break;
+ }
+
+ foreach (var branch in repo.Branches)
+ {
+ var commits = repo.Commits.QueryBy(new LibGit2Sharp.Filter { Since = branch }).Where(c => c.Sha == commitSha);
+
+ if (commits.Count() == 0)
+ {
+ continue;
+ }
+
+ yield return branch;
+ }
+ }
}
}
View
2 Properties/Resources.Designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.17020
+// Runtime Version:4.0.30319.17379
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
View
2 Properties/Settings.Designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.17020
+// Runtime Version:4.0.30319.17379
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
View
166 Styles/DataGrid.xaml
@@ -4,73 +4,161 @@
<Setter Property="RowBackground" Value="#f9f9f9" />
<Setter Property="AlternatingRowBackground" Value="#f4f4f4" />
<Setter Property="GridLinesVisibility" Value="None" />
- <!--<Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />-->
</Style>
-
- <Style TargetType="{x:Type DataGridColumnHeader}">
- <Setter Property="Background">
+
+ <Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
+ <Setter Property="Width" Value="8" />
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Cursor" Value="SizeWE" />
+ <Setter Property="Template">
<Setter.Value>
- <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#fff" Offset="0"></GradientStop>
- <GradientStop Color="#EBEBEB" Offset="0.2"></GradientStop>
- <GradientStop Color="#CDCDCD" Offset="0.8"></GradientStop>
- <GradientStop Color="#EBEBEB" Offset="1"></GradientStop>
- </LinearGradientBrush>
+ <ControlTemplate TargetType="{x:Type Thumb}">
+ <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" />
+ </ControlTemplate>
</Setter.Value>
</Setter>
+ </Style>
+
+ <Style TargetType="DataGridColumnHeader">
<Setter Property="Height" Value="24" />
<Setter Property="Foreground" Value="#444"/>
- <Setter Property="BorderBrush" Value="#bbb" />
<Setter Property="Padding" Value="4" />
- <Setter Property="BorderThickness" Value="0,0,1,1" />
<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
- <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"></Setter>
+ <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
+ <Setter Property="HorizontalContentAlignment" Value="Left"/>
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
+ <Setter Property="IsTabStop" Value="False"/>
+ <Setter Property="SeparatorBrush" Value="#bbb"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="DataGridColumnHeader">
+ <Grid x:Name="Root">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+
+ <VisualStateManager.VisualStateGroups>
+ <VisualStateGroup x:Name="CommonStates">
+ <VisualState x:Name="Normal">
+ <Storyboard>
+ <ColorAnimation Duration="0:0:0.3" To="#fff" Storyboard.TargetProperty="(Fill).Color" Storyboard.TargetName="BackgroundRectangle"/>
+ <ColorAnimation Duration="0:0:0.3" To="#EBEBEB" Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color" Storyboard.TargetName="BackgroundGradient"/>
+ <ColorAnimation Duration="0:0:0.3" To="#CDCDCD" Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color" Storyboard.TargetName="BackgroundGradient"/>
+ <ColorAnimation Duration="0:0:0.3" To="#EBEBEB" Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color" Storyboard.TargetName="BackgroundGradient"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="MouseOver">
+ <Storyboard>
+ <ColorAnimation Duration="0:0:0.3" To="#fff" Storyboard.TargetProperty="(Fill).Color" Storyboard.TargetName="BackgroundRectangle"/>
+ <ColorAnimation Duration="0:0:0.3" To="#D0E0EB" Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color" Storyboard.TargetName="BackgroundGradient"/>
+ <ColorAnimation Duration="0:0:0.3" To="#9AB1C1" Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color" Storyboard.TargetName="BackgroundGradient"/>
+ <ColorAnimation Duration="0:0:0.3" To="#E8F3FF" Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color" Storyboard.TargetName="BackgroundGradient"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="Pressed">
+ <Storyboard>
+ <ColorAnimation Duration="0:0:0.15" To="#E8F3FF" Storyboard.TargetProperty="(Fill).Color" Storyboard.TargetName="BackgroundRectangle"/>
+ <ColorAnimation Duration="0:0:0.15" To="#9AB1C1" Storyboard.TargetProperty="(Fill).(GradientStops)[1].Color" Storyboard.TargetName="BackgroundGradient"/>
+ <ColorAnimation Duration="0:0:0.15" To="#D0E0EB" Storyboard.TargetProperty="(Fill).(GradientStops)[2].Color" Storyboard.TargetName="BackgroundGradient"/>
+ <ColorAnimation Duration="0:0:0.15" To="#fff" Storyboard.TargetProperty="(Fill).(GradientStops)[3].Color" Storyboard.TargetName="BackgroundGradient"/>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ <VisualStateGroup x:Name="SortStates">
+ <VisualState x:Name="Unsorted"/>
+ <VisualState x:Name="SortAscending">
+ <Storyboard>
+ <DoubleAnimation Duration="0:0:0.3" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon"/>
+ <DoubleAnimation Duration="0:0:0.3" To="1" Storyboard.TargetProperty="(RenderTransform).ScaleY" Storyboard.TargetName="SortIcon"/>
+ </Storyboard>
+ </VisualState>
+ <VisualState x:Name="SortDescending">
+ <Storyboard>
+ <DoubleAnimation Duration="0:0:0.3" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon"/>
+ <DoubleAnimation Duration="0:0:0.3" To="-.9" Storyboard.TargetProperty="(RenderTransform).ScaleY" Storyboard.TargetName="SortIcon"/>
+ </Storyboard>
+ </VisualState>
+ </VisualStateGroup>
+ </VisualStateManager.VisualStateGroups>
+
+ <Rectangle x:Name="BackgroundRectangle" Grid.ColumnSpan="2" Grid.RowSpan="2" Fill="red" Stretch="Fill"/>
+ <Rectangle x:Name="BackgroundGradient" Grid.ColumnSpan="2" Grid.RowSpan="2" Stretch="Fill">
+ <Rectangle.Fill>
+ <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+ <GradientStop Color="#fff" Offset="0"></GradientStop>
+ <GradientStop Color="#EBEBEB" Offset="0.2"></GradientStop>
+ <GradientStop Color="#CDCDCD" Offset="0.8"></GradientStop>
+ <GradientStop Color="#EBEBEB" Offset="1"></GradientStop>
+ </LinearGradientBrush>
+ </Rectangle.Fill>
+ </Rectangle>
+
+ <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <ContentPresenter Content="{TemplateBinding Content}"/>
+ <Path x:Name="SortIcon" Grid.Column="2" Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z " Fill="#FF444444" HorizontalAlignment="Left" Margin="4,0,0,0" Opacity="0" RenderTransformOrigin=".5,.5" Stretch="Uniform" VerticalAlignment="Center" Width="8">
+ <Path.RenderTransform>
+ <ScaleTransform ScaleY=".9" ScaleX=".9"/>
+ </Path.RenderTransform>
+ </Path>
+ </Grid>
+
+ <Rectangle x:Name="VerticalSeparator" Grid.Column="1" Fill="{TemplateBinding SeparatorBrush}" Visibility="{TemplateBinding SeparatorVisibility}" VerticalAlignment="Stretch" Width="1"/>
+ <Rectangle x:Name="HorizontalSeparator" Grid.Row="1" Fill="{TemplateBinding SeparatorBrush}" Visibility="{TemplateBinding SeparatorVisibility}" HorizontalAlignment="Stretch" Height="1"/>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
</Style>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Padding" Value="2" />
<Setter Property="BorderThickness" Value="0,0,1,1" />
- <!--<Setter Property="KeyboardNavigation.IsTabStop" Value="False" />-->
<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
- <Border Padding="{TemplateBinding Padding}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
- <ContentPresenter x:Name="CellContent" SnapsToDevicePixels="True" RenderOptions.ClearTypeHint="Enabled" />
+ <Border x:Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}" SnapsToDevicePixels="True">
+ <Border Padding="{TemplateBinding Padding}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
+ <ContentPresenter x:Name="CellContent" SnapsToDevicePixels="True" RenderOptions.ClearTypeHint="Enabled" TextOptions.TextFormattingMode="Display" VerticalAlignment="Center" />
+ </Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
- <Setter TargetName="CellContent" Property="TextOptions.TextFormattingMode" Value="Display" />
- <Setter TargetName="CellContent" Property="RenderOptions.ClearTypeHint" Value="Enabled" />
- <!--<Setter TargetName="CellContent" Property="Effect">
+ <Setter Property="BorderThickness" Value="0,1,0,0" TargetName="OuterBorder" />
+ <Setter Property="BorderBrush" Value="#7ea3be" />
+ <Setter Property="BorderBrush" Value="#7ea3be" TargetName="OuterBorder" />
+ <Setter Property="Foreground" Value="#000" />
+ <Setter Property="Background">
<Setter.Value>
- <DropShadowEffect ShadowDepth="2" BlurRadius="2" Color="Black" RenderingBias="Quality" />
+ <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
+ <GradientStop Color="#d6e5ef" Offset="0" />
+ <GradientStop Color="#b2cadb" Offset="0.1" />
+ <GradientStop Color="#aac2d3" Offset="0.8" />
+ <GradientStop Color="#9ab3c6" Offset="0.9" />
+ <GradientStop Color="#c2d4e0" Offset="1" />
+ </LinearGradientBrush>
</Setter.Value>
- </Setter>-->
+ </Setter>
+ </Trigger>
+ <Trigger Property="IsSelected" Value="False">
+ <Setter Property="BorderBrush" Value="Transparent" TargetName="OuterBorder" />
+ <Setter Property="BorderThickness" Value="0,1,0,0" TargetName="OuterBorder" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
- <Style.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="BorderBrush" Value="#7ea3be" />
- <Setter Property="BorderThickness" Value="0,1,1,1" />
- <Setter Property="Foreground" Value="#000" />
- <Setter Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
- <GradientStop Color="#d6e5ef" Offset="0" />
- <GradientStop Color="#b2cadb" Offset="0.1" />
- <GradientStop Color="#aac2d3" Offset="0.8" />
- <GradientStop Color="#9ab3c6" Offset="0.9" />
- <GradientStop Color="#c2d4e0" Offset="1" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger>
- </Style.Triggers>
</Style>
</ResourceDictionary>
View
54 Styles/DisplayTags.xaml
@@ -0,0 +1,54 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+ <Style TargetType="ListBox" x:Key="DisplayTags">
+ <Setter Property="SnapsToDevicePixels" Value="true" />
+ <Setter Property="OverridesDefaultStyle" Value="true" />
+ <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
+ <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
+ <Setter Property="ScrollViewer.CanContentScroll" Value="False" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="ListBox">
+ <ScrollViewer HorizontalScrollBarVisibility="Hidden">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" IsItemsHost="True" />
+ </ScrollViewer>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+
+ <Style.Resources>
+ <Style TargetType="ListBoxItem">
+ <Setter Property="SnapsToDevicePixels" Value="true" />
+ <Setter Property="OverridesDefaultStyle" Value="true" />
+ <Setter Property="Foreground" Value="#fff" />
+ <Setter Property="FontSize" Value="11" />
+ <Setter Property="Margin" Value="0,0,4,0" />
+ <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
+ <Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
+ <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
+ <Setter Property="RenderOptions.BitmapScalingMode" Value="NearestNeighbor" />
+ <Setter Property="UseLayoutRounding" Value="True" />
+ <Setter Property="SnapsToDevicePixels" Value="True" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="ListBoxItem">
+ <Border Padding="3" SnapsToDevicePixels="true" CornerRadius="4" BorderThickness="1" BorderBrush="#444" UseLayoutRounding="True">
+ <Border.Background>
+ <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
+ <GradientStop Offset="0" Color="#FFC9A6" />
+ <GradientStop Offset="0.15" Color="#EA6C23" />
+ <GradientStop Offset="0.9" Color="#D66B24" />
+ <GradientStop Offset="1" Color="#A95016" />
+ </LinearGradientBrush>
+ </Border.Background>
+ <ContentPresenter />
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ </Style.Resources>
+ </Style>
+
+</ResourceDictionary>
View
8 Styles/Panel.xaml
@@ -23,9 +23,15 @@
<Setter Property="Foreground" Value="White" />
<Setter Property="Margin" Value="4,0,0,0" />
<Setter Property="VerticalAlignment" Value="Center" />
+ <Setter Property="RenderOptions.ClearTypeHint" Value="Enabled" />
+ <Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
+ <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
+ <Setter Property="RenderOptions.BitmapScalingMode" Value="NearestNeighbor" />
+ <Setter Property="UseLayoutRounding" Value="True" />
+ <Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Effect">
<Setter.Value>
- <DropShadowEffect ShadowDepth="2" BlurRadius="2" Color="Black" RenderingBias="Quality" />
+ <DropShadowEffect ShadowDepth="1" BlurRadius="2" Color="Black" Opacity="0.75" RenderingBias="Quality" />
</Setter.Value>
</Setter>
</Style>
View
10 Styles/TabItem.xaml
@@ -4,9 +4,9 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid>
- <Border Name="Border" BorderBrush="#666" BorderThickness="1,1,1,0" CornerRadius="8,8,0,0" Margin="0,0,0,-1">
+ <Border Name="Border" BorderBrush="#666" BorderThickness="1,1,1,0" CornerRadius="8,8,0,0" Margin="-2,0,0,-1">
<DockPanel>
- <TextBlock x:Name="TabItemText" Foreground="#444" FontWeight="SemiBold" TextOptions.TextFormattingMode="Display" Padding="16 6 12 6" RenderOptions.ClearTypeHint="Enabled">
+ <TextBlock x:Name="TabItemText" Foreground="#444" FontWeight="SemiBold" TextOptions.TextFormattingMode="Display" Padding="16 6 12 6" RenderOptions.ClearTypeHint="Enabled" TextOptions.TextRenderingMode="ClearType" SnapsToDevicePixels="True" UseLayoutRounding="True" RenderOptions.BitmapScalingMode="NearestNeighbor">
<ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header"/>
</TextBlock>
<Button Command="{Binding CloseCommand}" Background="{x:Null}" BorderBrush="{x:Null}">
@@ -22,13 +22,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
- <Setter TargetName="TabItemText" Property="RenderOptions.ClearTypeHint" Value="Enabled"></Setter>
<Setter TargetName="TabItemText" Property="FontSize" Value="12"></Setter>
- <Setter TargetName="TabItemText" Property="Effect">
- <Setter.Value>
- <DropShadowEffect ShadowDepth="2" Direction="320" Color="White" Opacity="1" BlurRadius="2" RenderingBias="Quality" />
- </Setter.Value>
- </Setter>
<Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0"></Setter>
<Setter TargetName="Border" Property="Background">
<Setter.Value>
View
20 UserControls/ChangesetHistory.xaml
@@ -7,16 +7,24 @@
d:DesignHeight="300">
<StackPanel>
- <DataGrid SelectionUnit="FullRow" HeadersVisibility="Column" ItemsSource="{Binding Commits}" AutoGenerateColumns="False">
+ <DataGrid CanUserSortColumns="False" SelectionUnit="FullRow" HeadersVisibility="Column" ItemsSource="{Binding Commits}" AutoGenerateColumns="False">
<DataGrid.Columns>
- <DataGridTextColumn Binding="{Binding Path=Hash}" Header="Hash"></DataGridTextColumn>
+ <DataGridTextColumn Binding="{Binding Path=HashShort}" Header="Hash"></DataGridTextColumn>
<DataGridTextColumn Binding="{Binding Path=Source}" Header="Source"></DataGridTextColumn>
- <DataGridTextColumn Binding="{Binding Path=Description}" Header="Description" Width="*"></DataGridTextColumn>
+ <DataGridTemplateColumn Header="Description" Width="*">
+ <DataGridTemplateColumn.CellTemplate>
+ <DataTemplate>
+ <WrapPanel>
+ <ListBox ItemsSource="{Binding DisplayTags}" Style="{DynamicResource DisplayTags}" />
+ <TextBlock Text="{Binding Path=Description}" VerticalAlignment="Center" />
+ </WrapPanel>
+ </DataTemplate>
+ </DataGridTemplateColumn.CellTemplate>
+ </DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding Path=FormattedDate}" Header="Date"></DataGridTextColumn>
- <DataGridTextColumn Binding="{Binding Path=AuthorName}" Header="Author name"></DataGridTextColumn>
- <DataGridTextColumn Binding="{Binding Path=AuthorEmail}" Header="Author email"></DataGridTextColumn>
+ <DataGridTextColumn Binding="{Binding Path=Author}" Header="Author"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
-</UserControl>
+</UserControl>
View
2 UserControls/Panel.xaml
@@ -10,7 +10,7 @@
<ControlTemplate>
<StackPanel>
<DockPanel Style="{DynamicResource PanelHeaderStyle}">
- <TextBlock DockPanel.Dock="Left" Style="{DynamicResource PanelHeaderTextStyle}" Text="{TemplateBinding local:Panel.HeaderText}" />
+ <TextBlock DockPanel.Dock="Left" Style="{DynamicResource PanelHeaderTextStyle}" Text="{TemplateBinding local:Panel.HeaderText}" Foreground="White" />
<WrapPanel DockPanel.Dock="Right" HorizontalAlignment="Right">
<Button>
<WrapPanel>
View
2 ViewModels/MainWindowViewModel.cs
@@ -19,7 +19,7 @@ public MainWindowViewModel()
public void Load()
{
// Add some test repositories.
- RepositoryViewModel repo = new RepositoryViewModel { Name = "gi1", FullPath = "Z:/www/git1" };
+ RepositoryViewModel repo = new RepositoryViewModel { Name = "Git test repository", FullPath = "Z:/www/git2" };
repo.Load();
RepositoryViewModel repo2 = new RepositoryViewModel { Name = "New tab", FullPath = null, NotOpened = true };
View
50 ViewModels/RepositoryViewModel.cs
@@ -48,17 +48,7 @@ private void LoadChangesets()
// Load commits.
foreach (LibGit2Sharp.Commit commit in repo.Commits)
{
- IEnumerable<Branch> branches = ListBranchesContaininingCommit(repo, commit.Sha);
-
- Commit c = new Commit();
- c.AuthorEmail = commit.Author.Email;
- c.AuthorName = commit.Author.Name;
- c.Date = commit.Author.When.DateTime;
- c.Description = commit.MessageShort;
- c.Hash = commit.Sha;
- c.Source = branches.ElementAt(0).ToString();
-
- Commits.Add(c);
+ Commits.Add(Commit.Create(repo, commit));
}
// Dispose.
@@ -114,43 +104,5 @@ private void ListenToDirectoryChanges()
watcher.Path = FullPath;
watcher.EnableRaisingEvents = true;
}
-
- /// <summary>
- /// A helper method for listing branches that contain the given commit.
- /// </summary>
- /// <param name="repo"></param>
- /// <param name="commitSha"></param>
- /// <returns></returns>
- private IEnumerable<Branch> ListBranchesContaininingCommit(LibGit2Sharp.Repository repo, string commitSha)
- {
- bool directBranchHasBeenFound = false;
- foreach (var branch in repo.Branches)
- {
- if (branch.Tip.Sha != commitSha)
- {
- continue;
- }
-
- directBranchHasBeenFound = true;
- yield return branch;
- }
-
- if (directBranchHasBeenFound)
- {
- yield break;
- }
-
- foreach (var branch in repo.Branches)
- {
- var commits = repo.Commits.QueryBy(new Filter { Since = branch }).Where(c => c.Sha == commitSha);
-
- if (commits.Count() == 0)
- {
- continue;
- }
-
- yield return branch;
- }
- }
}
}
View
2 app.config
@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

0 comments on commit 9ee5d0d

Please sign in to comment.
Something went wrong with that request. Please try again.