Permalink
Browse files

Whether the author is displayer or not is now a configurable option u…

…nder the settings view
  • Loading branch information...
Ben Lucas
Ben Lucas committed Feb 3, 2017
1 parent 1ff220b commit fc98b99ba75ac2c59101785a87fcc2ec66889e84
@@ -40,11 +40,17 @@ private void OnToggleSettings(object sender, RoutedEventArgs args)
foreach (var vertex in _viewModel.Graph.Vertices)
{
vertex.AdornerMessageVisibilityType = Configuration.GetSetting("AdornerCommitMessageVisibility", "ExpandedHidden");
vertex.AuthorShown = Configuration.GetSetting("AuthorInHeader", false);
vertex.DescriptionShown = Configuration.GetSetting("DescriptionInExpander", false);
vertex.ShaLength = Configuration.GetSetting("SHALength", 8);
}
Configuration.Save();
_viewModel.Refresh();
// Ideally we wouldn't have to call relayout. Refreshing the view model would
// update the Graph which would then cause the RepositoryGraphLayout control to adjust its layout.
// Unfortunately, I am not as familiar with the RepositoryGraphLayout control and when the vertices have their
// width's increased due to displaying the author, the graph needs to have its layout adjusted.
graphLayout.Relayout();
}
}
}
@@ -15,6 +15,7 @@ public CommitVertex(string sha, string message)
Branches.CollectionChanged += (o, e) => RaisePropertyChanged(() => HasBranches);
ShaLength = MainWindow.Configuration.GetSetting("SHALength", 8);
DescriptionShown = MainWindow.Configuration.GetSetting("DescriptionInExpander", false);
AuthorShown = MainWindow.Configuration.GetSetting("AuthorInHeader", false);
AdornerMessageVisibilityType = MainWindow.Configuration.GetSetting("AdornerCommitMessageVisibility", "ExpandedHidden");
Expanded = false;
}
@@ -48,6 +49,22 @@ public bool DescriptionShown
}
}
private bool _authorShown;
public bool AuthorShown
{
get
{
return _authorShown;
}
set
{
_authorShown = value;
RaisePropertyChanged(() => AuthorShown);
}
}
public bool AdornerMessageVisibility
{
get;
@@ -96,8 +96,8 @@
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding ShortSha, Mode=OneWay}"></TextBlock>
<TextBlock Text=" "></TextBlock>
<TextBlock Text="{Binding Author, Mode=OneWay}"></TextBlock>
<TextBlock Text=" " Visibility="{Binding AuthorShown, Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock>
<TextBlock Text="{Binding Author, Mode=OneWay}" Visibility="{Binding AuthorShown, Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock>
</StackPanel>
</Expander.Header>
<Expander.Style>
@@ -24,6 +24,13 @@
IsChecked="{Binding Path=CommitDescriptionShown}"/>
</StackPanel>
<StackPanel Orientation="Vertical">
<Label VerticalAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="10"
FontFamily="Verdana" FontWeight="Bold" Margin="0,0,0,0" Content="Show Commit Author" />
<CheckBox Name="CommitAuthor" HorizontalAlignment="Center" Margin="10 2 0 0" Background="White"
IsChecked="{Binding Path=CommitAuthorShown}"/>
</StackPanel>
<StackPanel Orientation="Vertical">
<Label VerticalAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="10"
FontFamily="Verdana" FontWeight="Bold" Margin="0,0,0,0" Content="SHA Length" />
@@ -77,6 +77,18 @@ public bool CommitDescriptionShown
_config.SetSetting("DescriptionInExpander", value ? "True" : "False");
}
}
public bool CommitAuthorShown
{
get
{
return _config.GetSetting("AuthorInHeader", false);
}
set
{
_config.SetSetting("AuthorInHeader", value ? "True" : "False");
}
}
}
}
}

0 comments on commit fc98b99

Please sign in to comment.