fix: move AddRootFolder menu to toolbar

This commit is contained in:
Gadfly 2024-06-24 11:45:34 +08:00
parent d5885da683
commit 1482c47c9d
No known key found for this signature in database
2 changed files with 5 additions and 13 deletions

View file

@ -151,19 +151,7 @@ namespace SourceGit.ViewModels
menu.Items.Add(terminal);
}
if (folderNode == null)
{
var addFolder = new MenuItem();
addFolder.Header = App.Text("Welcome.AddRootFolder");
addFolder.Icon = App.CreateMenuIcon("Icons.Folder.Add");
addFolder.Click += (_, e) =>
{
AddRootNode();
e.Handled = true;
};
menu.Items.Add(addFolder);
}
else
if (folderNode != null)
{
var addSubFolder = new MenuItem();
addSubFolder.Header = App.Text("Welcome.AddSubFolder");

View file

@ -22,6 +22,10 @@
<Button Classes="icon_button" Width="32" Command="{Binding OpenTerminal}" ToolTip.Tip="{DynamicResource Text.Welcome.OpenTerminal}">
<Path Width="13" Height="13" Data="{StaticResource Icons.Terminal}"/>
</Button>
<Button Classes="icon_button" Width="32" Command="{Binding AddRootNode}" ToolTip.Tip="{DynamicResource Text.Welcome.AddRootFolder}">
<Path Width="16" Height="16" Data="{StaticResource Icons.Folder.Add}" Margin="0,4,0,0"/>
</Button>
</StackPanel>
</Border>