Skip to content

Commit 5fa9d9e

Browse files
committed
Merge branch 'develop'
2 parents 37cdf20 + 1c9e875 commit 5fa9d9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+387
-334
lines changed

.build/.build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Nuke.Common" Version="7.0.2" />
14+
<PackageReference Include="Nuke.Common" Version="7.0.6" />
1515
<PackageDownload Include="GitVersion.Tool" Version="[5.12.0]" />
1616
</ItemGroup>
1717

Changelog.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog for Fluent.Ribbon
22

3+
## 10.1.0
4+
5+
- ### Bug fixes
6+
7+
- Simplified state was not updated when items changed
8+
- [#1165](../../issues/1165) - ScreenTip is not DPI aware
9+
- [#1183](../../issues/1183) - MenuItems, having a submenu, do not stay highlighted when MenuItem from the submenu is highlighted
10+
- [#1185](../../issues/1185) - LauncherIcon not rendered correctly and items in QAT can be removed from QAT in it's popup
11+
- [#1191](../../issues/1191) - Popup of DropDownButton/SplitButton has unwanted MinHeight
12+
13+
- ### Enhancements/Features
14+
15+
- Performance of measuring (and thus rendering) of `RibbonTabItem` (and it's contents) was improved by reducing the amount of measures required.
16+
Most of the time there should only be one or two measure calls when switching tabs, compared to six or eight in case of the showcase application.
17+
This is mostly achieved by getting rid of internal caching. The caching turned out to be more expensive than not caching at all.
18+
- Added `RibbonProperties.CustomIconSize` as an attached property. This is used inside control templates to set `CustomSize` of `IconPresenter`.
19+
- Default value of `IsHitTestVisible` is now `false` on `IconPresenter`.
20+
- [#1177](../../issues/1177) - RibbonComboBox cannot be customized based on the original RibbonComboBox style (thanks @nishy2000)
21+
- [#1180](../../issues/1180) - Padding and BorderBrush of the gallery control do not work (thanks @nishy2000)
22+
323
## 10.0.4
424

525
- ### Bug fixes

Directory.packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</ItemGroup>
1010

1111
<ItemGroup Label="Test">
12-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
12+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
1313
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
1414

1515
<PackageVersion Include="NUnit" version="3.13.3" />
@@ -23,7 +23,7 @@
2323
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.2.229-beta" />
2424
<PackageVersion Include="XAMLTools.MSBuild" version="1.0.0-alpha0143" />
2525

26-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" version="4.6.0" />
26+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" version="4.7.0" />
2727
<PackageVersion Include="StyleCop.Analyzers" version="1.2.0-beta.507" />
2828
<PackageVersion Include="WpfAnalyzers" version="4.1.1" />
2929
</ItemGroup>

Fluent.Ribbon.Showcase/MinimalWindowSample.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:fluent="urn:fluent-ribbon"
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
x:Name="window"
8-
Title="{Binding WindowTitle, ElementName=TestContent}"
8+
Title="MinimalWindowSample"
99
Width="1024"
1010
Height="768"
1111
MinWidth="80"

Fluent.Ribbon.Showcase/TestContent.xaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,7 +2111,15 @@
21112111
<Fluent:Button Header="Refresh (Galleries)"
21122112
Command="{Binding GalleryViewModel.RefreshCommand}"
21132113
Icon="Images\Green.png"
2114+
SizeDefinition="Middle"
21142115
LargeIcon="Images\GreenLarge.png" />
2116+
2117+
<Fluent:ToggleButton x:Name="ShowHideGalleries"
2118+
Header="Show/Hide (Galleries)"
2119+
IsChecked="True"
2120+
Icon="Images\Red.png"
2121+
SizeDefinition="Middle"
2122+
LargeIcon="Images\GreenLarge.png" />
21152123

21162124
<!-- Though, you may set children of the Gallery explicitly -->
21172125
<Fluent:DropDownButton Header="Pink"
@@ -2165,7 +2173,8 @@
21652173
KeyTip="GG"
21662174
MaxItemsInRow="5"
21672175
MinItemsInRow="1"
2168-
ResizeMode="Both">
2176+
ResizeMode="Both"
2177+
Visibility="{Binding IsChecked, ElementName=ShowHideGalleries, Converter={StaticResource Fluent.Ribbon.Converters.BoolToVisibilityConverter}}">
21692178
<Fluent:InRibbonGallery.Filters>
21702179
<Fluent:GalleryGroupFilter x:Name="galleryFilterAll"
21712180
Title="All"
@@ -3528,6 +3537,11 @@
35283537
Size="Middle">
35293538
Add tab
35303539
</Fluent:Button>
3540+
<Fluent:Button Click="AddButton_OnClick"
3541+
Size="Middle"
3542+
ToolTip="Adds button to current tabs last group">
3543+
Add button
3544+
</Fluent:Button>
35313545
</WrapPanel>
35323546
</GroupBox>
35333547
<GroupBox Header="Interop">
@@ -3591,7 +3605,7 @@
35913605
<GroupBox Header="Issue repros">
35923606
<WrapPanel>
35933607
<WrapPanel.Resources>
3594-
<Fluent:ObjectToImageConverter x:Key="StringToImageConvert"/>
3608+
<Fluent:ObjectToImageConverter x:Key="StringToImageConvert" />
35953609
</WrapPanel.Resources>
35963610
<Fluent:Button x:Name="SleepButton"
35973611
VerticalAlignment="Top"
@@ -3608,9 +3622,9 @@
36083622
</Fluent:Button>
36093623

36103624
<Fluent:Button VerticalAlignment="Top"
3611-
Tag="/Images/Blue.png"
3612-
Icon="{Binding Path=Tag,RelativeSource={RelativeSource Self},Converter={StaticResource StringToImageConvert}}"
3613-
Size="Middle">
3625+
Icon="{Binding Path=Tag, RelativeSource={RelativeSource Self}, Converter={StaticResource StringToImageConvert}}"
3626+
Size="Middle"
3627+
Tag="/Images/Blue.png">
36143628
ObjectToImageConverter for issue #1152
36153629
</Fluent:Button>
36163630

Fluent.Ribbon.Showcase/TestContent.xaml.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace FluentTest;
2121
using Fluent;
2222
using Fluent.Localization;
2323
using FluentTest.Adorners;
24+
using FluentTest.Commanding;
2425
using FluentTest.Helpers;
2526
using FluentTest.ViewModels;
2627
#if MahApps_Metro
@@ -51,6 +52,20 @@ public TestContent()
5152
ColorGallery.RecentColors.Add(((SolidColorBrush)Application.Current.Resources["Fluent.Ribbon.Brushes.AccentBase"]).Color);
5253

5354
this.Loaded += this.TestContent_Loaded;
55+
56+
this.InputBindings.Add(new InputBinding(new RelayCommand(() =>
57+
{
58+
this.Backstage.IsOpen = !this.Backstage.IsOpen;
59+
if (this.Backstage.IsOpen
60+
&& this.Backstage.Content is BackstageTabControl backstageTabControl)
61+
{
62+
var recentTabItem = backstageTabControl.Items.OfType<BackstageTabItem>().FirstOrDefault(x => x.Header is "Recent");
63+
if (recentTabItem is not null)
64+
{
65+
recentTabItem.IsSelected = true;
66+
}
67+
}
68+
}), new KeyGesture(Key.F11, ModifierKeys.Control)));
5469
}
5570

5671
public string WindowTitle => this.windowTitle ?? (this.windowTitle = GetVersionText(Window.GetWindow(this).GetType().BaseType));
@@ -389,6 +404,25 @@ private void AddRibbonTab_OnClick(object sender, RoutedEventArgs e)
389404
this.ribbon.Tabs.Add(tab);
390405
}
391406

407+
private void AddButton_OnClick(object sender, RoutedEventArgs e)
408+
{
409+
var group = this.ribbon.SelectedTabItem.Groups.Last();
410+
411+
if (group.ItemsSource is not null)
412+
{
413+
return;
414+
}
415+
416+
var button = new Button
417+
{
418+
Header = "Foo",
419+
Icon = new BitmapImage(new Uri("pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/Green.png", UriKind.Absolute)),
420+
LargeIcon = new BitmapImage(new Uri("pack://application:,,,/Fluent.Ribbon.Showcase;component/Images/GreenLarge.png", UriKind.Absolute)),
421+
SizeDefinition = new RibbonControlSizeDefinition(RibbonControlSize.Middle, RibbonControlSize.Middle, RibbonControlSize.Middle)
422+
};
423+
group.Items.Add(button);
424+
}
425+
392426
private async void HandleSaveAsClick(object sender, RoutedEventArgs e)
393427
{
394428
var progressAdornerChild = new Border

Fluent.Ribbon.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/PreferQualifiedReference/@EntryValue">False</s:Boolean>
5252
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/QualifiedUsingAtNestedScope/@EntryValue">True</s:Boolean>
5353
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QAT/@EntryIndexedValue">QAT</s:String>
54+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
5455
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
5556
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
5657
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>

Fluent.Ribbon/AttachedProperties/RibbonProperties.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public static bool GetIsElementInQuickAccessToolBar(DependencyObject element)
326326

327327
#endregion IsElementInQuickAccessToolBarProperty
328328

329-
#region DesiredIconSize
329+
#region IconSize
330330

331331
#pragma warning disable WPF0010
332332
/// <summary>
@@ -352,4 +352,31 @@ public static IconSize GetIconSize(DependencyObject element)
352352
}
353353

354354
#endregion
355+
356+
#region CustomIconSize
357+
358+
#pragma warning disable WPF0010
359+
/// <summary>
360+
/// Defines the custom icon size for the element.
361+
/// </summary>
362+
public static readonly DependencyProperty CustomIconSizeProperty = DependencyProperty.RegisterAttached(
363+
"CustomIconSize", typeof(Size), typeof(RibbonProperties), new PropertyMetadata(default(Size)));
364+
#pragma warning restore WPF0010
365+
366+
/// <summary>Helper for setting <see cref="CustomIconSizeProperty"/> on <paramref name="element"/>.</summary>
367+
public static void SetCustomIconSize(DependencyObject element, Size value)
368+
{
369+
element.SetValue(CustomIconSizeProperty, value);
370+
}
371+
372+
/// <summary>Helper for getting <see cref="CustomIconSizeProperty"/> from <paramref name="element"/>.</summary>
373+
[AttachedPropertyBrowsableForType(typeof(IRibbonControl))]
374+
[AttachedPropertyBrowsableForType(typeof(IMediumIconProvider))]
375+
[AttachedPropertyBrowsableForType(typeof(ILargeIconProvider))]
376+
public static Size GetCustomIconSize(DependencyObject element)
377+
{
378+
return (Size)element.GetValue(CustomIconSizeProperty);
379+
}
380+
381+
#endregion
355382
}

Fluent.Ribbon/Controls/ComboBox.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace Fluent;
2626
[TemplatePart(Name = "PART_ContentSite", Type = typeof(ContentPresenter))]
2727
[TemplatePart(Name = "PART_ContentBorder", Type = typeof(Border))]
2828
[TemplatePart(Name = "PART_ScrollViewer", Type = typeof(ScrollViewer))]
29-
[DebuggerDisplay("class{GetType().FullName}: Header = {Header}, Items.Count = {Items.Count}, Size = {Size}, IsSimplified = {IsSimplified}")]
29+
[DebuggerDisplay("{GetType().FullName}: Header = {Header}, Items.Count = {Items.Count}, Size = {Size}, IsSimplified = {IsSimplified}")]
3030
public class ComboBox : System.Windows.Controls.ComboBox, IQuickAccessItemProvider, IRibbonControl, IDropDownControl, IMediumIconProvider, ISimplifiedRibbonControl
3131
{
3232
#region Fields

Fluent.Ribbon/Controls/DropDownButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace Fluent;
2525
[TemplatePart(Name = "PART_Popup", Type = typeof(Popup))]
2626
[TemplatePart(Name = "PART_PopupContentControl", Type = typeof(ResizeableContentControl))]
2727
[TemplatePart(Name = "PART_ButtonBorder", Type = typeof(UIElement))]
28-
[DebuggerDisplay("class{GetType().FullName}: Header = {Header}, Items.Count = {Items.Count}, Size = {Size}, IsSimplified = {IsSimplified}")]
28+
[DebuggerDisplay("{GetType().FullName}: Header = {Header}, Items.Count = {Items.Count}, Size = {Size}, IsSimplified = {IsSimplified}")]
2929
public class DropDownButton : ItemsControl, IQuickAccessItemProvider, IRibbonControl, IDropDownControl, ILargeIconProvider, IMediumIconProvider, ISimplifiedRibbonControl
3030
{
3131
#region Fields

0 commit comments

Comments
 (0)