Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/nuget/MahApps.Metro-2.2.star
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen authored Sep 24, 2020
2 parents f9066a3 + e2a0934 commit 6b967ed
Show file tree
Hide file tree
Showing 32 changed files with 496 additions and 172 deletions.
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
- ### Bug fixes

- [#821](../../issues/821) - Different visual of menu item and submenu item
- [#823](../../issues/823) - Gallery item content hidden when mouse pressed
- [#825](../../issues/825) - CLS compliance
- [#830](../../issues/830) - When a window is set to automatically resize to its content, when its title is set in code, it disappears
- [#834](../../issues/834) - InRibbonGallery resizing issue when changing `Visibility`
- [#837](../../issues/837) - InRibbonGallery Property MinItemsInDropDownRow not considered
- [#838](../../issues/838) - InRibbonGallery changes into DropDownButton after DropDown is opened and closed
- [#840](../../issues/840) - Ribbon does not scroll anymore
- [#848](../../issues/848) - Colorful-Theme and Fullscreen Issue
- [#849](../../issues/849) - QuickAccessToolBar not editable anymore (thanks @chrfin)

## 8.0.0

Expand Down
10 changes: 5 additions & 5 deletions Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<PropertyGroup>
<TargetFrameworks>netcoreapp3.0;net462;net452</TargetFrameworks>
<LangVersion>latest</LangVersion>
<LangVersion>latestmajor</LangVersion>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
Expand Down Expand Up @@ -48,13 +48,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" privateAssets="all" includeAssets="build;compile" />
<PackageReference Include="JetBrains.Annotations" PrivateAssets="all" IncludeAssets="build;compile" />

<PackageReference Include="Microsoft.CodeAnalysis.CSharp" privateAssets="all" includeAssets="build;analyzers" Condition="$(DefineConstants.Contains(NETCOREAPP))" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" IncludeAssets="build;analyzers" Condition="$(DefineConstants.Contains(NETCOREAPP))" />
<!-- <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" version="*" privateAssets="all" includeAssets="build;analyzers" /> -->
<!-- <PackageReference Include="PropertyChangedAnalyzers" version="2.7.0" privateAssets="all" includeAssets="build;analyzers" />
<PackageReference Include="ReflectionAnalyzers" version="0.1.19-dev" privateAssets="all" includeAssets="build;analyzers" /> -->
<PackageReference Include="StyleCop.Analyzers" privateAssets="all" includeAssets="build;analyzers" />
<PackageReference Include="WpfAnalyzers" privateAssets="all" includeAssets="build;analyzers" />
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="all" IncludeAssets="build;analyzers" />
<PackageReference Include="WpfAnalyzers" PrivateAssets="all" IncludeAssets="build;analyzers" />
</ItemGroup>
</Project>
28 changes: 25 additions & 3 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1201,11 +1201,11 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr
KeyTip="S"
GroupBy="Tag"
ResizeMode="Both"
MaxItemsInRow="6"
MaxItemsInRow="2"
MinItemsInRow="2"
ItemWidth="40"
ItemHeight="55"
Width="300"
Width="100"
MinItemsInDropDownRow="5">
<Fluent:InRibbonGallery.Filters>
<Fluent:GalleryGroupFilter Title="All"
Expand Down Expand Up @@ -2321,6 +2321,27 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr
<Fluent:MenuItem Header="Item" />
</Fluent:SplitButton>
</Fluent:RibbonGroupBox>

<Fluent:RibbonGroupBox Header="Vertical">
<Fluent:InRibbonGallery Orientation="Vertical"
MaxItemsInDropDownRow="2"
Icon="Images\Gray.png"
Header="InRibbonGallery"
ItemWidth="40"
ItemHeight="56"
ItemsSource="{Binding DataItems}"
ItemTemplate="{DynamicResource largeDataItemTemplate}"
ResizeMode="Both"
Selectable="False">
<!--You can also add items to context menu-->
<Fluent:InRibbonGallery.Menu>
<Fluent:RibbonMenu>
<Fluent:MenuItem Header="Menu Item 1" />
<Fluent:MenuItem Header="Menu Item 2" />
</Fluent:RibbonMenu>
</Fluent:InRibbonGallery.Menu>
</Fluent:InRibbonGallery>
</Fluent:RibbonGroupBox>
</Fluent:RibbonTabItem>

<Fluent:RibbonTabItem Header="Resizing &amp; Screentips"
Expand Down Expand Up @@ -2436,7 +2457,8 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr

<Fluent:RibbonTabItem Header="KeyTips"
KeyTip="K"
Group="{Binding ElementName=tabGroup1, Mode=OneWay}">
Group="{Binding ElementName=tabGroup1, Mode=OneWay}"
BorderBrush="{DynamicResource Fluent.Ribbon.Brushes.AccentBaseColorBrush}">
<Fluent:RibbonGroupBox Header="LongLongGroup"
IsLauncherVisible="False">
<Fluent:DropDownButton Fluent:KeyTip.Keys="C"
Expand Down
22 changes: 12 additions & 10 deletions Fluent.Ribbon.Showcase/TestContent.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace FluentTest
using ControlzEx.Theming;
using Fluent;
using Fluent.Localization;
using Fluent.Theming;
using FluentTest.Adorners;
using FluentTest.Helpers;
using FluentTest.ViewModels;
Expand All @@ -29,7 +28,10 @@ namespace FluentTest
#endif
using Button = Fluent.Button;

public partial class TestContent : UserControl
/// <summary>
/// Test-Content
/// </summary>
public partial class TestContent
{
private readonly MainViewModel viewModel;
private string windowTitle;
Expand All @@ -52,6 +54,7 @@ public TestContent()

public string WindowTitle => this.windowTitle ?? (this.windowTitle = GetVersionText(Window.GetWindow(this).GetType().BaseType));

/// <summary>Identifies the <see cref="Brushes"/> dependency property.</summary>
public static readonly DependencyProperty BrushesProperty = DependencyProperty.Register(nameof(Brushes), typeof(List<KeyValuePair<string, Brush>>), typeof(TestContent), new PropertyMetadata(default(List<KeyValuePair<string, Brush>>)));

public List<KeyValuePair<string, Brush>> Brushes
Expand Down Expand Up @@ -88,15 +91,11 @@ private static string GetVersionText(Type type)
{
var version = type.Assembly.GetName().Version;

var assemblyProductAttribute = (type.Assembly
.GetCustomAttributes(typeof(AssemblyProductAttribute), false) as AssemblyProductAttribute[])
.FirstOrDefault();
var assemblyProductAttribute = type.Assembly.GetCustomAttribute<AssemblyProductAttribute>();

var assemblyInformationalVersionAttribute = (type.Assembly
.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false) as AssemblyInformationalVersionAttribute[])
.FirstOrDefault();
var assemblyInformationalVersionAttribute = type.Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();

return $"{assemblyProductAttribute.Product} {version} ({assemblyInformationalVersionAttribute.InformationalVersion})";
return $"{assemblyProductAttribute?.Product} {version} ({assemblyInformationalVersionAttribute?.InformationalVersion})";
}

private string selectedMenu = "Backstage";
Expand Down Expand Up @@ -594,7 +593,10 @@ private void StartSnoop_OnClick(object sender, RoutedEventArgs e)
snoopPath = alternativeSnoopPath;
}

var startInfo = new ProcessStartInfo(snoopPath, $"inspect --targetPID {Process.GetCurrentProcess().Id}");
var startInfo = new ProcessStartInfo(snoopPath, $"inspect --targetPID {Process.GetCurrentProcess().Id}")
{
UseShellExecute = true
};
try
{
using var p = Process.Start(startInfo);
Expand Down
36 changes: 24 additions & 12 deletions Fluent.Ribbon.Tests/Controls/RibbonGroupBoxTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,28 @@ public void Size_Should_Change_On_Group_State_Change_When_Items_Are_Bound()
using (new TestRibbonWindow(ribbonGroupBox))
{
{
ribbonGroupBox.State = RibbonGroupBoxState.Small;
UIHelper.DoEvents();
{
ribbonGroupBox.State = RibbonGroupBoxState.Small;
UIHelper.DoEvents();
}

Assert.That(items.First().ControlSize, Is.EqualTo(RibbonControlSize.Small));
}

{
ribbonGroupBox.State = RibbonGroupBoxState.Middle;
UIHelper.DoEvents();
{
ribbonGroupBox.State = RibbonGroupBoxState.Middle;
UIHelper.DoEvents();
}

Assert.That(items.First().ControlSize, Is.EqualTo(RibbonControlSize.Middle));
}

{
ribbonGroupBox.State = RibbonGroupBoxState.Large;
UIHelper.DoEvents();
{
ribbonGroupBox.State = RibbonGroupBoxState.Large;
UIHelper.DoEvents();
}

Assert.That(items.First().ControlSize, Is.EqualTo(RibbonControlSize.Large));
}
Expand All @@ -60,22 +66,28 @@ public void Size_Should_Change_On_Group_State_Change_When_Items_Are_Ribbon_Contr
using (new TestRibbonWindow(ribbonGroupBox))
{
{
ribbonGroupBox.State = RibbonGroupBoxState.Small;
UIHelper.DoEvents();
{
ribbonGroupBox.State = RibbonGroupBoxState.Small;
UIHelper.DoEvents();
}

Assert.That(ribbonGroupBox.Items.OfType<Fluent.Button>().First().Size, Is.EqualTo(RibbonControlSize.Small));
}

{
ribbonGroupBox.State = RibbonGroupBoxState.Middle;
UIHelper.DoEvents();
{
ribbonGroupBox.State = RibbonGroupBoxState.Middle;
UIHelper.DoEvents();
}

Assert.That(ribbonGroupBox.Items.OfType<Fluent.Button>().First().Size, Is.EqualTo(RibbonControlSize.Middle));
}

{
ribbonGroupBox.State = RibbonGroupBoxState.Large;
UIHelper.DoEvents();
{
ribbonGroupBox.State = RibbonGroupBoxState.Large;
UIHelper.DoEvents();
}

Assert.That(ribbonGroupBox.Items.OfType<Fluent.Button>().First().Size, Is.EqualTo(RibbonControlSize.Large));
}
Expand Down
6 changes: 5 additions & 1 deletion Fluent.Ribbon.Tests/Internal/ScopeGuardTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ public void IsActive_Marker_Should_Change_On_Dispose()
{
var guard = new ScopeGuard();

Assert.That(guard.IsActive, Is.False);

guard.Start();

Assert.That(guard.IsActive, Is.True);

guard.Dispose();
Expand All @@ -31,7 +35,7 @@ public void Actions_Should_Be_Called()
var disposeActionCallCount = 0;
void DisposeAction() => ++disposeActionCallCount;

var guard = new ScopeGuard(EntryAction, DisposeAction);
var guard = new ScopeGuard(EntryAction, DisposeAction).Start();

Assert.That(entryActionCallCount, Is.EqualTo(1));
Assert.That(disposeActionCallCount, Is.EqualTo(0));
Expand Down
4 changes: 2 additions & 2 deletions Fluent.Ribbon.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Reflection;
using System;

[assembly: AssemblyDescription("")]
[assembly: CLSCompliant(false)]

[assembly: NUnit.Framework.Apartment(System.Threading.ApartmentState.STA)]
1 change: 1 addition & 0 deletions Fluent.Ribbon.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CDBFA905
Directory.build.targets = Directory.build.targets
GitVersion.yml = GitVersion.yml
global.json = global.json
Directory.packages.props = Directory.packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C6ADD536-3DB2-4418-AED6-98AB991D1B77}"
Expand Down
7 changes: 5 additions & 2 deletions Fluent.Ribbon.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp72</s:String>
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp8</s:String>
<s:String x:Key="/Default/CodeEditing/GenerateMemberBody/DocumentationGenerationKind/@EntryValue">Inherit</s:String>
<s:Boolean x:Key="/Default/CodeEditing/GenerateMemberBody/WrapIntoRegions/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeRedundantParentheses/@EntryIndexedValue">DO_NOT_SHOW</s:String>
Expand Down Expand Up @@ -52,6 +52,9 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QAT/@EntryIndexedValue">QAT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/Environment/Hierarchy/NuGetOptions/DefaultPackageManagementFormat/@EntryValue">PackageReference</s:String>
<s:String x:Key="/Default/Environment/Hierarchy/NuGetOptions/DependencyBehavior/@EntryValue">Highest</s:String>
<s:String x:Key="/Default/Environment/Hierarchy/NuGetOptions/IntegratedRestoreEngine/@EntryValue">MsBuild</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
Expand Down
Loading

0 comments on commit 6b967ed

Please sign in to comment.