[FZ Editor] Open settings (#13727)

* Deeplink support

* Fixes

* Typo fix

* Update MainWindow.xaml.cs

Co-authored-by: Laute <Niels.Laute@philips.com>
This commit is contained in:
Niels Laute
2021-10-11 17:39:01 +02:00
committed by GitHub
parent 0ab0fb5dd4
commit 85eddfc536
5 changed files with 46 additions and 3 deletions

View File

@@ -184,6 +184,7 @@ Browsable
bsd bsd
bstr bstr
bti bti
btn
BTNFACE BTNFACE
Bto Bto
buf buf

View File

@@ -327,6 +327,21 @@
ItemsSource="{Binding MonitorInfoForViewModel}" /> ItemsSource="{Binding MonitorInfoForViewModel}" />
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>
<Button Click="SettingsBtn_Click"
x:Name="settingsBtn"
Margin="8"
Foreground="{DynamicResource SystemControlBackgroundAccentBrush}"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
AutomationProperties.Name="{x:Static props:Resources.OpenSettings}"
ToolTip="{x:Static props:Resources.OpenSettings}"
Style="{StaticResource IconOnlyButtonStyle}">
<Button.Content>
<TextBlock Text="&#xe713;"
FontFamily="Segoe MDL2 Assets"
AutomationProperties.Name="{x:Static props:Resources.OpenSettings}" />
</Button.Content>
</Button>
</Grid> </Grid>
<ui:ContentDialog x:Name="EditLayoutDialog" <ui:ContentDialog x:Name="EditLayoutDialog"

View File

@@ -4,6 +4,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Windows; using System.Windows;
using System.Windows.Automation; using System.Windows.Automation;
using System.Windows.Automation.Peers; using System.Windows.Automation.Peers;
@@ -516,5 +518,18 @@ namespace FancyZonesEditor
var numberBoxTextBox = numberBox.Template.FindName(numberBoxTextBoxName, numberBox) as TextBox; var numberBoxTextBox = numberBox.Template.FindName(numberBoxTextBoxName, numberBox) as TextBox;
numberBoxTextBox.SetValue(AutomationProperties.NameProperty, numberBox.GetValue(AutomationProperties.NameProperty)); numberBoxTextBox.SetValue(AutomationProperties.NameProperty, numberBox.GetValue(AutomationProperties.NameProperty));
} }
private void SettingsBtn_Click(object sender, RoutedEventArgs e)
{
try
{
var assemblyPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
var fullPath = Directory.GetParent(assemblyPath).FullName;
Process.Start(new ProcessStartInfo(fullPath + "\\..\\PowerToys.exe") { Arguments = "--open-settings=FancyZones" });
}
catch
{
}
}
} }
} }

View File

@@ -596,6 +596,15 @@ namespace FancyZonesEditor.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Open settings.
/// </summary>
public static string OpenSettings {
get {
return ResourceManager.GetString("OpenSettings", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to px. /// Looks up a localized string similar to px.
/// </summary> /// </summary>

View File

@@ -374,7 +374,10 @@
<data name="Edit_Layout" xml:space="preserve"> <data name="Edit_Layout" xml:space="preserve">
<value>Edit layout</value> <value>Edit layout</value>
</data> </data>
<data name="Layout_Creation_Announce" xml:space="preserve"> <data name="Layout_Creation_Announce" xml:space="preserve">
<value>custom layout was created successfully.</value> <value>custom layout was created successfully.</value>
</data> </data>
<data name="OpenSettings" xml:space="preserve">
<value>Open settings</value>
</data>
</root> </root>