Skip to content

Commit

Permalink
Fixes #650 by changing all shipped images to xaml icons
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Dec 17, 2018
1 parent 15f3fd1 commit de672d2
Show file tree
Hide file tree
Showing 28 changed files with 370 additions and 230 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
The words `AppTheme` and `Accent` are replaced by `Theme` everywhere.
- The target type for `Fluent.Ribbon.Styles.MenuItem` (previously named `FluentDefaultSystemMenuItemStyle`) now is `Fluent:MenuItem` instead of `MenuItem`
- Instead of depending on `System.Windows.Interactivity` we now depend on the open source version `Microsoft.Xaml.Behaviors.Wpf`
- [#650](../../issues/650) - Create XAML icons and replace the shipped pngs with these (thanks @DenZuck for creating the xaml icons)
Due to this change all shipped images are now of type `DrawingImage` instead of `BitmapImage`.

**The following resources were added, renamed or removed ("---" indicates added when in column "Old" and removed when in column "New"):**

Expand Down
Binary file removed Fluent.Ribbon.Showcase/Images/Default.png
Binary file not shown.
24 changes: 12 additions & 12 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<Fluent:BackstageTabItem Header="Disabled"
IsEnabled="False" />
<Fluent:BackstageTabItem Header="Introduction"
Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Default.png"
Icon="{DynamicResource Fluent.Ribbon.Images.DefaultPlaceholder}"
KeyTip="T">
<StackPanel Orientation="Vertical">
<TextBlock>This is a BackstageTabItem with some sample content.</TextBlock>
Expand Down Expand Up @@ -365,13 +365,13 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr

<Fluent:Ribbon.ToolBarItems>
<Fluent:Button Size="Small"
Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Help.png"
Icon="{DynamicResource Fluent.Ribbon.Images.Help}"
Click="OnHelpClick">
<Fluent:Button.ToolTip>
<Fluent:ScreenTip Title="Insert Chart"
Text="Insert a chart to illustarate and compare data. &#xa;&#xa;Bar, Pie, Line, Area and Surface are same of the available types."
Image="pack://application:,,,/Fluent.Ribbon.Showcase;component\Images/SampleImageForScreenTip.png"
HelpTopic="http:\\fluent.codeplex.com"
HelpTopic="https://github.com/fluentribbon/Fluent.Ribbon"
DisableReason="Disable reason reason."
Width="190"
IsRibbonAligned="True" />
Expand Down Expand Up @@ -405,7 +405,7 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr
<Fluent:RibbonTabItem Header="Toolbars"
KeyTip="TO"
ReduceOrder="Font, Font, Font, Font,B,A,A,A,(A),(A),(A),Clipboard,Font,B,B,(A),C,(A),(A)">
<Fluent:RibbonGroupBox Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Default.png"
<Fluent:RibbonGroupBox Icon="{DynamicResource Fluent.Ribbon.Images.DefaultPlaceholder}"
KeyTip="C"
x:Name="Clipboard"
Header="Clipboard"
Expand Down Expand Up @@ -1061,7 +1061,7 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr

</Fluent:RibbonGroupBox>

<Fluent:RibbonGroupBox Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Default.png"
<Fluent:RibbonGroupBox Icon="{DynamicResource Fluent.Ribbon.Images.DefaultPlaceholder}"
KeyTip="ZXB"
x:Name="B"
Header="Spinners"
Expand All @@ -1072,20 +1072,20 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr
InputWidth="75"
Format="0 px"
Header="Left:"
Icon="pack://application:,,,/Fluent;component/Themes/Images/Warning.png"
Icon="{DynamicResource Fluent.Ribbon.Images.Warning}"
IsEnabled="False" />
<Fluent:Spinner KeyTip="KB"
Value="{Binding BoundSpinnerValue}"
InputWidth="75"
Format="0 px"
Header="Right:"
Icon="pack://application:,,,/Fluent;component/Themes/Images/Warning.png"
Icon="{DynamicResource Fluent.Ribbon.Images.Warning}"
SelectAllTextOnFocus="True" />
<Fluent:Spinner KeyTip="KC"
InputWidth="75"
Format="0 px"
Header="Top:"
Icon="pack://application:,,,/Fluent;component/Themes/Images/Warning.png" />
Icon="{DynamicResource Fluent.Ribbon.Images.Warning}" />
</Fluent:RibbonGroupBox>
</Fluent:RibbonTabItem>

Expand Down Expand Up @@ -1166,7 +1166,7 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr

<Fluent:RibbonGroupBox Header="Gallery">
<Fluent:InRibbonGallery x:Name="InRibbonGallery"
Icon="pack://application:,,,/Fluent;component/Themes/Images/Warning.png"
Icon="{DynamicResource Fluent.Ribbon.Images.Warning}"
Header="Split"
KeyTip="S"
GroupBy="Tag"
Expand Down Expand Up @@ -2066,14 +2066,14 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr
</Fluent:InRibbonGallery>
</Fluent:RibbonGroupBox>

<Fluent:RibbonGroupBox Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Default.png"
<Fluent:RibbonGroupBox Icon="{DynamicResource Fluent.Ribbon.Images.DefaultPlaceholder}"
x:Name="A"
KeyTip="A"
Header="Galleries"
IsLauncherVisible="True"
LauncherKeys="GAL"
LauncherClick="OnLauncherButtonClick">
<Fluent:InRibbonGallery Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Default.png"
<Fluent:InRibbonGallery Icon="{DynamicResource Fluent.Ribbon.Images.DefaultPlaceholder}"
LargeIcon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/GalleryLarge.png"
Header="In-Ribbon Gallery"
KeyTip="JS"
Expand Down Expand Up @@ -2120,7 +2120,7 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr
</Fluent:InRibbonGallery.ItemTemplate>
</Fluent:InRibbonGallery>

<Fluent:SplitButton Icon="pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Default.png"
<Fluent:SplitButton Icon="{DynamicResource Fluent.Ribbon.Images.DefaultPlaceholder}"
LargeIcon="/Images/GalleryLarge.png"
Header="Split"
KeyTip="S"
Expand Down
Binary file removed Fluent.Ribbon/Images/DefaultSmallIcon.png
Binary file not shown.
18 changes: 12 additions & 6 deletions Fluent.Ribbon/Themes/Controls/ApplicationMenuItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@
HorizontalAlignment="Center"
VerticalAlignment="Top"
Margin="0,4,0,0"
Width="32"
Height="32"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
Expand Down Expand Up @@ -210,8 +211,9 @@
HorizontalAlignment="Center"
VerticalAlignment="Top"
Margin="0,4,0,0"
Width="32"
Height="32"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
Expand Down Expand Up @@ -548,8 +550,9 @@
HorizontalAlignment="Center"
VerticalAlignment="Top"
Margin="0,4,0,0"
Width="32"
Height="32"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
Expand Down Expand Up @@ -803,8 +806,9 @@
<Image x:Name="image"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="32"
Height="32"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
Expand Down Expand Up @@ -924,8 +928,9 @@
<Image x:Name="image"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="32"
Height="32"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
Expand Down Expand Up @@ -1244,8 +1249,9 @@
<Image x:Name="image"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="32"
Height="32"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<ContentPresenter x:Name="iconImage"
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/BackstageControls.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="clr-namespace:Fluent"
xmlns:converters="clr-namespace:Fluent.Converters">
Expand Down
12 changes: 8 additions & 4 deletions Fluent.Ribbon/Themes/Controls/MenuItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@
<Image x:Name="checkedImage"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="16"
Height="16"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<Border x:Name="iconImageBorder"
Expand Down Expand Up @@ -306,8 +307,9 @@
<Image x:Name="checkedImage"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="16"
Height="16"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<Border x:Name="iconImageBorder"
Expand Down Expand Up @@ -565,8 +567,9 @@
<Image x:Name="checkedImage"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="16"
Height="16"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<Border x:Name="iconImageBorder"
Expand Down Expand Up @@ -824,8 +827,9 @@
<Image x:Name="checkedImage"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="16"
Height="16"
Source="{DynamicResource Fluent.Ribbon.Images.Checked}"
Stretch="None"
Visibility="Collapsed"
SnapsToDevicePixels="True" />
<Border x:Name="iconImageBorder"
Expand Down
75 changes: 15 additions & 60 deletions Fluent.Ribbon/Themes/Controls/QuickAccessToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Setter Property="Height"
Value="22" />
<Setter Property="Width"
Value="13" />
Value="22" />
<Setter Property="Foreground"
Value="{DynamicResource Fluent.Ribbon.Brushes.LabelTextBrush}" />
</Style>
Expand All @@ -22,18 +22,15 @@
BorderThickness="1"
Background="Transparent"
BorderBrush="Transparent"
Height="22"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Width="13">
VerticalAlignment="Stretch">
<Image x:Name="iconImage"
HorizontalAlignment="Center"
Height="8"
Stretch="None"
VerticalAlignment="Center"
Source="{converters:ObjectToImageConverter {Binding Icon, RelativeSource={RelativeSource TemplatedParent}}, '8,8', {Binding RelativeSource={RelativeSource TemplatedParent}}}"
Width="8"
Margin="-3,0,2,0" />
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="12"
Height="12"
Source="{converters:ObjectToImageConverter {Binding Icon, RelativeSource={RelativeSource TemplatedParent}}, '12,12', {Binding RelativeSource={RelativeSource TemplatedParent}}}"
Margin="2" />
</Border>
<Popup x:Name="PART_Popup"
Placement="Bottom"
Expand Down Expand Up @@ -151,42 +148,6 @@
TargetName="iconImage"
Value="0.25" />
</Trigger>
<Trigger Property="Size"
Value="Small">
<Setter Property="Source"
TargetName="iconImage"
Value="{converters:ObjectToImageConverter {Binding Icon, RelativeSource={RelativeSource TemplatedParent}}, '16,16', {Binding RelativeSource={RelativeSource TemplatedParent}}}" />
<Setter Property="Width"
TargetName="iconImage"
Value="16" />
<Setter Property="Height"
TargetName="iconImage"
Value="16" />
<Setter Property="Margin"
TargetName="iconImage"
Value="2" />
</Trigger>
<Trigger Property="Size"
Value="Middle">
<Setter Property="Source"
TargetName="iconImage"
Value="{converters:ObjectToImageConverter {Binding Icon, RelativeSource={RelativeSource TemplatedParent}}, '16,16', {Binding RelativeSource={RelativeSource TemplatedParent}}}" />
<Setter Property="VerticalAlignment"
TargetName="iconImage"
Value="Center" />
<Setter Property="VerticalAlignment"
TargetName="PART_ButtonBorder"
Value="Stretch" />
<Setter Property="Width"
TargetName="iconImage"
Value="16" />
<Setter Property="Height"
TargetName="iconImage"
Value="16" />
<Setter Property="Margin"
TargetName="iconImage"
Value="2" />
</Trigger>
<Trigger Property="IsDropDownOpen"
Value="True">
<Setter Property="BorderBrush"
Expand Down Expand Up @@ -231,11 +192,9 @@
Focusable="False">
<Fluent:DropDownButton CanAddToQuickAccessToolBar="False"
x:Name="PART_MenuDownButton"
Width="13"
HorizontalAlignment="Right"
VerticalAlignment="Stretch"
Style="{DynamicResource ToolbarDropDownButtonStyle}"
Height="22"
DockPanel.Dock="Right"
IsEnabled="{TemplateBinding IsEnabled}"
Visibility="{Binding IsMenuDropDownVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"
Expand All @@ -260,11 +219,9 @@

<Fluent:DropDownButton x:Name="PART_ToolbarDownButton"
HorizontalAlignment="Right"
Width="13"
Visibility="Collapsed"
VerticalAlignment="Stretch"
Style="{DynamicResource ToolbarDropDownButtonStyle}"
Height="22"
DockPanel.Dock="Right"
Fluent:KeyTip.Keys="00"
Size="Small"
Expand All @@ -289,15 +246,13 @@
Height="Auto"
VerticalAlignment="Center"
Margin="1,0,0,0" />
<Label x:Name="popupContentControl"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Width="13"
Background="{x:Null}"
Height="22"
Focusable="False"
Padding="0"
Margin="1,0" />
<ContentControl x:Name="popupContentControl"
VerticalAlignment="Center"
HorizontalAlignment="Left"
Background="{x:Null}"
Focusable="False"
Padding="0"
Margin="1,0" />
</StackPanel>
</Fluent:DropDownButton>

Expand Down
Loading

0 comments on commit de672d2

Please sign in to comment.