Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 9dc02fe

Browse files
committed
GitHub pane, toolbar and menu item
1 parent bad5b76 commit 9dc02fe

File tree

11 files changed

+217
-8
lines changed

11 files changed

+217
-8
lines changed

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,15 @@
206206
<None Include="..\..\script\Key.snk" Condition="$(Buildtype) == 'Internal'">
207207
<Link>Key.snk</Link>
208208
</None>
209+
<Compile Include="..\common\SolutionInfo.cs">
210+
<Link>Properties\SolutionInfo.cs</Link>
211+
</Compile>
209212
<Compile Include="Base\TeamExplorerGitRepoInfo.cs" />
210213
<Compile Include="Base\TeamExplorerInvitationBase.cs" />
211214
<Compile Include="Base\TeamExplorerServiceHolder.cs" />
212215
<Compile Include="Converters\CountToVisibilityConverter.cs" />
213216
<Compile Include="Helpers\SharedDictionaryManager.cs" />
214217
<Compile Include="Properties\AssemblyInfo.cs" />
215-
<Compile Include="..\common\SolutionInfo.cs">
216-
<Link>Properties\SolutionInfo.cs</Link>
217-
</Compile>
218-
</ItemGroup>
219-
<ItemGroup>
220218
<Compile Include="Base\TeamExplorerBase.cs" />
221219
<Compile Include="Base\TeamExplorerItemBase.cs" />
222220
<Compile Include="Base\TeamExplorerNavigationItemBase.cs" />
@@ -251,6 +249,7 @@
251249
<Compile Include="TeamExplorer\Home\PulseNavigationItem.cs" />
252250
<Compile Include="TeamExplorer\Sync\GitHubPublishSection.cs" />
253251
<Compile Include="UI\DrawingExtensions.cs" />
252+
<Compile Include="UI\GitHubPane.cs" />
254253
<Compile Include="UI\Views\Controls\RepositoryCloneControl.xaml.cs">
255254
<DependentUpon>RepositoryCloneControl.xaml</DependentUpon>
256255
</Compile>
@@ -318,6 +317,7 @@
318317
<ItemGroup>
319318
<VSCTCompile Include="GitHub.VisualStudio.vsct">
320319
<ResourceName>Menus.ctmenu</ResourceName>
320+
<SubType>Designer</SubType>
321321
</VSCTCompile>
322322
</ItemGroup>
323323
<ItemGroup>
@@ -333,6 +333,22 @@
333333
<Resource Include="Resources\default_user_avatar.png" />
334334
</ItemGroup>
335335
<ItemGroup>
336+
<Page Include="Resources\icons\refresh.xaml">
337+
<Generator>MSBuild:Compile</Generator>
338+
<SubType>Designer</SubType>
339+
</Page>
340+
<Page Include="Resources\icons\arrow_right.xaml">
341+
<Generator>MSBuild:Compile</Generator>
342+
<SubType>Designer</SubType>
343+
</Page>
344+
<Page Include="Resources\icons\arrow_left.xaml">
345+
<Generator>MSBuild:Compile</Generator>
346+
<SubType>Designer</SubType>
347+
</Page>
348+
<Page Include="Resources\icons\git_pull_request.xaml">
349+
<SubType>Designer</SubType>
350+
<Generator>MSBuild:Compile</Generator>
351+
</Page>
336352
<Page Include="Resources\icons\mark_github.xaml">
337353
<SubType>Designer</SubType>
338354
<Generator>MSBuild:Compile</Generator>
@@ -498,7 +514,6 @@
498514
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup;</IncludeOutputGroupsInVSIXLocalOnly>
499515
</ProjectReference>
500516
</ItemGroup>
501-
<ItemGroup />
502517
<PropertyGroup>
503518
<UseCodebase>true</UseCodebase>
504519
</PropertyGroup>

src/GitHub.VisualStudio/GitHub.VisualStudio.imagemanifest

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,27 @@
44
<String Name="Resources" Value="/GitHub.VisualStudio;component/Resources/icons" />
55
<Guid Name="guidImages" Value="{27841f47-070a-46d6-90be-a5cbbfc724ac}" />
66
<ID Name="logo" Value="1" />
7+
<ID Name="arrow_left" Value="2" />
8+
<ID Name="arrow_right" Value="3" />
9+
<ID Name="refresh" Value="4" />
10+
<ID Name="pullrequest" Value="5" />
711
</Symbols>
812

913
<Images>
1014
<Image Guid="$(guidImages)" ID="$(logo)">
1115
<Source Uri="$(Resources)/mark_github.xaml" />
1216
</Image>
17+
<Image Guid="$(guidImages)" ID="$(arrow_left)">
18+
<Source Uri="$(Resources)/arrow_left.xaml" />
19+
</Image>
20+
<Image Guid="$(guidImages)" ID="$(arrow_right)">
21+
<Source Uri="$(Resources)/arrow_right.xaml" />
22+
</Image>
23+
<Image Guid="$(guidImages)" ID="$(refresh)">
24+
<Source Uri="$(Resources)/refresh.xaml" />
25+
</Image>
26+
<Image Guid="$(guidImages)" ID="$(pullrequest)">
27+
<Source Uri="$(Resources)/git_pull_request.xaml" />
28+
</Image>
1329
</Images>
1430
</ImageManifest>

src/GitHub.VisualStudio/GitHub.VisualStudio.vsct

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,24 @@
2929
<Group guid="guidGitHubCmdSet" id="idGitHubMenuGroup" priority="0x0500">
3030
<Parent guid="guidManageConnections" id="idManageConnections" />
3131
</Group>
32+
33+
<Group guid="guidGitHubToolbarCmdSet" id="idGitHubToolbarMenuGroup" priority="0x0500">
34+
<Parent guid="guidGitHubToolbarCmdSet" id="idGitHubToolbar" />
35+
</Group>
36+
37+
<Group guid="guidGitHubToolbarCmdSet" id="idGitHubToolbarMenuGroup1" priority="0x0501">
38+
<Parent guid="guidGitHubToolbarCmdSet" id="idGitHubToolbar" />
39+
</Group>
3240
</Groups>
41+
42+
<Menus>
43+
<Menu guid="guidGitHubToolbarCmdSet" id="idGitHubToolbar" priority="0x0000" type="ToolWindowToolbar">
44+
<Strings>
45+
<ButtonText>WindowToolBar</ButtonText>
46+
<CommandName>Window Toolbar</CommandName>
47+
</Strings>
48+
</Menu>
49+
</Menus>
3350

3451
<!--Buttons section. -->
3552
<!--This section defines the elements the user can interact with, like a menu command or a button
@@ -51,6 +68,52 @@
5168
<ButtonText>&amp;Connect to GitHub</ButtonText>
5269
</Strings>
5370
</Button>
71+
72+
<Button guid="guidGitHubCmdSet" id="showGitHubPaneCommand" priority="0x0100" type="Button">
73+
<Parent guid="guidSHLMainMenu" id="IDG_VS_WNDO_OTRWNDWS1" />
74+
<Icon guid="guidImages" id="logo" />
75+
<CommandFlag>IconIsMoniker</CommandFlag>
76+
<Strings>
77+
<ButtonText>GitHub</ButtonText>
78+
</Strings>
79+
</Button>
80+
81+
<!--- Toolbar buttons -->
82+
<Button guid="guidGitHubToolbarCmdSet" id="backCommand" priority="0x0100" type="Button">
83+
<Parent guid="guidGitHubToolbarCmdSet" id="idGitHubToolbarMenuGroup" />
84+
<Icon guid="guidImages" id="arrow_left" />
85+
<CommandFlag>IconIsMoniker</CommandFlag>
86+
<Strings>
87+
<ButtonText></ButtonText>
88+
</Strings>
89+
</Button>
90+
91+
<Button guid="guidGitHubToolbarCmdSet" id="forwardCommand" priority="0x0101" type="Button">
92+
<Parent guid="guidGitHubToolbarCmdSet" id="idGitHubToolbarMenuGroup" />
93+
<Icon guid="guidImages" id="arrow_right" />
94+
<CommandFlag>IconIsMoniker</CommandFlag>
95+
<Strings>
96+
<ButtonText></ButtonText>
97+
</Strings>
98+
</Button>
99+
100+
<Button guid="guidGitHubToolbarCmdSet" id="pullRequestCommand" priority="0x0102" type="Button">
101+
<Parent guid="guidGitHubToolbarCmdSet" id="idGitHubToolbarMenuGroup" />
102+
<Icon guid="guidImages" id="pullrequest" />
103+
<CommandFlag>IconIsMoniker</CommandFlag>
104+
<Strings>
105+
<ButtonText></ButtonText>
106+
</Strings>
107+
</Button>
108+
109+
<Button guid="guidGitHubToolbarCmdSet" id="refreshCommand" priority="0x0110" type="Button">
110+
<Parent guid="guidGitHubToolbarCmdSet" id="idGitHubToolbarMenuGroup1" />
111+
<Icon guid="guidImages" id="refresh" />
112+
<CommandFlag>IconIsMoniker</CommandFlag>
113+
<Strings>
114+
<ButtonText></ButtonText>
115+
</Strings>
116+
</Button>
54117
</Buttons>
55118

56119
</Commands>
@@ -64,6 +127,7 @@
64127
<IDSymbol name="GitHubMenu" value="0x1010"/>
65128
<IDSymbol name="idGitHubMenuGroup" value="0x1020"/>
66129
<IDSymbol name="addConnectionCommand" value="0x110"/>
130+
<IDSymbol name="showGitHubPaneCommand" value="0x200"/>
67131
</GuidSymbol>
68132

69133
<!-- This is the Manage Connections menu -->
@@ -73,7 +137,22 @@
73137

74138
<GuidSymbol name="guidImages" value="{27841f47-070a-46d6-90be-a5cbbfc724ac}" >
75139
<IDSymbol name="logo" value="1" />
140+
<IDSymbol name="arrow_left" value="2" />
141+
<IDSymbol name="arrow_right" value="3" />
142+
<IDSymbol name="refresh" value="4" />
143+
<IDSymbol name="pullrequest" value="5" />
144+
</GuidSymbol>
145+
146+
<GuidSymbol name="guidGitHubToolbarCmdSet" value="{C5F1193E-F300-41B3-B4C4-5A703DD3C1C6}">
147+
<IDSymbol name="idGitHubToolbarMenuGroup" value="0x1110" />
148+
<IDSymbol name="idGitHubToolbarMenuGroup1" value="0x1111" />
149+
<IDSymbol name="idGitHubToolbar" value="0x1120" />
150+
<IDSymbol name="backCommand" value="0x300" />
151+
<IDSymbol name="forwardCommand" value="0x301" />
152+
<IDSymbol name="refreshCommand" value="0x302" />
153+
<IDSymbol name="pullRequestCommand" value="0x310" />
76154
</GuidSymbol>
155+
77156
</Symbols>
78157

79158
</CommandTable>

src/GitHub.VisualStudio/GitHubPackage.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
using GitHub.UI;
99
using GitHub.Services;
1010
using GitHub.Models;
11+
using GitHub.VisualStudio.UI;
12+
using Microsoft.VisualStudio.Shell.Interop;
13+
using Microsoft.VisualStudio;
1114
using GitHub.Extensions;
1215

1316
namespace GitHub.VisualStudio
@@ -33,6 +36,7 @@ namespace GitHub.VisualStudio
3336
[ProvideMenuResource("Menus.ctmenu", 1)]
3437
//[ProvideAutoLoad(UIContextGuids.NoSolution)]
3538
[ProvideAutoLoad("11B8E6D7-C08B-4385-B321-321078CDD1F8")]
39+
[ProvideToolWindow(typeof(GitHubPane), Orientation = ToolWindowOrientation.Right, Style = VsDockStyle.Tabbed, Window = EnvDTE.Constants.vsWindowKindSolutionExplorer)]
3640
public class GitHubPackage : PackageBase
3741
{
3842
public GitHubPackage()
@@ -48,9 +52,17 @@ public GitHubPackage(IServiceProvider serviceProvider)
4852
protected override void Initialize()
4953
{
5054

51-
base.Initialize();
52-
5355
ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubCmdSet, PkgCmdIDList.addConnectionCommand, (s, e) => StartFlow(UIControllerFlow.Authentication));
56+
ServiceProvider.AddTopLevelMenuItem(GuidList.guidGitHubCmdSet, PkgCmdIDList.showGitHubPaneCommand, (s, e) =>
57+
{
58+
var window = FindToolWindow(typeof(GitHubPane), 0, true);
59+
if (window == null || window.Frame == null)
60+
throw new NotSupportedException("Cannot create tool window");
61+
62+
var windowFrame = (IVsWindowFrame)window.Frame;
63+
ErrorHandler.ThrowOnFailure(windowFrame.Show());
64+
});
65+
base.Initialize();
5466
}
5567

5668
void StartFlow(UIControllerFlow controllerFlow)

src/GitHub.VisualStudio/PkgCmdID.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@ namespace GitHub.VisualStudio
55
static class PkgCmdIDList
66
{
77
public const int addConnectionCommand = 0x110;
8+
public const int idGitHubToolbar = 0x1120;
9+
public const int showGitHubPaneCommand = 0x200;
10+
public const int backCommand = 0x300;
11+
public const int forwardCommand = 0x301;
12+
public const int refreshCommand = 0x302;
13+
public const int pullRequestCommand = 0x310;
814
};
915
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Width="48" Height="48">
3+
<Canvas Width="24" Height="24">
4+
<Path Data="M22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,12M7,12L12,17V14H16V10H12V7L7,12Z" Fill="#00458D" />
5+
</Canvas>
6+
</Viewbox>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
Width="48"
4+
Height="48">
5+
<Canvas Width="24"
6+
Height="24">
7+
<Path Data="M2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12M17,12L12,7V10H8V14H12V17L17,12Z"
8+
Fill="#00458D" />
9+
</Canvas>
10+
</Viewbox>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
Width="48"
4+
Height="48">
5+
<Canvas Width="24"
6+
Height="24">
7+
<Path Data="M128 64C57.344 64 0 121.34400000000005 0 192c0 47.219 25.906 88.062 64 110.281V721.75C25.906 743.938 0 784.75 0 832c0 70.625 57.344 128 128 128s128-57.375 128-128c0-47.25-25.844-88.062-64-110.25V302.28099999999995c38.156-22.219 64-63.062 64-110.281C256 121.34400000000005 198.656 64 128 64zM128 896c-35.312 0-64-28.625-64-64 0-35.312 28.688-64 64-64 35.406 0 64 28.688 64 64C192 867.375 163.406 896 128 896zM128 256c-35.312 0-64-28.594-64-64s28.688-64 64-64c35.406 0 64 28.594 64 64S163.406 256 128 256zM704 721.75V320c0-192.5-192-192-192-192h-64V0L256 192l192 192V256c0 0 26.688 0 64 0 56.438 0 64 64 64 64v401.75c-38.125 22.188-64 62.938-64 110.25 0 70.625 57.375 128 128 128s128-57.375 128-128C768 784.75 742.125 743.938 704 721.75zM640 896c-35.312 0-64-28.625-64-64 0-35.312 28.688-64 64-64 35.375 0 64 28.688 64 64C704 867.375 675.375 896 640 896z"
8+
Fill="#00458D" />
9+
</Canvas>
10+
</Viewbox>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
Width="48"
4+
Height="48">
5+
<Canvas Width="24"
6+
Height="24">
7+
<Path Data="M19,12H22.32L17.37,16.95L12.42,12H16.97C17,10.46 16.42,8.93 15.24,7.75C12.9,5.41 9.1,5.41 6.76,7.75C4.42,10.09 4.42,13.9 6.76,16.24C8.6,18.08 11.36,18.47 13.58,17.41L15.05,18.88C12,20.69 8,20.29 5.34,17.65C2.22,14.53 2.23,9.47 5.35,6.35C8.5,3.22 13.53,3.21 16.66,6.34C18.22,7.9 19,9.95 19,12Z"
8+
Fill="#00458D" />
9+
</Canvas>
10+
</Viewbox>

src/GitHub.VisualStudio/Settings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ static class GuidList
99
{
1010
public const string guidGitHubPkgString = "c3d3dc68-c977-411f-b3e8-03b0dccf7dfc";
1111
public const string guidGitHubCmdSetString = "c4c91892-8881-4588-a5d9-b41e8f540f5a";
12+
public const string guidGitHubToolbarCmdSetString = "C5F1193E-F300-41B3-B4C4-5A703DD3C1C6";
1213

1314
public static readonly Guid guidGitHubCmdSet = new Guid(guidGitHubCmdSetString);
15+
public static readonly Guid guidGitHubToolbarCmdSet = new Guid(guidGitHubToolbarCmdSetString);
1416
}
1517

1618
static class NavigationItemPriority

0 commit comments

Comments
 (0)