mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
enhance: remeber tag group and submodule group IsExpanded state.
This commit is contained in:
parent
c83d4588a1
commit
0e49ad181a
2 changed files with 24 additions and 4 deletions
|
@ -210,6 +210,20 @@ namespace SourceGit.ViewModels
|
||||||
set => SetProperty(ref _searchedCommits, value);
|
set => SetProperty(ref _searchedCommits, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool IsTagGroupExpanded
|
||||||
|
{
|
||||||
|
get => _isTagGroupExpanded;
|
||||||
|
set => SetProperty(ref _isTagGroupExpanded, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public bool IsSubmoduleGroupExpanded
|
||||||
|
{
|
||||||
|
get => _isSubmoduleGroupExpanded;
|
||||||
|
set => SetProperty(ref _isSubmoduleGroupExpanded, value);
|
||||||
|
}
|
||||||
|
|
||||||
public void Open()
|
public void Open()
|
||||||
{
|
{
|
||||||
_watcher = new Models.Watcher(this);
|
_watcher = new Models.Watcher(this);
|
||||||
|
@ -250,6 +264,9 @@ namespace SourceGit.ViewModels
|
||||||
_isSearching = false;
|
_isSearching = false;
|
||||||
_searchCommitFilter = string.Empty;
|
_searchCommitFilter = string.Empty;
|
||||||
|
|
||||||
|
_isTagGroupExpanded = false;
|
||||||
|
_isSubmoduleGroupExpanded = false;
|
||||||
|
|
||||||
_remotes.Clear();
|
_remotes.Clear();
|
||||||
_branches.Clear();
|
_branches.Clear();
|
||||||
_localBranchTrees.Clear();
|
_localBranchTrees.Clear();
|
||||||
|
@ -1265,6 +1282,9 @@ namespace SourceGit.ViewModels
|
||||||
private string _searchCommitFilter = string.Empty;
|
private string _searchCommitFilter = string.Empty;
|
||||||
private List<Models.Commit> _searchedCommits = new List<Models.Commit>();
|
private List<Models.Commit> _searchedCommits = new List<Models.Commit>();
|
||||||
|
|
||||||
|
private bool _isTagGroupExpanded = false;
|
||||||
|
private bool _isSubmoduleGroupExpanded = false;
|
||||||
|
|
||||||
private List<Models.Remote> _remotes = new List<Models.Remote>();
|
private List<Models.Remote> _remotes = new List<Models.Remote>();
|
||||||
private List<Models.Branch> _branches = new List<Models.Branch>();
|
private List<Models.Branch> _branches = new List<Models.Branch>();
|
||||||
private List<Models.BranchTreeNode> _localBranchTrees = new List<Models.BranchTreeNode>();
|
private List<Models.BranchTreeNode> _localBranchTrees = new List<Models.BranchTreeNode>();
|
||||||
|
|
|
@ -241,7 +241,7 @@
|
||||||
</TreeView>
|
</TreeView>
|
||||||
|
|
||||||
<!-- Tags -->
|
<!-- Tags -->
|
||||||
<ToggleButton Grid.Row="6" x:Name="toggleTags" Classes="group_expander">
|
<ToggleButton Grid.Row="6" Classes="group_expander" IsChecked="{Binding IsTagGroupExpanded, Mode=TwoWay}">
|
||||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||||
<TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Tags}"/>
|
<TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Tags}"/>
|
||||||
<TextBlock Grid.Column="1" Text="{Binding Tags, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
<TextBlock Grid.Column="1" Text="{Binding Tags, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
||||||
|
@ -265,7 +265,7 @@
|
||||||
HorizontalScrollBarVisibility="Disabled"
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
VerticalScrollBarVisibility="Auto"
|
VerticalScrollBarVisibility="Auto"
|
||||||
LostFocus="OnTagDataGridLostFocus"
|
LostFocus="OnTagDataGridLostFocus"
|
||||||
IsVisible="{Binding #toggleTags.IsChecked}"
|
IsVisible="{Binding IsTagGroupExpanded, Mode=OneWay}"
|
||||||
SelectionChanged="OnTagDataGridSelectionChanged"
|
SelectionChanged="OnTagDataGridSelectionChanged"
|
||||||
ContextRequested="OnTagContextRequested">
|
ContextRequested="OnTagContextRequested">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
|
@ -301,7 +301,7 @@
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
||||||
<!-- Submodules -->
|
<!-- Submodules -->
|
||||||
<ToggleButton Grid.Row="8" x:Name="toggleSubmodules" Classes="group_expander">
|
<ToggleButton Grid.Row="8" Classes="group_expander" IsChecked="{Binding IsSubmoduleGroupExpanded, Mode=TwoWay}">
|
||||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
<Grid ColumnDefinitions="Auto,*,Auto,Auto">
|
||||||
<TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Submodules}"/>
|
<TextBlock Grid.Column="0" Classes="group_header_label" Margin="4,0,0,0" Text="{DynamicResource Text.Repository.Submodules}"/>
|
||||||
<TextBlock Grid.Column="1" Text="{Binding Submodules, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
<TextBlock Grid.Column="1" Text="{Binding Submodules, Converter={x:Static c:ListConverters.ToCount}}" Foreground="{DynamicResource Brush.FG2}" FontWeight="Bold"/>
|
||||||
|
@ -334,7 +334,7 @@
|
||||||
HorizontalScrollBarVisibility="Disabled"
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
VerticalScrollBarVisibility="Auto"
|
VerticalScrollBarVisibility="Auto"
|
||||||
ContextRequested="OnSubmoduleContextRequested"
|
ContextRequested="OnSubmoduleContextRequested"
|
||||||
IsVisible="{Binding #toggleSubmodules.IsChecked}">
|
IsVisible="{Binding IsSubmoduleGroupExpanded, Mode=OneWay}">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTemplateColumn Header="ICON">
|
<DataGridTemplateColumn Header="ICON">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
|
Loading…
Reference in a new issue