-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from U-C-S/experiment/winui3
Experiment: Try building with WinUI (yet again)
- Loading branch information
Showing
47 changed files
with
1,804 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Application | ||
x:Class="Hurl.Settings.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Hurl.Settings"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
|
||
<SolidColorBrush x:Key="WindowCaptionBackground">Transparent</SolidColorBrush> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using Microsoft.UI.Xaml; | ||
using System; | ||
using System.Diagnostics; | ||
|
||
namespace Hurl.Settings; | ||
|
||
public partial class App : Application | ||
{ | ||
public App() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private MainWindow m_window; | ||
|
||
protected override void OnLaunched(LaunchActivatedEventArgs args) | ||
{ | ||
var cmdArgs = Environment.GetCommandLineArgs(); | ||
|
||
m_window = new MainWindow(); | ||
|
||
if (cmdArgs.Length > 1) | ||
{ | ||
ProcessArgs(cmdArgs); | ||
} | ||
else | ||
{ | ||
m_window.Activate(); | ||
} | ||
} | ||
|
||
|
||
void ProcessArgs(string[] args) | ||
{ | ||
Debug.WriteLine(args[0]); | ||
var primaryArg = args[1]; | ||
|
||
if (primaryArg.Equals("--page")) | ||
{ | ||
if (args.Length > 2) | ||
{ | ||
m_window.NavigateToPage(args[2]); | ||
m_window.Activate(); | ||
} | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+283 Bytes
Source/Hurl.Settings/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<UserControl | ||
x:Class="Hurl.Settings.Controls.ComingSoon" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Hurl.Settings.Controls" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<StackPanel | ||
Padding="4" | ||
HorizontalAlignment="Center" | ||
Background="{StaticResource SubtleFillColorTertiary}" | ||
CornerRadius="8"> | ||
<TextBlock | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Foreground="{ThemeResource SystemControlForegroundBaseHighBrush}" | ||
Style="{StaticResource TitleTextBlockStyle}" | ||
Text="Soon™" /> | ||
<NavigationViewItemSeparator Width="320" /> | ||
<TextBlock | ||
Width="400" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Text="Editing the values here is coming soon. In the meantime, you can edit the JSON file directly." | ||
TextAlignment="Center" | ||
TextWrapping="Wrap" /> | ||
<Button | ||
Margin="0,12" | ||
HorizontalAlignment="Center" | ||
Click="Button_Click" | ||
Style="{StaticResource AccentButtonStyle}"> | ||
Edit the JSON file | ||
</Button> | ||
</StackPanel> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Hurl.Library; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
using System.Diagnostics; | ||
|
||
namespace Hurl.Settings.Controls; | ||
|
||
public sealed partial class ComingSoon : UserControl | ||
{ | ||
public ComingSoon() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void Button_Click(object sender, RoutedEventArgs e) | ||
{ | ||
Process.Start("explorer", "\"" + Constants.APP_SETTINGS_MAIN + "\""); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<UserControl | ||
x:Class="Hurl.Settings.Controls.NewRuleCard" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="using:Hurl.Settings.Controls" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls" | ||
mc:Ignorable="d"> | ||
<Grid> | ||
<toolkit:SettingsCard> | ||
<toolkit:SettingsCard.Header> | ||
<StackPanel Orientation="Horizontal" Spacing="8"> | ||
<ComboBox x:Name="RuleTypeControl" SelectedIndex="0" /> | ||
<TextBox | ||
x:Name="RuleValueControl" | ||
Width="240" | ||
PlaceholderText="Rule" /> | ||
</StackPanel> | ||
</toolkit:SettingsCard.Header> | ||
|
||
<Button Click="DeleteButton_Click" Style="{StaticResource EllipsisButton}"> | ||
<SymbolIcon Symbol="Delete" /> | ||
</Button> | ||
</toolkit:SettingsCard> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Hurl.Library.Models; | ||
using Microsoft.UI.Xaml.Controls; | ||
using System; | ||
|
||
namespace Hurl.Settings.Controls; | ||
|
||
public sealed partial class NewRuleCard : UserControl | ||
{ | ||
public NewRuleCard() | ||
{ | ||
InitializeComponent(); | ||
|
||
RuleTypeControl.ItemsSource = Enum.GetValues(typeof(RuleMode)); | ||
} | ||
|
||
public NewRuleCard(Rule rule) | ||
{ | ||
InitializeComponent(); | ||
var ruleModes = Enum.GetValues(typeof(RuleMode)); | ||
|
||
RuleTypeControl.ItemsSource = ruleModes; | ||
RuleTypeControl.SelectedIndex = Array.IndexOf(ruleModes, rule.Mode); ; | ||
RuleValueControl.Text = rule.RuleContent; | ||
} | ||
|
||
public Rule? ConstructRule() | ||
{ | ||
var ruleType = RuleTypeControl.SelectedValue.ToString(); | ||
var ruleValue = RuleValueControl.Text; | ||
|
||
if (!string.IsNullOrWhiteSpace(ruleValue)) | ||
return new Rule(ruleValue, ruleType); | ||
return null; | ||
} | ||
|
||
private void DeleteButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) | ||
{ | ||
if (Parent is StackPanel stackPanel) | ||
stackPanel.Children.Remove(this); | ||
} | ||
} | ||
|
Oops, something went wrong.