Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved toolbars.

  • Loading branch information...
commit 18c148865e665bf10e26a163e2cb1bf721f98e1e 1 parent 07d04e7
Kai Sellgren authored
1  App.xaml
View
@@ -22,6 +22,7 @@
<ResourceDictionary Source="Templates/AppTabItemTemplate.xaml"/>
<ResourceDictionary Source="Templates/AppTabNew.xaml"/>
<ResourceDictionary Source="Templates/AppTabNew.xaml"/>
+ <ResourceDictionary Source="Styles/Separator.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
16 Git-GUI.csproj
View
@@ -152,6 +152,7 @@
<DependentUpon>About.xaml</DependentUpon>
</Compile>
<Compile Include="AppTabDataTemplateSelector.cs" />
+ <Compile Include="Command.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="Converters\ExtensionToImageConverter.cs" />
<Compile Include="Converters\StatusGridGroupToColorConverter.cs" />
@@ -178,7 +179,7 @@
<Compile Include="UserControls\Panel.xaml.cs">
<DependentUpon>Panel.xaml</DependentUpon>
</Compile>
- <Compile Include="UserControls\PromptDialog.xaml.cs">
+ <Compile Include="UserControls\Dialogs\PromptDialog.xaml.cs">
<DependentUpon>PromptDialog.xaml</DependentUpon>
</Compile>
<Compile Include="UserControls\StatusGrid.xaml.cs">
@@ -257,6 +258,10 @@
<Page Include="Styles\Panel.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Styles\Separator.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Styles\TextBlock.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -307,7 +312,7 @@
<Page Include="UserControls\Panel.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="UserControls\PromptDialog.xaml">
+ <Page Include="UserControls\Dialogs\PromptDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -432,7 +437,9 @@
<ItemGroup>
<Resource Include="Resources\Icons\Unstage.png" />
</ItemGroup>
- <ItemGroup />
+ <ItemGroup>
+ <Resource Include="Resources\Icons\Stash-24.png" />
+ </ItemGroup>
<ItemGroup>
<Resource Include="Resources\Icons\OpenIgnoreEditor.png" />
</ItemGroup>
@@ -461,6 +468,9 @@
<Resource Include="Resources\Icons\MinimizeWindow.png" />
<Resource Include="Resources\Icons\RestoreWindow.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Resources\Icons\Branch-24.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
17 UserControls/LeftToolbar.xaml.cs
View
@@ -12,6 +12,7 @@
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using GG.Models;
namespace GG.UserControls
{
@@ -20,9 +21,25 @@ namespace GG.UserControls
/// </summary>
public partial class LeftToolbar : UserControl
{
+ public DelegateCommand DeleteBranchCommand { get; private set; }
+
public LeftToolbar()
{
InitializeComponent();
+
+ DeleteBranchCommand = new DelegateCommand(DeleteBranch);
+ }
+
+ /// <summary>
+ /// Deletes a branch.
+ /// </summary>
+ /// <param name="action"></param>
+ private void DeleteBranch(object action)
+ {
+ Branch branch = action as Branch;
+
+ // TODO: Needs confirmation.
+ branch.Delete();
}
private void OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
1  UserControls/NewTabPage.xaml.cs
View
@@ -13,6 +13,7 @@
using System.Windows.Navigation;
using System.Windows.Shapes;
using GG.Libraries;
+using GG.UserControls.Dialogs;
namespace GG.UserControls
{
41 UserControls/TopToolbar.xaml
View
@@ -1,10 +1,11 @@
<UserControl x:Class="GG.UserControls.TopToolbar"
+ x:Name="TopToolbarUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300">
+ d:DesignHeight="80" d:DesignWidth="605">
<StackPanel>
<WrapPanel Style="{DynamicResource TopToolbarStyle}">
@@ -15,34 +16,52 @@
<TextBlock>Settings</TextBlock>
</StackPanel>
</Button>
+
+ <Separator Width="30" Height="1" Style="{StaticResource VerticalSeparatorStyle}" />
+
+ <Button Command="{Binding Path=CreateBranchCommand, ElementName=TopToolbarUserControl}">
+ <StackPanel>
+ <Image Source="../Resources/Icons/Branch-24.png" Stretch="None" />
+ <TextBlock>Branch</TextBlock>
+ </StackPanel>
+ </Button>
<Button>
<StackPanel>
- <Image Source="../Resources/Icons/Fetch.png" Stretch="None" />
- <TextBlock>Fetch</TextBlock>
+ <Image Source="../Resources/Icons/Stash-24.png" Stretch="None" />
+ <TextBlock>Stash</TextBlock>
</StackPanel>
</Button>
<Button>
<StackPanel>
- <Image Source="../Resources/Icons/Pull.png" Stretch="None" />
- <TextBlock>Pull</TextBlock>
+ <Image Source="../Resources/Icons/Search.png" Stretch="None" />
+ <TextBlock>Search</TextBlock>
</StackPanel>
</Button>
<Button>
<StackPanel>
- <Image Source="../Resources/Icons/Push.png" Stretch="None" />
- <TextBlock>Push</TextBlock>
+ <Image Source="../Resources/Icons/Statistics.png" Stretch="None" />
+ <TextBlock>Statistics</TextBlock>
</StackPanel>
</Button>
+
+ <Separator Width="30" Height="1" Style="{StaticResource VerticalSeparatorStyle}" />
+
<Button>
<StackPanel>
- <Image Source="../Resources/Icons/Search.png" Stretch="None" />
- <TextBlock>Search</TextBlock>
+ <Image Source="../Resources/Icons/Fetch.png" Stretch="None" />
+ <TextBlock>Fetch</TextBlock>
</StackPanel>
</Button>
<Button>
<StackPanel>
- <Image Source="../Resources/Icons/Statistics.png" Stretch="None" />
- <TextBlock>Statistics</TextBlock>
+ <Image Source="../Resources/Icons/Pull.png" Stretch="None" />
+ <TextBlock>Pull</TextBlock>
+ </StackPanel>
+ </Button>
+ <Button>
+ <StackPanel>
+ <Image Source="../Resources/Icons/Push.png" Stretch="None" />
+ <TextBlock>Push</TextBlock>
</StackPanel>
</Button>
</WrapPanel>
28 UserControls/TopToolbar.xaml.cs
View
@@ -12,6 +12,7 @@
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using GG.UserControls.Dialogs;
namespace GG.UserControls
{
@@ -20,9 +21,34 @@ namespace GG.UserControls
/// </summary>
public partial class TopToolbar : UserControl
{
+ public DelegateCommand CreateBranchCommand { get; private set; }
+
public TopToolbar()
{
InitializeComponent();
+
+ CreateBranchCommand = new DelegateCommand(CreateBranch);
+ }
+
+ /// <summary>
+ /// Creates a branch.
+ /// </summary>
+ /// <param name="action"></param>
+ private void CreateBranch(object action)
+ {
+ Console.WriteLine("foo");
+
+ var dialog = new PromptDialog
+ {
+ Title = "Creating a new branch",
+ Message = "Please give a name for your new branch:"
+ };
+
+ dialog.ShowDialog();
+
+ var name = dialog.DialogResult;
+
+ Console.WriteLine(name);
}
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.