mirror of
https://github.com/wagesj45/butterflow-ui.git
synced 2024-11-13 21:33:34 -06:00
Incremental commit
This commit is contained in:
parent
9f376941de
commit
573ce727c0
9 changed files with 166 additions and 32 deletions
|
@ -7,6 +7,7 @@
|
|||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Controls.xaml" />
|
||||
<ResourceDictionary Source="Icons.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
|
|
@ -12,29 +12,26 @@ namespace butterflow_ui
|
|||
{
|
||||
#region Properties
|
||||
|
||||
/// <summary> Gets or sets the label value. </summary>
|
||||
/// <value> The label value. </value>
|
||||
public string LabelValue { get; set; }
|
||||
|
||||
/// <summary> Gets or sets the description value. </summary>
|
||||
/// <value> The description value. </value>
|
||||
public string DescriptionValue { get; set; }
|
||||
|
||||
public Visibility ToolTipVisibility
|
||||
{
|
||||
get
|
||||
{
|
||||
//return string.IsNullOrWhiteSpace(this.DescriptionValue) ? Visibility.Hidden : Visibility.Visible;
|
||||
return Visibility.Hidden;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Dependency Properties
|
||||
|
||||
/// <summary> The label value property. </summary>
|
||||
public static DependencyProperty LabelValueProperty = DependencyProperty.Register("LabelValue", typeof(string), typeof(ButterflowOption));
|
||||
/// <summary> The description value property. </summary>
|
||||
public static DependencyProperty DescriptionValueProperty = DependencyProperty.Register("DescriptionValue", typeof(string), typeof(ButterflowOption));
|
||||
public static DependencyProperty ToolTipVisibilityProperty = DependencyProperty.Register("ToolTipVisibility", typeof(Visibility), typeof(ButterflowOption));
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary> Default constructor. </summary>
|
||||
public ButterflowOption()
|
||||
{
|
||||
//
|
||||
|
|
|
@ -13,16 +13,11 @@
|
|||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Column="0" Name="Label" VerticalAlignment="Center" Content="{TemplateBinding LabelValue}" />
|
||||
<ContentControl Grid.Column="1" Name="ContentArea" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
|
||||
<Viewbox Grid.Column="2" Name="InfoBox" Margin="2,0,2,0" Width="16" ToolTip="{TemplateBinding DescriptionValue}">
|
||||
<Canvas Name="InfoIcon" Width="24" Height="24">
|
||||
<Ellipse xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Canvas.Left="1.4" Canvas.Top="1.4" Width="21.2" Height="21.2" Name="path4524" Fill="#FF0F5777" StrokeThickness="4.02519703" StrokeMiterLimit="4" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Opacity="1"/>
|
||||
<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FFFFFFFF">
|
||||
<Path.Data>
|
||||
<PathGeometry Figures="M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-.001 5.75c.69 0 1.251.56 1.251 1.25s-.561 1.25-1.251 1.25-1.249-.56-1.249-1.25.559-1.25 1.249-1.25zm2.001 12.25h-4v-1c.484-.179 1-.201 1-.735v-4.467c0-.534-.516-.618-1-.797v-1h3v6.265c0 .535.517.558 1 .735v.999z" FillRule="EvenOdd"/>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
<ContentControl Template="{DynamicResource InfoIcon}" Grid.Column="2" Name="InfoBox" Margin="2,0,2,0" Width="16">
|
||||
<ContentControl.ToolTip>
|
||||
<ToolTip Style="{DynamicResource wrappedToolTip}" Content="{TemplateBinding DescriptionValue}"/>
|
||||
</ContentControl.ToolTip>
|
||||
</ContentControl>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="DescriptionValue" Value="{x:Null}">
|
||||
|
@ -39,4 +34,20 @@
|
|||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="{x:Type local:ButterflowOption}" BasedOn="{StaticResource butterFlowOptionStyle}" />
|
||||
<Style TargetType="ToolTip" x:Key="wrappedToolTip">
|
||||
<Setter Property="MaxWidth" Value="300" />
|
||||
<Setter Property="ContentTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<ContentPresenter Content="{TemplateBinding Content}">
|
||||
<ContentPresenter.Resources>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
</ContentPresenter.Resources>
|
||||
</ContentPresenter>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
34
butterflow-ui/Icons.xaml
Normal file
34
butterflow-ui/Icons.xaml
Normal file
|
@ -0,0 +1,34 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:butterflow_ui">
|
||||
<ControlTemplate x:Key="InfoIcon">
|
||||
<Viewbox>
|
||||
<Canvas Width="24" Height="24">
|
||||
<Ellipse Canvas.Left="1.4" Canvas.Top="1.4" Width="21.2" Height="21.2" Fill="#FF0F5777" StrokeThickness="4.02519703" StrokeMiterLimit="4" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Opacity="1"/>
|
||||
<Path Fill="#FFFFFFFF">
|
||||
<Path.Data>
|
||||
<PathGeometry Figures="M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-.001 5.75c.69 0 1.251.56 1.251 1.25s-.561 1.25-1.251 1.25-1.249-.56-1.249-1.25.559-1.25 1.249-1.25zm2.001 12.25h-4v-1c.484-.179 1-.201 1-.735v-4.467c0-.534-.516-.618-1-.797v-1h3v6.265c0 .535.517.558 1 .735v.999z" FillRule="Nonzero"/>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</ControlTemplate>
|
||||
<ControlTemplate x:Key="LinkIcon">
|
||||
<Viewbox>
|
||||
<Path Fill="#000000">
|
||||
<Path.Data>
|
||||
<PathGeometry Figures="M6.188 8.719c.439-.439.926-.801 1.444-1.087 2.887-1.591 6.589-.745 8.445 2.069l-2.246 2.245c-.644-1.469-2.243-2.305-3.834-1.949-.599.134-1.168.433-1.633.898l-4.304 4.306c-1.307 1.307-1.307 3.433 0 4.74 1.307 1.307 3.433 1.307 4.74 0l1.327-1.327c1.207.479 2.501.67 3.779.575l-2.929 2.929c-2.511 2.511-6.582 2.511-9.093 0s-2.511-6.582 0-9.093l4.304-4.306zm6.836-6.836l-2.929 2.929c1.277-.096 2.572.096 3.779.574l1.326-1.326c1.307-1.307 3.433-1.307 4.74 0 1.307 1.307 1.307 3.433 0 4.74l-4.305 4.305c-1.311 1.311-3.44 1.3-4.74 0-.303-.303-.564-.68-.727-1.051l-2.246 2.245c.236.358.481.667.796.982.812.812 1.846 1.417 3.036 1.704 1.542.371 3.194.166 4.613-.617.518-.286 1.005-.648 1.444-1.087l4.304-4.305c2.512-2.511 2.512-6.582.001-9.093-2.511-2.51-6.581-2.51-9.092 0z" FillRule="NonZero"/>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
</Viewbox>
|
||||
</ControlTemplate>
|
||||
<ControlTemplate x:Key="QuestionIcon">
|
||||
<Viewbox>
|
||||
<Path Fill="#000000">
|
||||
<Path.Data>
|
||||
<PathGeometry Figures="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm0 22c-5.514 0-10-4.486-10-10s4.486-10 10-10 10 4.486 10 10-4.486 10-10 10zm0-18.8c-4.853 0-8.8 3.947-8.8 8.8s3.947 8.8 8.8 8.8 8.8-3.947 8.8-8.8-3.947-8.8-8.8-8.8zm0 15.05c-.689 0-1.25-.56-1.25-1.25s.561-1.25 1.25-1.25c.691 0 1.25.56 1.25 1.25s-.559 1.25-1.25 1.25zm1.961-5.928c-.904.975-.947 1.514-.935 2.178h-2.005c-.007-1.475.02-2.125 1.432-3.468.572-.544 1.024-.975.962-1.821-.058-.805-.73-1.226-1.364-1.226-.709 0-1.538.527-1.538 2.013h-2.011c0-2.4 1.41-3.95 3.59-3.95 1.036 0 1.942.339 2.551.955.57.578.865 1.372.854 2.298-.018 1.383-.859 2.291-1.536 3.021z" FillRule="NonZero"/>
|
||||
</Path.Data>
|
||||
</Path>
|
||||
</Viewbox>
|
||||
</ControlTemplate>
|
||||
</ResourceDictionary>
|
56
butterflow-ui/Localization/Localization.Designer.cs
generated
56
butterflow-ui/Localization/Localization.Designer.cs
generated
|
@ -123,6 +123,33 @@ namespace butterflow_ui.Localization {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to More about butterflow....
|
||||
/// </summary>
|
||||
public static string AboutButterflowMenu {
|
||||
get {
|
||||
return ResourceManager.GetString("AboutButterflowMenu", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to More about butterflow-ui....
|
||||
/// </summary>
|
||||
public static string AboutButterflowUIMenu {
|
||||
get {
|
||||
return ResourceManager.GetString("AboutButterflowUIMenu", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to About butterflow-ui.
|
||||
/// </summary>
|
||||
public static string AboutMenu {
|
||||
get {
|
||||
return ResourceManager.GetString("AboutMenu", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Advanced Options.
|
||||
/// </summary>
|
||||
|
@ -150,6 +177,15 @@ namespace butterflow_ui.Localization {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to _Edit.
|
||||
/// </summary>
|
||||
public static string EditMenu {
|
||||
get {
|
||||
return ResourceManager.GetString("EditMenu", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Input.
|
||||
/// </summary>
|
||||
|
@ -168,6 +204,15 @@ namespace butterflow_ui.Localization {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to _File.
|
||||
/// </summary>
|
||||
public static string FileMenu {
|
||||
get {
|
||||
return ResourceManager.GetString("FileMenu", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Height.
|
||||
/// </summary>
|
||||
|
@ -177,6 +222,15 @@ namespace butterflow_ui.Localization {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to _Help.
|
||||
/// </summary>
|
||||
public static string HelpMenu {
|
||||
get {
|
||||
return ResourceManager.GetString("HelpMenu", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Renders the output video with the audio from the original video. In unchecked, no sound will be included in the output video..
|
||||
/// </summary>
|
||||
|
@ -214,7 +268,7 @@ namespace butterflow_ui.Localization {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Some description of playback rate goes here..
|
||||
/// Looks up a localized string similar to Controls the new framerate of the output video. This can be set in both absolute and relative terms..
|
||||
/// </summary>
|
||||
public static string PlaybackRateDescription {
|
||||
get {
|
||||
|
|
|
@ -117,6 +117,15 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="AboutButterflowMenu" xml:space="preserve">
|
||||
<value>More about butterflow...</value>
|
||||
</data>
|
||||
<data name="AboutButterflowUIMenu" xml:space="preserve">
|
||||
<value>More about butterflow-ui...</value>
|
||||
</data>
|
||||
<data name="AboutMenu" xml:space="preserve">
|
||||
<value>About butterflow-ui</value>
|
||||
</data>
|
||||
<data name="AdvancedOptionsGroupBox" xml:space="preserve">
|
||||
<value>Advanced Options</value>
|
||||
</data>
|
||||
|
@ -126,15 +135,24 @@
|
|||
<data name="CustomPlaybackRateLabel" xml:space="preserve">
|
||||
<value>Custom Rate</value>
|
||||
</data>
|
||||
<data name="EditMenu" xml:space="preserve">
|
||||
<value>_Edit</value>
|
||||
</data>
|
||||
<data name="FileInputGroupBox" xml:space="preserve">
|
||||
<value>Input</value>
|
||||
</data>
|
||||
<data name="FileLabel" xml:space="preserve">
|
||||
<value>Video File</value>
|
||||
</data>
|
||||
<data name="FileMenu" xml:space="preserve">
|
||||
<value>_File</value>
|
||||
</data>
|
||||
<data name="HeightLabel" xml:space="preserve">
|
||||
<value>Height</value>
|
||||
</data>
|
||||
<data name="HelpMenu" xml:space="preserve">
|
||||
<value>_Help</value>
|
||||
</data>
|
||||
<data name="KeepAudioDescription" xml:space="preserve">
|
||||
<value>Renders the output video with the audio from the original video. In unchecked, no sound will be included in the output video.</value>
|
||||
</data>
|
||||
|
@ -148,7 +166,7 @@
|
|||
<value>Lossless Quality</value>
|
||||
</data>
|
||||
<data name="PlaybackRateDescription" xml:space="preserve">
|
||||
<value>Some description of playback rate goes here.</value>
|
||||
<value>Controls the new framerate of the output video. This can be set in both absolute and relative terms.</value>
|
||||
</data>
|
||||
<data name="PlaybackRateLabel" xml:space="preserve">
|
||||
<value>Playback Rate</value>
|
||||
|
|
|
@ -10,17 +10,29 @@
|
|||
Title="{x:Static loc:Localization.Title}" Height="600" Width="800">
|
||||
<DockPanel>
|
||||
<Menu DockPanel.Dock="Top">
|
||||
<MenuItem Header="_File">
|
||||
<MenuItem Header="Derp" />
|
||||
<MenuItem Header="Darp" />
|
||||
<MenuItem Header="Dorp" />
|
||||
<MenuItem Header="{x:Static loc:Localization.FileMenu}">
|
||||
<MenuItem Header="Open" />
|
||||
<MenuItem Header="Save Configuration" />
|
||||
<MenuItem Header="Save Configuration As..." />
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Edit" />
|
||||
<MenuItem Header="_Help">
|
||||
<MenuItem Header="More about butterflow..." />
|
||||
<MenuItem Header="More about butterflow-ui..." />
|
||||
<MenuItem Header="{x:Static loc:Localization.EditMenu}" />
|
||||
<MenuItem Header="{x:Static loc:Localization.HelpMenu}">
|
||||
<MenuItem Header="{x:Static loc:Localization.AboutButterflowMenu}" >
|
||||
<MenuItem.Icon>
|
||||
<ContentControl Template="{StaticResource LinkIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{x:Static loc:Localization.AboutButterflowUIMenu}">
|
||||
<MenuItem.Icon>
|
||||
<ContentControl Template="{StaticResource LinkIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="About" />
|
||||
<MenuItem Header="{x:Static loc:Localization.AboutMenu}">
|
||||
<MenuItem.Icon>
|
||||
<ContentControl Template="{StaticResource QuestionIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
<Grid>
|
||||
|
@ -99,7 +111,7 @@
|
|||
<TextBox Text="{Binding OptionsConfiguration.Width, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</butterflow_ui:ButterflowOption>
|
||||
<butterflow_ui:ButterflowOption Grid.Column="1" LabelValue="{x:Static loc:Localization.HeightLabel}">
|
||||
<TextBox Text="{Binding OptionsConfiguration.Height, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}}" />
|
||||
<TextBox Text="{Binding OptionsConfiguration.Height, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type butterflow_ui:MainWindow}}, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</butterflow_ui:ButterflowOption>
|
||||
</Grid>
|
||||
</butterflow_ui:ButterflowOption>
|
||||
|
|
|
@ -49,6 +49,9 @@ namespace butterflow_ui
|
|||
{
|
||||
txtFileName.Text = ofd.FileName;
|
||||
mediaPreview.Source = new Uri(ofd.FileName);
|
||||
this.OptionsConfiguration.Width = mediaPreview.NaturalVideoWidth.ToString();
|
||||
this.OptionsConfiguration.Height = mediaPreview.NaturalVideoHeight.ToString();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,10 @@
|
|||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Icons.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Controls.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
|
Loading…
Reference in a new issue