diff options
author | sr55 <[email protected]> | 2013-09-03 17:01:14 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-09-03 17:01:14 +0000 |
commit | 2a344e45c4ed8f98e872066aa506512063d5ae51 (patch) | |
tree | 24ef953c10805458513d225eef58c2388e5c67ed /win/CS/HandBrakeWPF/Views | |
parent | bcb1dcedb04fabcde6475daa2d8c9bf01c128139 (diff) |
WinGui: Change the implementation of the Source Menu Image handling. Hopefully this might workaround a crash some people are seeing in the .NET BitmapDecoder object.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5765 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index c9d87f870..cb1fa7582 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -6,6 +6,7 @@ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
xmlns:attachedProperties="clr-namespace:HandBrakeWPF.AttachedProperties"
+ xmlns:handBrakeWpf="clr-namespace:HandBrakeWPF"
AllowDrop="True"
FontSize="11"
Micro:Message.Attach="[Event Loaded] = [Action Load]"
@@ -21,7 +22,7 @@ </i:EventTrigger>
</i:Interaction.Triggers>
- <UserControl.Resources>
+ <UserControl.Resources>
<Style TargetType="Button">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Padding" Value="5,1" />
@@ -204,14 +205,30 @@ />
</StackPanel>
</MenuItem.Header>
+ <MenuItem.Resources>
+ <Image x:Key="Movie" x:Shared="False" MaxWidth="16" SnapsToDevicePixels="True" Source="Images/Movies.png" />
+ <Image x:Key="Folder" x:Shared="False" MaxWidth="16" SnapsToDevicePixels="True" Source="Images/folder.png" />
+ <Image x:Key="Disc" x:Shared="False" MaxWidth="16" SnapsToDevicePixels="True" Source="Images/disc_small.png" />
+ </MenuItem.Resources>
<MenuItem.ItemContainerStyle>
- <Style TargetType="{x:Type MenuItem}">
+ <Style TargetType="{x:Type MenuItem}" x:Shared="True">
<Setter Property="Header" Value="{Binding Text}" />
<Setter Property="Command" Value="{Binding Command}"/>
<Setter Property="ItemsSource" Value="{Binding Children}" />
- <Setter Property="Icon" Value="{Binding Image}" />
<Setter Property="InputGestureText" Value="{Binding InputGestureText}" />
<Setter Property="Tag" Value="{Binding}" />
+
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Path=IsDisc}" Value="true">
+ <Setter Property="Icon" Value="{StaticResource Disc}"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Path=IsOpenFolder}" Value="true">
+ <Setter Property="Icon" Value="{StaticResource Folder}"/>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Path=IsOpenFile}" Value="true">
+ <Setter Property="Icon" Value="{StaticResource Movie}"/>
+ </DataTrigger>
+ </Style.Triggers>
</Style>
</MenuItem.ItemContainerStyle>
</MenuItem>
@@ -472,7 +489,7 @@ <MenuItem Header="Open this Directory" Micro:Message.Attach="[Event Click] = [Action OpenDestinationDirectory]" />
</ContextMenu>
</TextBox.ContextMenu>
- </TextBox>
+ </TextBox>
<Button Name="DestinationBrowser"
Grid.Column="2"
Margin="8,0,0,0"
@@ -566,7 +583,7 @@ Header="Presets"
Margin="0,0,0,5"
Visibility="{Binding IsPresetPanelShowing, Converter={StaticResource boolToVisConverter}}">
-
+
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
|