-
This commit is contained in:
24
mpvSettingsEditor/DynamicGUI/Controls.cs
Normal file
24
mpvSettingsEditor/DynamicGUI/Controls.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
namespace DynamicGUI
|
||||
{
|
||||
public class HyperlinkEx : Hyperlink
|
||||
{
|
||||
private void HyperLinkEx_RequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
Process.Start(e.Uri.AbsoluteUri);
|
||||
}
|
||||
|
||||
public void SetURL(string url)
|
||||
{
|
||||
if (string.IsNullOrEmpty(url)) return;
|
||||
NavigateUri = new Uri(url);
|
||||
RequestNavigate += HyperLinkEx_RequestNavigate;
|
||||
Inlines.Clear();
|
||||
Inlines.Add(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,6 +47,7 @@ namespace DynamicGUI
|
||||
|
||||
baseSetting.Name = setting["name"];
|
||||
if (setting.HasKey("help")) baseSetting.Help = setting["help"];
|
||||
if (setting.HasKey("helpurl")) baseSetting.HelpURL = setting["helpurl"];
|
||||
if (setting.HasKey("alias")) baseSetting.Alias = setting["alias"];
|
||||
if (setting.HasKey("width")) baseSetting.Width = setting["width"];
|
||||
settingsList.Add(baseSetting);
|
||||
@@ -93,8 +94,6 @@ namespace DynamicGUI
|
||||
set => _Text = value;
|
||||
}
|
||||
|
||||
//private bool _IsChecked;
|
||||
|
||||
public bool IsChecked
|
||||
{
|
||||
get => OptionSetting.Value == Name ;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid Margin="20,0">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<TextBox x:Name="TitleTextBox" FontSize="20" Margin="0,0,0,10" BorderThickness="0" IsReadOnly="True"></TextBox>
|
||||
<TextBox x:Name="TitleTextBox" FontSize="24" Margin="0,10" BorderThickness="0" IsReadOnly="True"></TextBox>
|
||||
<ItemsControl x:Name="ItemsControl">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -19,7 +19,10 @@
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBox x:Name="HelpTextBox" TextWrapping="WrapWithOverflow" Margin="0,10" BorderThickness="0" IsReadOnly="True" Padding="0"></TextBox>
|
||||
<TextBox x:Name="HelpTextBox" TextWrapping="WrapWithOverflow" BorderThickness="0" IsReadOnly="True" Margin="0,10,0,0"></TextBox>
|
||||
<TextBlock Margin="0,10,0,0">
|
||||
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,5 +1,4 @@
|
||||
using DynamicGUI;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace DynamicGUI
|
||||
{
|
||||
@@ -14,6 +13,7 @@ namespace DynamicGUI
|
||||
TitleTextBox.Text = optionSetting.Name;
|
||||
HelpTextBox.Text = optionSetting.Help;
|
||||
ItemsControl.ItemsSource = optionSetting.Options;
|
||||
Link.SetURL(optionSetting.HelpURL);
|
||||
}
|
||||
|
||||
private string _SearchableText;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
d:DesignWidth="800" >
|
||||
<Grid Margin="20,0">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<TextBox x:Name="TitleTextBox" FontSize="20" Margin="0,0,0,10" BorderThickness="0" IsReadOnly="True"></TextBox>
|
||||
<TextBox x:Name="TitleTextBox" FontSize="24" Margin="0,0,0,10" BorderThickness="0" IsReadOnly="True"></TextBox>
|
||||
<Grid Margin="0,0,0,10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
||||
Reference in New Issue
Block a user