style<Icons>: add icons for context menu item

This commit is contained in:
leo 2022-05-18 20:34:44 +08:00
parent e60d4a84c4
commit 1da67dc517
5 changed files with 1284 additions and 1205 deletions

File diff suppressed because it is too large Load diff

View file

@ -671,14 +671,22 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
};
var createBranchIcon = new System.Windows.Shapes.Path();
createBranchIcon.Data = FindResource("Icon.Branch.Add") as Geometry;
createBranchIcon.Width = 10;
var createBranch = new MenuItem();
createBranch.Icon = createBranchIcon;
createBranch.Header = App.Text("CreateBranch");
createBranch.Click += (o, e) => {
new Popups.CreateBranch(repo, branch).Show();
e.Handled = true;
};
var createTagIcon = new System.Windows.Shapes.Path();
createTagIcon.Data = FindResource("Icon.Tag.Add") as Geometry;
createTagIcon.Width = 10;
var createTag = new MenuItem();
createTag.Icon = createTagIcon;
createTag.Header = App.Text("CreateTag");
createTag.Click += (o, e) => {
new Popups.CreateTag(repo, branch).Show();
@ -735,7 +743,11 @@ namespace SourceGit.Views.Widgets {
menu.Items.Add(tracking);
}
var archiveIcon = new System.Windows.Shapes.Path();
archiveIcon.Data = FindResource("Icon.Archive") as Geometry;
archiveIcon.Width = 10;
var archive = new MenuItem();
archive.Icon = archiveIcon;
archive.Header = App.Text("Archive");
archive.Click += (o, e) => {
new Popups.Archive(repo.Path, branch).Show();
@ -858,21 +870,33 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
};
var createBranchIcon = new System.Windows.Shapes.Path();
createBranchIcon.Data = FindResource("Icon.Branch.Add") as Geometry;
createBranchIcon.Width = 10;
var createBranch = new MenuItem();
createBranch.Icon = createBranchIcon;
createBranch.Header = App.Text("CreateBranch");
createBranch.Click += (o, e) => {
new Popups.CreateBranch(repo, branch).Show();
e.Handled = true;
};
var createTagIcon = new System.Windows.Shapes.Path();
createTagIcon.Data = FindResource("Icon.Tag.Add") as Geometry;
createTagIcon.Width = 10;
var createTag = new MenuItem();
createTag.Icon = createTagIcon;
createTag.Header = App.Text("CreateTag");
createTag.Click += (o, e) => {
new Popups.CreateTag(repo, branch).Show();
e.Handled = true;
};
var archiveIcon = new System.Windows.Shapes.Path();
archiveIcon.Data = FindResource("Icon.Archive") as Geometry;
archiveIcon.Width = 10;
var archive = new MenuItem();
archive.Icon = archiveIcon;
archive.Header = App.Text("Archive");
archive.Click += (o, e) => {
new Popups.Archive(repo.Path, branch).Show();
@ -916,7 +940,11 @@ namespace SourceGit.Views.Widgets {
var tag = tagList.SelectedItem as Models.Tag;
if (tag == null) return;
var createBranchIcon = new System.Windows.Shapes.Path();
createBranchIcon.Data = FindResource("Icon.Branch.Add") as Geometry;
createBranchIcon.Width = 10;
var createBranch = new MenuItem();
createBranch.Icon = createBranchIcon;
createBranch.Header = App.Text("CreateBranch");
createBranch.Click += (o, ev) => {
new Popups.CreateBranch(repo, tag).Show();
@ -938,7 +966,11 @@ namespace SourceGit.Views.Widgets {
ev.Handled = true;
};
var archiveIcon = new System.Windows.Shapes.Path();
archiveIcon.Data = FindResource("Icon.Archive") as Geometry;
archiveIcon.Width = 10;
var archive = new MenuItem();
archive.Icon = archiveIcon;
archive.Header = App.Text("Archive");
archive.Click += (o, ev) => {
new Popups.Archive(repo.Path, tag).Show();

File diff suppressed because it is too large Load diff

View file

@ -369,14 +369,22 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
};
var stashIcon = new System.Windows.Shapes.Path();
stashIcon.Data = FindResource("Icon.Stashes") as System.Windows.Media.Geometry;
stashIcon.Width = 10;
var stash = new MenuItem();
stash.Icon = stashIcon;
stash.Header = App.Text("FileCM.Stash");
stash.Click += (o, e) => {
new Popups.Stash(repo, changes).Show();
e.Handled = true;
};
var patchIcon = new System.Windows.Shapes.Path();
patchIcon.Data = FindResource("Icon.Diff") as System.Windows.Media.Geometry;
patchIcon.Width = 10;
var patch = new MenuItem();
patch.Icon = patchIcon;
patch.Header = App.Text("FileCM.SaveAsPatch");
patch.Click += (o, e) => {
var dialog = new SaveFileDialog();
@ -432,14 +440,22 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
};
var stashIcon = new System.Windows.Shapes.Path();
stashIcon.Data = FindResource("Icon.Stashes") as System.Windows.Media.Geometry;
stashIcon.Width = 10;
var stash = new MenuItem();
stash.Icon = stashIcon;
stash.Header = App.Text("FileCM.StashMulti", changes.Count);
stash.Click += (o, e) => {
new Popups.Stash(repo, changes).Show();
e.Handled = true;
};
var patchIcon = new System.Windows.Shapes.Path();
patchIcon.Data = FindResource("Icon.Diff") as System.Windows.Media.Geometry;
patchIcon.Width = 10;
var patch = new MenuItem();
patch.Icon = patchIcon;
patch.Header = App.Text("FileCM.SaveAsPatch");
patch.Click += (o, e) => {
var dialog = new SaveFileDialog();
@ -491,14 +507,22 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
};
var stashIcon = new System.Windows.Shapes.Path();
stashIcon.Data = FindResource("Icon.Stashes") as System.Windows.Media.Geometry;
stashIcon.Width = 10;
var stash = new MenuItem();
stash.Icon = stashIcon;
stash.Header = App.Text("FileCM.Stash");
stash.Click += (o, e) => {
new Popups.Stash(repo, changes).Show();
e.Handled = true;
};
var patchIcon = new System.Windows.Shapes.Path();
patchIcon.Data = FindResource("Icon.Diff") as System.Windows.Media.Geometry;
patchIcon.Width = 10;
var patch = new MenuItem();
patch.Icon = patchIcon;
patch.Header = App.Text("FileCM.SaveAsPatch");
patch.Click += (o, e) => {
var dialog = new SaveFileDialog();
@ -553,14 +577,22 @@ namespace SourceGit.Views.Widgets {
e.Handled = true;
};
var stashIcon = new System.Windows.Shapes.Path();
stashIcon.Data = FindResource("Icon.Stashes") as System.Windows.Media.Geometry;
stashIcon.Width = 10;
var stash = new MenuItem();
stash.Icon = stashIcon;
stash.Header = App.Text("FileCM.StashMulti", changes.Count);
stash.Click += (o, e) => {
new Popups.Stash(repo, changes).Show();
e.Handled = true;
};
var patchIcon = new System.Windows.Shapes.Path();
patchIcon.Data = FindResource("Icon.Diff") as System.Windows.Media.Geometry;
patchIcon.Width = 10;
var patch = new MenuItem();
patch.Icon = patchIcon;
patch.Header = App.Text("FileCM.SaveAsPatch");
patch.Click += (o, e) => {
var dialog = new SaveFileDialog();