newly developed combo box control
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
|
||||
# v7.0.0.4 Beta (2023-??-??)
|
||||
|
||||
- The conf editor uses a newly developed combo box control instead of radio buttons
|
||||
whenever an option has more than 3 items.
|
||||
- New zhongfly libmpv build.
|
||||
|
||||
|
||||
# v7.0.0.3 Beta (2023-12-15)
|
||||
|
||||
- New conf editor option `Video/libplacebo/preset`.
|
||||
|
||||
@@ -53,6 +53,7 @@ public class Conf
|
||||
if (section.HasName("help")) baseSetting.Help = section.GetValue("help");
|
||||
if (section.HasName("url")) baseSetting.URL = section.GetValue("url");
|
||||
if (section.HasName("width")) baseSetting.Width = Convert.ToInt32(section.GetValue("width"));
|
||||
if (section.HasName("option-name-width")) baseSetting.OptionNameWidth = Convert.ToInt32(section.GetValue("option-name-width"));
|
||||
if (section.HasName("type")) baseSetting.Type = section.GetValue("type");
|
||||
|
||||
if (baseSetting.Help.ContainsEx("\\n"))
|
||||
|
||||
@@ -3,7 +3,7 @@ name = process-instance
|
||||
file = mpvnet
|
||||
default = single
|
||||
directory = General
|
||||
help = Defines if more then one mpv.net process is allowed. (mpv.net option)\n\nMulti can alternatively be enabled by pressing the SHIFT key.
|
||||
help = Defines if more then one mpv.net process is allowed.\nMulti can alternatively be enabled by pressing the SHIFT key. (mpv.net option)
|
||||
option = multi Create a new process everytime the shell starts mpv.net
|
||||
option = single Force a single process everytime the shell starts mpv.net
|
||||
option = queue Force a single process and add files to playlist
|
||||
@@ -73,14 +73,14 @@ option = auto enable best hw decoder
|
||||
option = yes exactly the same as auto
|
||||
option = auto-copy enable best hw decoder with copy-back
|
||||
option = auto-safe enable any whitelisted hw decoder
|
||||
option = dxva2 requires vo=gpu with gpu-context=d3d11, gpu-context=angle or gpu-context=dxinterop (Windows only)
|
||||
option = dxva2-copy copies video back to system RAM (Windows only)
|
||||
option = d3d11va requires vo=gpu with gpu-context=d3d11 or gpu-context=angle (Windows 8+ only)
|
||||
option = d3d11va-copy copies video back to system RAM (Windows 8+ only)
|
||||
option = dxva2 requires vo=gpu with gpu-context=d3d11, gpu-context=angle or gpu-context=dxinterop
|
||||
option = dxva2-copy copies video back to system RAM
|
||||
option = d3d11va requires vo=gpu with gpu-context=d3d11 or gpu-context=angle
|
||||
option = d3d11va-copy copies video back to system RAM
|
||||
option = cuda requires vo=gpu (Any platform CUDA is available)
|
||||
option = cuda-copy copies video back to system RAM (Any platform CUDA is available)
|
||||
option = cuda-copy copies video back to system RAM
|
||||
option = nvdec requires vo=gpu (Any platform CUDA is available)
|
||||
option = nvdec-copy copies video back to system RAM (Any platform CUDA is available)
|
||||
option = nvdec-copy copies video back to system RAM
|
||||
|
||||
name = gpu-api
|
||||
file = mpv
|
||||
@@ -122,48 +122,51 @@ name = d3d11va-zero-copy
|
||||
file = mpv
|
||||
default = no
|
||||
directory = Video
|
||||
help = By default, when using hardware decoding with --gpu-api=d3d11, the video image will be copied (GPU-to-GPU) from the decoder surface to a shader resource. Set this option to avoid that copy by sampling directly from the decoder image. This may increase performance and reduce power usage, but can cause the image to be sampled incorrectly on the bottom and right edges due to padding, and may invoke driver bugs, since Direct3D 11 technically does not allow sampling from a decoder surface (though most drivers support it.)
|
||||
url = https://mpv.io/manual/master/#options-d3d11va-zero-copy
|
||||
option = yes
|
||||
option = no
|
||||
|
||||
name = scale
|
||||
file = mpv
|
||||
default = bilinear
|
||||
default = lanczos
|
||||
directory = Video/Render Options
|
||||
help = The GPU renderer filter function to use when upscaling video. There are some more filters, but most are not as useful. For a complete list, pass help as value, e.g.: mpv --scale=help
|
||||
option = bilinear Bilinear hardware texture filtering (fastest, very low quality).
|
||||
option = spline36 Mid quality and speed. This is the default when using gpu-hq.
|
||||
option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc)
|
||||
option = ewa_lanczos Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc)
|
||||
option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default.
|
||||
option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale).
|
||||
option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale).
|
||||
url = https://mpv.io/manual/master/#options-scale
|
||||
option = bilinear
|
||||
option = spline36
|
||||
option = lanczos
|
||||
option = ewa_lanczos
|
||||
option = ewa_lanczossharp
|
||||
option = mitchell
|
||||
option = oversample
|
||||
|
||||
name = cscale
|
||||
file = mpv
|
||||
default = bilinear
|
||||
directory = Video/Render Options
|
||||
help = As scale, but for interpolating chroma information. If the image is not subsampled, this option is ignored entirely.
|
||||
option = bilinear Bilinear hardware texture filtering (fastest, very low quality).
|
||||
option = spline36 Mid quality and speed. This is the default when using gpu-hq.
|
||||
option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc)
|
||||
option = ewa_lanczos Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc)
|
||||
option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default.
|
||||
option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale).
|
||||
option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale).
|
||||
url = https://mpv.io/manual/master/#options-cscale
|
||||
option = bilinear
|
||||
option = spline36
|
||||
option = lanczos
|
||||
option = ewa_lanczos
|
||||
option = ewa_lanczossharp
|
||||
option = mitchell
|
||||
option = oversample
|
||||
|
||||
name = dscale
|
||||
file = mpv
|
||||
default =
|
||||
default = lanczos
|
||||
directory = Video/Render Options
|
||||
help = Like scale, but apply these filters on downscaling instead. \nIf no option is selected, it will keep the same with the upscaler.
|
||||
option = bilinear Bilinear hardware texture filtering (fastest, very low quality).
|
||||
option = spline36 Mid quality and speed. This is the default when using gpu-hq.
|
||||
option = lanczos Lanczos scaling. Provides mid quality and speed. Generally worse than spline36, but it results in a slightly sharper image which is good for some content types. The number of taps can be controlled with scale-radius, but is best left unchanged. (This filter is an alias for sinc-windowed sinc)
|
||||
option = ewa_lanczos Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing. (This filter is an alias for jinc-windowed jinc)
|
||||
option = ewa_lanczossharp A slightly sharpened version of ewa_lanczos, preconfigured to use an ideal radius and parameter. If your hardware can run it, this is probably what you should use by default.
|
||||
option = mitchell Mitchell-Netravali. The B and C parameters can be set with scale-param1 and scale-param2. This filter is very good at downscaling (see dscale).
|
||||
option = oversample A version of nearest neighbour that (naively) oversamples pixels, so that pixels overlapping edges get linearly interpolated instead of rounded. This essentially removes the small imperfections and judder artifacts caused by nearest-neighbour interpolation, in exchange for adding some blur. This filter is good at temporal interpolation, and also known as "smoothmotion" (see tscale).
|
||||
url = https://mpv.io/manual/master/#options-dscale
|
||||
option = bilinear
|
||||
option = spline36
|
||||
option = lanczos
|
||||
option = ewa_lanczos
|
||||
option = ewa_lanczossharp
|
||||
option = mitchell
|
||||
option = oversample
|
||||
|
||||
name = dither-depth
|
||||
file = mpv
|
||||
@@ -203,7 +206,7 @@ name = hdr-compute-peak
|
||||
file = mpv
|
||||
default = auto
|
||||
directory = Video/Render Options
|
||||
help = Compute the HDR peak and frame average brightness per-frame instead of relying on tagged metadata. These values are averaged over local regions as well as over several frames to prevent the value from jittering around too much. This option basically gives you dynamic, per-scene tone mapping. Requires compute shaders, which is a fairly recent OpenGL feature, and will probably also perform horribly on some drivers, so enable at your own risk. The special value auto (default) will enable HDR peak computation automatically if compute shaders and SSBOs are supported.
|
||||
url = https://mpv.io/manual/master/#options-hdr-compute-peak
|
||||
option = auto
|
||||
option = yes
|
||||
option = no
|
||||
@@ -212,7 +215,7 @@ name = allow-delayed-peak-detect
|
||||
file = mpv
|
||||
default = yes
|
||||
directory = Video/Render Options
|
||||
help = When using --hdr-compute-peak, allow delaying the detected peak by a frame when beneficial for performance. In particular, this is required to avoid an unnecessary FBO indirection when no advanced rendering is required otherwise. Has no effect if there already is an indirect pass, such as when advanced scaling is enabled. (Only affects --vo=gpu-next, note that --vo=gpu always delays the peak.)
|
||||
url = https://mpv.io/manual/master/#options-allow-delayed-peak-detect
|
||||
option = yes
|
||||
option = no
|
||||
|
||||
@@ -242,6 +245,7 @@ directory = Video/libplacebo/Scaling
|
||||
default = default
|
||||
help = Sets the filter used for upscaling. Defaults to lanczos.
|
||||
url = https://libplacebo.org/options/#upscalerfilter
|
||||
option-name-width = 135
|
||||
option = default Default.
|
||||
option = none No filter, only use basic GPU texture sampling.
|
||||
option = nearest Nearest-neighbour (box) sampling (very fast).
|
||||
@@ -260,7 +264,7 @@ file = mpv
|
||||
width = 500
|
||||
type = folder
|
||||
directory = Video/Screenshot
|
||||
help = Store screenshots in this directory. This path is joined with the filename generated by screenshot-template. If the template filename is already absolute, the directory is ignored.\n\nIf the directory does not exist, it is created on the first screenshot. If it is not a directory, an error is generated when trying to write a screenshot.
|
||||
help = Store screenshots in this directory. This path is joined with the filename generated by screenshot-template. If the template filename is already absolute, the directory is ignored.
|
||||
|
||||
name = screenshot-format
|
||||
file = mpv
|
||||
@@ -333,7 +337,7 @@ name = alang
|
||||
file = mpv
|
||||
directory = Audio
|
||||
type = string
|
||||
help = Specify a priority list of audio languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two-letter language codes, Matroska, MPEG-TS and NUT use ISO 639-2 three-letter language codes, while OGM uses a free-form identifier. See also aid.\n\nExamples\n\nmpv dvd://1 alang=hu,en chooses the Hungarian language track on a DVD and falls back on English if Hungarian is not available.\n\nmpv alang=jpn example.mkv plays a Matroska file with Japanese audio.
|
||||
help = Specify a priority list of audio languages to use. Different container formats employ different language codes. DVDs use ISO 639-1 two-letter language codes, Matroska, MPEG-TS and NUT use ISO 639-2 three-letter language codes, while OGM uses a free-form identifier. See also aid.
|
||||
|
||||
name = audio-file-auto
|
||||
file = mpv
|
||||
|
||||
@@ -16,6 +16,7 @@ public abstract class Setting
|
||||
public string? Value { get; set; }
|
||||
|
||||
public int Width { get; set; }
|
||||
public int OptionNameWidth { get; set; } = 100;
|
||||
|
||||
public ConfItem? ConfItem { get; set; }
|
||||
}
|
||||
@@ -35,12 +36,13 @@ public class OptionSettingOption
|
||||
|
||||
public string? Name { get; set; }
|
||||
public string? Help { get; set; }
|
||||
public int OptionWidth { get => OptionSetting!.OptionNameWidth; }
|
||||
|
||||
public OptionSetting? OptionSetting { get; set; }
|
||||
|
||||
public string? Text
|
||||
{
|
||||
get => string.IsNullOrEmpty(_text) ? Name : _text;
|
||||
get => _text ?? Name;
|
||||
set => _text = value;
|
||||
}
|
||||
|
||||
|
||||
18
src/MpvNet.Windows/WPF/ComboBoxTemplateSelector.cs
Normal file
18
src/MpvNet.Windows/WPF/ComboBoxTemplateSelector.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
using System.Windows.Controls;
|
||||
using System.Windows;
|
||||
|
||||
namespace MpvNet.Windows.WPF;
|
||||
|
||||
public class ComboBoxTemplateSelector : DataTemplateSelector
|
||||
{
|
||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||
{
|
||||
ContentPresenter presenter = (ContentPresenter)container;
|
||||
|
||||
if (presenter.TemplatedParent is ComboBox)
|
||||
return (DataTemplate)presenter.FindResource("ComboBoxCollapsedDataTemplate");
|
||||
else // Templated parent is ComboBoxItem
|
||||
return (DataTemplate)presenter.FindResource("ComboBoxExpandedDataTemplate");
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,10 @@ public partial class ConfWindow : Window, INotifyPropertyChanged
|
||||
MainStackPanel.Children.Add(new StringSettingControl(s) { Visibility = Visibility.Collapsed });
|
||||
break;
|
||||
case OptionSetting s:
|
||||
MainStackPanel.Children.Add(new OptionSettingControl(s) { Visibility = Visibility.Collapsed });
|
||||
if (s.Options.Count > 3)
|
||||
MainStackPanel.Children.Add(new ComboBoxSettingControl(s) { Visibility = Visibility.Collapsed });
|
||||
else
|
||||
MainStackPanel.Children.Add(new OptionSettingControl(s) { Visibility = Visibility.Collapsed });
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
72
src/MpvNet.Windows/WPF/Controls/ComboBoxSettingControl.xaml
Normal file
72
src/MpvNet.Windows/WPF/Controls/ComboBoxSettingControl.xaml
Normal file
@@ -0,0 +1,72 @@
|
||||
<UserControl
|
||||
x:Name="ComboBoxSettingControl1"
|
||||
x:Class="MpvNet.Windows.WPF.ComboBoxSettingControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:MpvNet.Windows.WPF"
|
||||
mc:Ignorable="d"
|
||||
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800">
|
||||
|
||||
<Grid Margin="20,0">
|
||||
<StackPanel>
|
||||
<TextBox
|
||||
x:Name="TitleTextBox"
|
||||
FontSize="24"
|
||||
Margin="0,10"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Foreground="{Binding Theme.Heading}"
|
||||
Background="{Binding Theme.Background}"
|
||||
/>
|
||||
|
||||
<ComboBox
|
||||
Name="ComboBoxControl"
|
||||
Width="200"
|
||||
HorizontalAlignment="Left"
|
||||
MaxDropDownHeight="2000"
|
||||
Foreground="{Binding Theme.Foreground}"
|
||||
Background="{Binding Theme.Background}"
|
||||
|
||||
SelectionChanged="ComboBoxControl_SelectionChanged"
|
||||
>
|
||||
<ComboBox.ItemTemplateSelector>
|
||||
<local:ComboBoxTemplateSelector/>
|
||||
</ComboBox.ItemTemplateSelector>
|
||||
|
||||
<ComboBox.ItemContainerStyle>
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Style.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="3"/>
|
||||
</Style>
|
||||
</Style.Resources>
|
||||
</Style>
|
||||
</ComboBox.ItemContainerStyle>
|
||||
</ComboBox>
|
||||
|
||||
<TextBox
|
||||
x:Name="HelpTextBox"
|
||||
TextWrapping="WrapWithOverflow"
|
||||
BorderThickness="0"
|
||||
IsReadOnly="True"
|
||||
Margin="0,10,0,0"
|
||||
Foreground="{Binding Theme.Foreground}"
|
||||
Background="{Binding Theme.Background}"
|
||||
/>
|
||||
|
||||
<TextBlock
|
||||
x:Name="LinkTextBlock"
|
||||
Margin="2,0"
|
||||
>
|
||||
<local:HyperlinkEx
|
||||
x:Name="Link"
|
||||
Foreground="{Binding Theme.Heading}"
|
||||
/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,69 @@
|
||||
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
using MpvNet.Windows.UI;
|
||||
|
||||
namespace MpvNet.Windows.WPF;
|
||||
|
||||
public partial class ComboBoxSettingControl : UserControl, ISettingControl
|
||||
{
|
||||
OptionSetting OptionSetting;
|
||||
|
||||
public ComboBoxSettingControl(OptionSetting optionSetting)
|
||||
{
|
||||
OptionSetting = optionSetting;
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
TitleTextBox.Text = optionSetting.Name;
|
||||
|
||||
if (string.IsNullOrEmpty(optionSetting.Help))
|
||||
HelpTextBox.Visibility = Visibility.Collapsed;
|
||||
|
||||
HelpTextBox.Text = optionSetting.Help;
|
||||
ComboBoxControl.ItemsSource = optionSetting.Options;
|
||||
|
||||
foreach (var item in optionSetting.Options)
|
||||
if (item.Name == optionSetting.Value)
|
||||
ComboBoxControl.SelectedItem = item;
|
||||
|
||||
if (string.IsNullOrEmpty(optionSetting.URL))
|
||||
LinkTextBlock.Visibility = Visibility.Collapsed;
|
||||
|
||||
Link.SetURL(optionSetting.URL);
|
||||
}
|
||||
|
||||
public Theme? Theme => Theme.Current;
|
||||
|
||||
public Setting Setting => OptionSetting;
|
||||
|
||||
public bool Contains(string searchString) => ContainsInternal(searchString.ToLower());
|
||||
|
||||
public bool ContainsInternal(string search)
|
||||
{
|
||||
if (TitleTextBox.Text.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
|
||||
return true;
|
||||
|
||||
if (HelpTextBox.Text.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
|
||||
return true;
|
||||
|
||||
foreach (var i in OptionSetting.Options)
|
||||
{
|
||||
if (i.Text?.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
|
||||
return true;
|
||||
|
||||
if (i.Help?.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
|
||||
return true;
|
||||
|
||||
if (i.Name?.IndexOf(search, StringComparison.InvariantCultureIgnoreCase) > -1)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ComboBoxControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
OptionSetting.Value = (ComboBoxControl.SelectedItem as OptionSettingOption)?.Name;
|
||||
}
|
||||
}
|
||||
@@ -65,9 +65,15 @@
|
||||
Foreground="{Binding Theme.Foreground}"
|
||||
Background="{Binding Theme.Background}"
|
||||
/>
|
||||
|
||||
<TextBlock x:Name="LinkTextBlock" Margin="0,10">
|
||||
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
||||
|
||||
<TextBlock
|
||||
x:Name="LinkTextBlock"
|
||||
Margin="2,0,0,0"
|
||||
>
|
||||
<local:HyperlinkEx
|
||||
x:Name="Link"
|
||||
Foreground="{Binding Theme.Heading}"
|
||||
/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -21,6 +21,10 @@ public partial class OptionSettingControl : UserControl, ISettingControl
|
||||
HelpTextBox.Visibility = Visibility.Collapsed;
|
||||
|
||||
HelpTextBox.Text = optionSetting.Help;
|
||||
|
||||
if (string.IsNullOrEmpty(optionSetting.Help))
|
||||
LinkTextBlock.Margin = new Thickness(2, 6, 0, 0);
|
||||
|
||||
ItemsControl.ItemsSource = optionSetting.Options;
|
||||
|
||||
if (string.IsNullOrEmpty(optionSetting.URL))
|
||||
|
||||
@@ -60,8 +60,14 @@
|
||||
Background="{Binding Theme.Background}"
|
||||
/>
|
||||
|
||||
<TextBlock x:Name="LinkTextBlock" Margin="0,10">
|
||||
<local:HyperlinkEx x:Name="Link"></local:HyperlinkEx>
|
||||
<TextBlock
|
||||
x:Name="LinkTextBlock"
|
||||
Margin="2,0"
|
||||
>
|
||||
<local:HyperlinkEx
|
||||
x:Name="Link"
|
||||
Foreground="{Binding Theme.Heading}"
|
||||
/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -6,6 +6,183 @@
|
||||
xmlns:local="clr-namespace:MpvNet.Windows.WPF"
|
||||
>
|
||||
|
||||
<DataTemplate x:Key="ComboBoxCollapsedDataTemplate" >
|
||||
<TextBlock Text="{Binding Text}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="ComboBoxExpandedDataTemplate" >
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Border>
|
||||
<TextBlock
|
||||
Text="{Binding Text}"
|
||||
Width="{Binding OptionWidth}"
|
||||
VerticalAlignment="Center"
|
||||
TextWrapping="Wrap"
|
||||
/>
|
||||
</Border>
|
||||
<Border>
|
||||
<TextBlock
|
||||
Text="{Binding Help}"
|
||||
MaxWidth="400"
|
||||
Padding="0,3"
|
||||
VerticalAlignment="Center"
|
||||
TextWrapping="Wrap"
|
||||
/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="32" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Grid.ColumnSpan="2"
|
||||
CornerRadius="3"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="1"
|
||||
/>
|
||||
|
||||
<Path
|
||||
x:Name="Arrow"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="M 1,1.5 L 4.5,5 L 8,1.5"
|
||||
SnapsToDevicePixels="false"
|
||||
Stroke="{TemplateBinding Foreground}"
|
||||
StrokeThickness="1.5"
|
||||
/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
|
||||
<Border x:Name="PART_ContentHost" Focusable="True" />
|
||||
</ControlTemplate>
|
||||
|
||||
<Style TargetType="{x:Type ComboBox}">
|
||||
<Setter Property="Foreground" Value="#333" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryTextBrush}" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="true"/>
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
||||
<Setter Property="FontSize" Value="13" />
|
||||
<Setter Property="MinWidth" Value="150"/>
|
||||
<Setter Property="MinHeight" Value="25"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<Grid>
|
||||
<ToggleButton
|
||||
Cursor="Hand"
|
||||
Name="ToggleButton"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Style="{StaticResource ComboBoxToggleButton}"
|
||||
Grid.Column="2"
|
||||
Focusable="false"
|
||||
IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ClickMode="Press"
|
||||
/>
|
||||
|
||||
<ContentPresenter
|
||||
Name="ContentSite"
|
||||
IsHitTestVisible="False"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
||||
Margin="10,3,30,3"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
/>
|
||||
|
||||
<TextBox
|
||||
x:Name="PART_EditableTextBox"
|
||||
Style="{x:Null}"
|
||||
Template="{StaticResource ComboBoxTextBox}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Margin="3,3,23,3"
|
||||
Focusable="True"
|
||||
Visibility="Hidden"
|
||||
IsReadOnly="{TemplateBinding IsReadOnly}"
|
||||
/>
|
||||
|
||||
<Popup
|
||||
Name="Popup"
|
||||
Placement="Bottom"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
AllowsTransparency="True"
|
||||
Focusable="False"
|
||||
PopupAnimation="Slide"
|
||||
>
|
||||
|
||||
<Grid
|
||||
Name="DropDown"
|
||||
SnapsToDevicePixels="True"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||
>
|
||||
|
||||
<Border
|
||||
CornerRadius="3"
|
||||
x:Name="DropDownBorder"
|
||||
Background="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ComboBox}}, Path=Background}"
|
||||
BorderBrush="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ComboBox}}, Path=Foreground}"
|
||||
BorderThickness="1"
|
||||
/>
|
||||
|
||||
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
|
||||
<StackPanel
|
||||
IsItemsHost="True"
|
||||
KeyboardNavigation.DirectionalNavigation="Contained" />
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Popup>
|
||||
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsGrouping" Value="true">
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEditable" Value="true">
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible"/>
|
||||
<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Opacity" Value="0.56"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="BorderBrush" Value="#FF7EB4EA"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsFocused" Value="true">
|
||||
<Setter Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Theme.Heading}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="local:HyperlinkEx">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
@@ -53,20 +230,23 @@
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TextBox">
|
||||
<Setter Property="MinHeight" Value="25" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TextBox}">
|
||||
<Border x:Name="border"
|
||||
BorderBrush="{DynamicResource PrimaryTextBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="3"
|
||||
SnapsToDevicePixels="True">
|
||||
<Border
|
||||
x:Name="border"
|
||||
BorderBrush="{DynamicResource PrimaryTextBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="3"
|
||||
SnapsToDevicePixels="True">
|
||||
|
||||
<ScrollViewer x:Name="PART_ContentHost"
|
||||
Focusable="false"
|
||||
HorizontalScrollBarVisibility="Hidden"
|
||||
VerticalScrollBarVisibility="Hidden"/>
|
||||
<ScrollViewer
|
||||
x:Name="PART_ContentHost"
|
||||
Focusable="false"
|
||||
HorizontalScrollBarVisibility="Hidden"
|
||||
VerticalScrollBarVisibility="Hidden"/>
|
||||
</Border>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -1042,5 +1222,5 @@
|
||||
<Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem"/>
|
||||
|
||||
<Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu"/>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user