Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Jul 27, 2023
2 parents ee900fd + 41ea15b commit c17bb0f
Show file tree
Hide file tree
Showing 25 changed files with 110 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .build/.build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="6.3.0" />
<PackageDownload Include="GitVersion.Tool" Version="[5.6.3]" />
<PackageReference Include="Nuke.Common" Version="7.0.2" />
<PackageDownload Include="GitVersion.Tool" Version="[5.12.0]" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions .build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected override void OnBuildInitialized()

[Solution(GenerateProjects = true)] readonly Solution Solution = null!;

[GitVersion(Framework = "netcoreapp3.1", NoFetch = true)] readonly GitVersion? GitVersion;
[GitVersion(Framework = "net6.0", NoFetch = true)] readonly GitVersion? GitVersion;

string AssemblySemVer => GitVersion?.AssemblySemVer ?? "1.0.0";
string SemVer => GitVersion?.SemVer ?? "1.0.0";
Expand All @@ -69,7 +69,7 @@ protected override void OnBuildInitialized()
Target CleanOutput => _ => _
.Executes(() =>
{
EnsureCleanDirectory(ArtifactsDirectory);
ArtifactsDirectory.CreateOrCleanDirectory();
});

Target Restore => _ => _
Expand Down Expand Up @@ -121,15 +121,15 @@ protected override void OnBuildInitialized()
.SetFileVersion(AssemblySemFileVer)
.SetInformationalVersion(InformationalVersion));
Compress(BuildBinDirectory / "Fluent.Ribbon" / Configuration, ArtifactsDirectory / $"Fluent.Ribbon-v{NuGetVersion}.zip");
Compress(BuildBinDirectory / "Fluent.Ribbon.Showcase" / Configuration, ArtifactsDirectory / $"Fluent.Ribbon.Showcase-v{NuGetVersion}.zip");
(BuildBinDirectory / "Fluent.Ribbon" / Configuration).CompressTo(ArtifactsDirectory / $"Fluent.Ribbon-v{NuGetVersion}.zip");
(BuildBinDirectory / "Fluent.Ribbon.Showcase" / Configuration).CompressTo(ArtifactsDirectory / $"Fluent.Ribbon.Showcase-v{NuGetVersion}.zip");
});

Target Test => _ => _
.After(Compile)
.Executes(() =>
{
EnsureCleanDirectory(TestResultsDir);
TestResultsDir.CreateOrCleanDirectory();
DotNetTest(_ => _
.SetConfiguration(Configuration)
Expand Down
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"xamlstyler.console": {
"version": "3.2008.4",
"version": "3.2206.4",
"commands": [
"xstyler"
]
Expand Down
4 changes: 2 additions & 2 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Build Schema",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
Expand Down Expand Up @@ -122,4 +122,4 @@
}
}
}
}
}
13 changes: 9 additions & 4 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp"

$DotNetGlobalFile = "$PSScriptRoot\\global.json"
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
$DotNetChannel = "Current"
$DotNetChannel = "STS"

$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
Expand Down Expand Up @@ -56,14 +56,19 @@ else {
# Install by channel or version
$DotNetDirectory = "$TempDirectory\dotnet-win"
if (!(Test-Path variable:DotNetVersion)) {
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
} else {
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
}
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
}

Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"

if (Test-Path env:NUKE_ENTERPRISE_TOKEN) {
& $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null
& $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null
}

ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
12 changes: 12 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog for Fluent.Ribbon

## 10.0.1

- ### Bug fixes

- [#1133](../../issues/1133) - Fixing binding path to attached property for simplified ControlTemplates (thanks @dcm99)
- [#1134](../../issues/1134) - Selected Tab on first render has a black border
- [#1135](../../issues/1135) - Black line between Ribbon and Window (when using a colorful theme)
- [#1125](../../issues/1125) - BackStage Back Button doesn't have an accessibility text.
- [#1151](../../issues/1151) - ComboBox Popup MinWidth too large
- [#1152](../../issues/1152) - Using ObjectToImageConverter via StaticResource raises an exception (thanks @nishy2000)

## 10.0.0

- ### Breaking changes
Expand All @@ -21,6 +32,7 @@
Minimize button was moved to the right hand side of the toolbar in the tab item row
- All resources now have the prefix `Fluent.Ribbon.`.
This means that nearly all resources got renamed.
- `InputWidth` was converted from an instance proptery to an attached property in `InputControlProperties`

- ### Bug fixes

Expand Down
2 changes: 2 additions & 0 deletions Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<DisableWinExeOutputInference>true</DisableWinExeOutputInference>
<!-- <RestoreSources>https://ci.appveyor.com/nuget/xamltools;$(RestoreSources)</RestoreSources> -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>

<PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions Directory.packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

<ItemGroup Label="Showcase">
<PackageVersion Include="MahApps.Metro.IconPacks.Material" version="4.11.0" />
<PackageVersion Include="MahApps.Metro" version="3.0.0-alpha0454" />
<PackageVersion Include="MahApps.Metro" version="3.0.0-alpha0457" />
</ItemGroup>

<ItemGroup Label="Test">
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />

<PackageVersion Include="NUnit" version="3.13.3" />

Expand All @@ -20,11 +20,11 @@
<ItemGroup Label="Build">
<PackageVersion Include="JetBrains.Annotations" version="2022.3.1" />

<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.2.63-beta" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.2.229-beta" />
<PackageVersion Include="XAMLTools.MSBuild" version="1.0.0-alpha0143" />

<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" version="4.5.0" />
<PackageVersion Include="StyleCop.Analyzers" version="1.2.0-beta.435" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" version="4.6.0" />
<PackageVersion Include="StyleCop.Analyzers" version="1.2.0-beta.507" />
<PackageVersion Include="WpfAnalyzers" version="4.1.1" />
</ItemGroup>
</Project>
10 changes: 10 additions & 0 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3588,6 +3588,9 @@
</GroupBox>
<GroupBox Header="Issue repros">
<WrapPanel>
<WrapPanel.Resources>
<Fluent:ObjectToImageConverter x:Key="StringToImageConvert"/>
</WrapPanel.Resources>
<Fluent:Button x:Name="SleepButton"
VerticalAlignment="Top"
Click="SleepButton_OnClick"
Expand All @@ -3602,6 +3605,13 @@
Change theme from thread
</Fluent:Button>

<Fluent:Button VerticalAlignment="Top"
Tag="/Images/Blue.png"
Icon="{Binding Path=Tag,RelativeSource={RelativeSource Self},Converter={StaticResource StringToImageConvert}}"
Size="Middle">
ObjectToImageConverter for issue #1152
</Fluent:Button>

<GroupBox Header="KeyTip issues #254">
<StackPanel Orientation="Vertical">
<formsInterop:WindowsFormsHost>
Expand Down
33 changes: 32 additions & 1 deletion Fluent.Ribbon.Tests/Converters/ObjectToImageConverterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,35 @@ public void TestDynamicResource()
Assert.That(drawingGroup.Children.Cast<GeometryDrawing>().Select(x => x.Geometry.ToString()),
Is.EquivalentTo(((DrawingGroup)((DrawingImage)Application.Current.FindResource(fluentRibbonImagesApplicationmenuResourceKey)).Drawing).Children.Cast<GeometryDrawing>().Select(x => x.Geometry.ToString())));
}
}

private class DummyProvider : IServiceProvider
{
object IServiceProvider.GetService(Type serviceType)
{
return null;
}
}

[Test]
public void TestStaticResourceSequnece()
{
var fluentRibbonImagesApplicationmenuResourceKey = (object)"Fluent.Ribbon.Images.ApplicationMenu";

var expressionType = typeof(ResourceReferenceExpressionConverter).Assembly.GetType("System.Windows.ResourceReferenceExpression");

var expression = Activator.CreateInstance(expressionType, fluentRibbonImagesApplicationmenuResourceKey);

var converter = new ObjectToImageConverter();

converter.ProvideValue(new DummyProvider());

var convertedValue = StaticConverters.ObjectToImageConverter.Convert(new object[]
{
expression, // value to convert
new ApplicationMenu() // target visual
}, null, null, null);

Assert.That(convertedValue, Is.Not.Null);
Assert.That(convertedValue, Is.InstanceOf<Image>());
}
}
5 changes: 4 additions & 1 deletion Fluent.Ribbon/Controls/RibbonTabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,10 @@ public void SelectFirstTab()
this.SelectedItem = this.GetFirstVisibleItem();
}

this.SelectedTabItem?.Focus();
if (this.IsKeyboardFocusWithin)
{
this.SelectedTabItem?.Focus();
}
}

// Handles IsMinimized changed
Expand Down
5 changes: 5 additions & 0 deletions Fluent.Ribbon/Converters/ObjectToImageConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ public override object ProvideValue(IServiceProvider serviceProvider)

private object CreateMultiBinding(IServiceProvider serviceProvider)
{
if (this.IconBinding is null)
{
return this;
}

var multiBinding = new MultiBinding
{
Converter = this
Expand Down
1 change: 0 additions & 1 deletion Fluent.Ribbon/Helpers/FrameworkHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public static void SetUseLayoutRounding(DependencyObject obj, bool value)
private static void OnUseLayoutRoundingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
d.SetCurrentValue(UIElement.SnapsToDevicePixelsProperty, BooleanBoxes.TrueBox);
RenderOptions.SetClearTypeHint(d, ClearTypeHint.Enabled);
d.SetCurrentValue(FrameworkElement.UseLayoutRoundingProperty, BooleanBoxes.TrueBox);
}
}
1 change: 1 addition & 0 deletions Fluent.Ribbon/Themes/Controls/BackstageTabControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
Grid.Row="0"
Padding="22 7 0 7"
VerticalAlignment="Top"
AutomationProperties.Name="{Binding Uid, RelativeSource={RelativeSource Self}}"
Command="{x:Static Fluent:RibbonCommands.OpenBackstage}"
Visibility="{Binding Path=IsBackButtonVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource Fluent.Ribbon.Converters.BoolToVisibilityConverter}}">
<Button.Margin>
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/Button.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Fluent:IconPresenter x:Name="iconImage"
IconSize="{Binding (Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
IconSize="{Binding Path=(Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
LargeIcon="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}}"
MediumIcon="{Binding MediumIcon, RelativeSource={RelativeSource TemplatedParent}}"
SmallIcon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
Expand Down
6 changes: 3 additions & 3 deletions Fluent.Ribbon/Themes/Controls/ComboBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@
</ResourceDictionary>
</Popup.Resources>
<Fluent:ResizeableContentControl x:Name="PART_PopupContentControl"
MinWidth="{TemplateBinding ActualWidth}"
MinHeight="{TemplateBinding ActualHeight}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
MinWidth="{Binding ActualWidth, ElementName=PART_ContentBorder}"
MinHeight="{Binding ActualHeight, ElementName=PART_ContentBorder}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
IsEnabled="{TemplateBinding IsEnabled}"
ResizeMode="{TemplateBinding ResizeMode}">
<Grid>
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/DropDownButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Fluent:IconPresenter x:Name="iconImage"
IconSize="{Binding (Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
IconSize="{Binding Path=(Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
LargeIcon="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}}"
MediumIcon="{Binding MediumIcon, RelativeSource={RelativeSource TemplatedParent}}"
SmallIcon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/InRibbonGallery.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Fluent:IconPresenter x:Name="iconImage"
IconSize="{Binding (Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
IconSize="{Binding Path=(Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
LargeIcon="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}}"
MediumIcon="{Binding MediumIcon, RelativeSource={RelativeSource TemplatedParent}}"
SmallIcon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/RibbonGroupBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
VerticalAlignment="Center"
IsHitTestVisible="False">
<Fluent:IconPresenter x:Name="iconImage"
IconSize="{Binding (Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
IconSize="{Binding Path=(Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
MediumIcon="{Binding MediumIcon, RelativeSource={RelativeSource TemplatedParent}}"
SmallIcon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
<Border Margin="0"
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/Spinner.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
<Fluent:IconPresenter x:Name="iconImage"
Margin="0 0 4 0"
VerticalAlignment="Center"
IconSize="{Binding (Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
IconSize="{Binding Path=(Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
MediumIcon="{Binding MediumIcon, RelativeSource={RelativeSource TemplatedParent}}"
SmallIcon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />

Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/SplitButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Fluent:IconPresenter x:Name="iconImage"
IconSize="{Binding (Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
IconSize="{Binding Path=(Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
LargeIcon="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}}"
MediumIcon="{Binding MediumIcon, RelativeSource={RelativeSource TemplatedParent}}"
SmallIcon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
Expand Down
2 changes: 1 addition & 1 deletion Fluent.Ribbon/Themes/Controls/ToggleButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
VerticalAlignment="Center">
<Fluent:IconPresenter x:Name="iconImage"
Margin="0"
IconSize="{Binding (Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
IconSize="{Binding Path=(Fluent:RibbonProperties.IconSize), RelativeSource={RelativeSource TemplatedParent}}"
LargeIcon="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}}"
MediumIcon="{Binding MediumIcon, RelativeSource={RelativeSource TemplatedParent}}"
SmallIcon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
Expand Down
1 change: 1 addition & 0 deletions Fluent.Ribbon/Themes/RibbonWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<DockPanel Grid.Row="0"
Height="{TemplateBinding TitleBarHeight}"
Margin="0 0 0 -1"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Background="{TemplateBinding TitleBackground}"
Expand Down
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
:; exit $?

@ECHO OFF
powershell -ExecutionPolicy ByPass -NoProfile "%~dp0build.ps1" %*
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
Loading

0 comments on commit c17bb0f

Please sign in to comment.