Skip to content

Commit

Permalink
Merge pull request #16 from PieroCastillo/fix/Ribbon-problems
Browse files Browse the repository at this point in the history
Fix/ribbon problems
  • Loading branch information
PieroCastillo authored May 23, 2021
2 parents b0782de + fd41db8 commit cc1fa1a
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 30 deletions.
10 changes: 5 additions & 5 deletions Tests/UI.Tests/UI.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<AvaloniaResource Include="Assets\bringtherain.jpg" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.4" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.3" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.3" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.3" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.3" />
<PackageReference Include="Avalonia" Version="0.10.5" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.5" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.5" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.5" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Aura.UI\Aura.UI.csproj" />
Expand Down
14 changes: 7 additions & 7 deletions build/base.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<Authors>Piero Castillo</Authors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.4" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.4" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.4" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.4" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.4" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.4" />
<PackageReference Include="Avalonia.Xaml.Interactivity" Version="0.10.4" />
<PackageReference Include="Avalonia" Version="0.10.5" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.5" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.5" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.5" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.5" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.5" />
<PackageReference Include="Avalonia.Xaml.Interactivity" Version="0.10.5" />
<PackageReference Include="Microsoft.Toolkit.Parsers" Version="7.0.0-preview4" />
<PackageReference Include="MathNet.Numerics" Version="4.12.0" />
<PackageReference Include="ReactiveUI" Version="13.2.18" />
Expand Down
10 changes: 5 additions & 5 deletions build/dragging.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.4" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.4" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.4" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.4" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.4" />
<PackageReference Include="Avalonia" Version="0.10.5" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.5" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.5" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.5" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.5" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions samples/Aura.UI.Gallery/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Reactive;
using System.Threading.Tasks;
using Avalonia.Controls;
using System.Threading;

namespace Aura.UI.Gallery
{
Expand Down Expand Up @@ -81,9 +82,12 @@ await Dispatcher.UIThread.InvokeAsync(() =>
break;
}
}, (DispatcherPriority)1);

Settings.Theme = theme;
}



public readonly static Styles FluentDark = new Styles
{
new StyleInclude(new Uri("avares://Aura.UI.Gallery/Styles"))
Expand Down
12 changes: 6 additions & 6 deletions samples/Aura.UI.Gallery/Aura.UI.Gallery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
<ItemGroup>
<PackageReference Include="XamlNameReferenceGenerator" Version="1.1.2" PrivateAssets="all" />
<PackageReference Include="AuraUtilities" Version="0.1.0" />
<PackageReference Include="Avalonia" Version="0.10.4" />
<PackageReference Include="Avalonia" Version="0.10.5" />
<PackageReference Include="Avalonia.AvaloniaEdit" Version="0.10.4" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.4" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.4" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.4" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.4" />
<PackageReference Include="Avalonia.Svg" Version="0.10.4" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.5" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.5" />
<PackageReference Include="Avalonia.Markup.Xaml.Loader" Version="0.10.5" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.5" />
<PackageReference Include="Avalonia.Svg" Version="0.10.5" />
<PackageReference Include="jp2masa.Avalonia.Flexbox" Version="0.2.0" />
</ItemGroup>
<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions src/Aura.UI.Dragging/Aura.UI.Dragging.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@
<ItemGroup>
<None Include="Assets\AuraUILogo_full_icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Avalonia" Version="0.10.5" />
<PackageReference Update="Avalonia.Desktop" Version="0.10.5" />
<PackageReference Update="Avalonia.Diagnostics" Version="0.10.5" />
<PackageReference Update="Avalonia.Markup.Xaml.Loader" Version="0.10.5" />
<PackageReference Update="Avalonia.ReactiveUI" Version="0.10.5" />
</ItemGroup>
</Project>
9 changes: 8 additions & 1 deletion src/Aura.UI/Aura.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@
</AvaloniaResource>
</ItemGroup>
<ItemGroup>
<PackageReference Update="Avalonia" Version="0.10.5" />
<PackageReference Update="Avalonia.Desktop" Version="0.10.5" />
<PackageReference Update="Avalonia.Diagnostics" Version="0.10.5" />
<PackageReference Update="Avalonia.Markup.Xaml.Loader" Version="0.10.5" />
<PackageReference Update="Avalonia.ReactiveUI" Version="0.10.5" />
<PackageReference Update="Avalonia.Xaml.Behaviors" Version="0.10.5" />
<PackageReference Update="Avalonia.Xaml.Interactivity" Version="0.10.5" />
<PackageReference Update="MathNet.Numerics" Version="4.15.0" />
<PackageReference Update="ReactiveUI" Version="13.2.18" />
<PackageReference Update="ReactiveUI" Version="13.3.2" />
<PackageReference Update="SkiaSharp" Version="2.80.2" />
<PackageReference Include="System.Reactive" Version="5.0.0" />
</ItemGroup>
Expand Down
25 changes: 25 additions & 0 deletions src/Aura.UI/Controls/Ribbon/Ribbon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ public object LeftContent

public static readonly StyledProperty<object> LeftContentProperty =
AvaloniaProperty.Register<Ribbon, object>(nameof(LeftContent), "Left");

/// <summary>
/// Gets or Sets if the Left content is visible.
/// </summary>
public bool LeftContentVisible
{
get => GetValue(LeftContentVisibleProperty);
set => SetValue(LeftContentVisibleProperty, value);
}

public static readonly StyledProperty<bool> LeftContentVisibleProperty =
AvaloniaProperty.Register<Ribbon, bool>(nameof(LeftContent));


/// <summary>
/// RightContent of the the Ribbon
Expand All @@ -146,6 +159,18 @@ public object RightContent
public static readonly StyledProperty<object> RightContentProperty =
AvaloniaProperty.Register<Ribbon, object>(nameof(RightContent), "Right");

/// <summary>
/// Gets or Sets if the Right content is visible.
/// </summary>
public bool RightContentVisible
{
get => GetValue(RightContentVisibleProperty);
set => SetValue(RightContentVisibleProperty, value);
}

public static readonly StyledProperty<bool> RightContentVisibleProperty =
AvaloniaProperty.Register<Ribbon, bool>(nameof(RightContent));

/// <summary>
/// Header of the the Ribbon
/// </summary>
Expand Down
10 changes: 5 additions & 5 deletions src/Aura.UI/Controls/Ribbon/RibbonGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
};
}

public object MiniButtonContent
public bool MiniButtonIsVisible
{
get => GetValue(MiniButtonContentProperty);
set => SetValue(MiniButtonContentProperty, value);
get => GetValue(MiniButtonIsVisibleProperty);
set => SetValue(MiniButtonIsVisibleProperty, value);
}

public static readonly StyledProperty<object> MiniButtonContentProperty =
AvaloniaProperty.Register<RibbonGroup, object>(nameof(MiniButtonContent), "L");
public static readonly StyledProperty<bool> MiniButtonIsVisibleProperty =
AvaloniaProperty.Register<RibbonGroup, bool>(nameof(MiniButtonIsVisible), true);

public event EventHandler<RoutedEventArgs> MiniButtonClick
{
Expand Down
3 changes: 2 additions & 1 deletion src/Aura.UI/Controls/Ribbon/RibbonGroupStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
<Button Grid.Column="1"
Name="PART_MiniButton" Padding="5"
HorizontalAlignment="Right"
VerticalAlignment="Center">
VerticalAlignment="Center"
IsVisible="{Binding $parent[RibbonGroup].MiniButtonIsVisible}">
<Path Fill="{DynamicResource RibbonGroupForeground}">
<Path.Data>M 9.7021647 -0.11328324 0.41351726 -0.0959617 c -0.082331 5.7903e-4 -0.15691694 0.03332856 -0.21086464 0.08646458 -0.0539477 0.05313581 -0.0871794 0.12662389 -0.0866077 0.20742888 L 0.13350952 9.3123619 C 0.13387601 9.4739358 0.26805698 9.6049659 0.43269991 9.6046808 0.5973626 9.6043761 0.73091253 9.4727903 0.73060177 9.3112162 L 0.71313716 0.50170378 1.063147 0.7965991 C 0.9887546 0.89809733 0.9967678 1.0409183 1.088771 1.1322938 l 7.999552 7.9455827 -5.9604757 0.019899 c -0.068886 7.34e-5 -0.1349286 0.027779 -0.1833791 0.07673 -0.1004904 0.1015511 -0.099543 0.2652661 0.00199 0.3657565 0.048591 0.048264 0.1142076 0.07532 0.1826639 0.075156 L 9.713603 9.5930848 c 0.00901 1.6e-5 0.018089 -4.433e-4 0.027056 -0.00144 0.00862 -8.588e-4 0.017117 -0.00224 0.025624 -0.00401 0.048033 -0.00992 0.093828 -0.033461 0.1309853 -0.070861 0.05255 -0.052906 0.077274 -0.122753 0.074726 -0.1918257 L 9.9496662 2.7484848 C 9.9467796 2.6091628 9.834061 2.4972165 9.6947104 2.4952463 9.5518558 2.4932518 9.4344395 2.607491 9.4324533 2.7503458 L 9.452925 8.7108215 1.4533802 0.76525031 C 1.4026985 0.7149109 1.336493 0.68987058 1.2702868 0.69009486 c -0.066206 2.1987e-4 -0.1324674 0.0257623 -0.1828067 0.076444 -0.00874 0.008799 -0.015691 0.0185428 -0.022905 0.0282008 L 0.71313422 0.49884162 v -0.009162 L 9.7033066 0.47264472 C 9.8679687 0.47235108 10.001662 0.34075416 10.001352 0.17918083 10.001047 0.0176066 9.8668237 -0.11358682 9.7021617 -0.11328177 Z</Path.Data>
</Path>
Expand Down
1 change: 1 addition & 0 deletions src/Aura.UI/Controls/Ribbon/RibbonStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<ShadowButton Grid.Column="1"
Name="PART_LeftButton"
Content="{TemplateBinding LeftContent}"
IsVisible="{TemplateBinding LeftContentVisible}"
Classes="BorderButtons"
CornerRadius="0" />
<ScrollViewer Grid.Column="2" HorizontalScrollBarVisibility="Auto"
Expand Down

0 comments on commit cc1fa1a

Please sign in to comment.