Skip to content

Commit

Permalink
some polish for v0.1.2
Browse files Browse the repository at this point in the history
- add a context menu to open in incognito (alpha)
- UI polishing
  • Loading branch information
U-C-S committed Aug 11, 2021
1 parent 7f92571 commit f283b4f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ private void Application_Startup(object sender, StartupEventArgs e)
{
string[] Arguments = e.Args;

if (Arguments.Length == 0)
if (Arguments.Length != 0)
{
SelectionWindow window = new SelectionWindow(Arguments);
window.Show();
Expand Down
8 changes: 4 additions & 4 deletions App/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Hurl")]
[assembly: AssemblyDescription("Hurl")]
[assembly: AssemblyDescription("Hurl - Your Handy Browser Selector")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("The3721 Tools")]
[assembly: AssemblyProduct("Hurl")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyCopyright("Copyright (c) 2021 Chanakya")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.1.0")]
[assembly: AssemblyFileVersion("0.1.1.0")]
[assembly: AssemblyVersion("0.1.2.0")]
[assembly: AssemblyFileVersion("0.1.2.0")]
9 changes: 8 additions & 1 deletion App/Views/SelectionWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
<Window.Clip>
<RectangleGeometry Rect="0,0,300,200" RadiusX="15" RadiusY="15" />
</Window.Clip>
<Window.Resources>
<ContextMenu x:Key="extraOptions">
<MenuItem Header="Incognito" Click="Incognito_Click" />
<Separator />
<MenuItem Header="Profile" />
</ContextMenu>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="25" />
<RowDefinition Height="1*" />
<RowDefinition Height="25" />
</Grid.RowDefinitions>
<TextBlock x:Name="header" Padding="2,3,2,3" TextAlignment="Center" FontSize="14" Background="White">Select a Browser</TextBlock>
<TextBlock x:Name="header" Padding="2,2,2,3" TextAlignment="Center" FontSize="14" Background="White">Select a Browser</TextBlock>
<StackPanel Background="#FFE02B47" x:Name="stacky" Grid.Row="1" />
<TextBlock x:Name="argss" Padding="2,5,2,3" TextAlignment="Center" FontSize="10" Grid.Row="2" Background="White">No Link Opened</TextBlock>
</Grid>
Expand Down
18 changes: 18 additions & 0 deletions App/Views/SelectionWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
Margin = new Thickness(20, 5, 20, 0),
Content = i.Name,
Tag = i.ExePath,
ContextMenu = FindResource("extraOptions") as ContextMenu
//Style = (Style) FindResource("MDIXButton")
};

Expand All @@ -73,5 +74,22 @@ private void BroClick(object sender, RoutedEventArgs e)
}
}

private void Incognito_Click(object sender, RoutedEventArgs e)
{
if (arg != null)
{
MenuItem menuItem = e.Source as MenuItem;
ContextMenu parent = menuItem.Parent as ContextMenu;
Button SrcButton = parent.PlacementTarget as Button;

string path = SrcButton.Tag.ToString();
string theArgs = $"--incognito {arg}";
_ = Process.Start(path, theArgs);
}
else
{
MessageBox.Show("No link to open");
}
}
}
}

0 comments on commit f283b4f

Please sign in to comment.