Skip to content

Commit

Permalink
Fixes #770 by conditionally setting alignment and grouping before update
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Feb 9, 2020
1 parent 9354f8b commit 0ca0919
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [#765](../../issues/765) - InRibbonGallery Resizing Issues
- [#766](../../issues/766) - Resizing of InRibbonGallery in a DataTemplate does not work
- [#768](../../issues/768) - Accessibility Insights: "An onscreen element must not have a null"
- [#770](../../issues/770) - Cannot left align the content in InRibbonGallery

- ### Enhancements/Features
- Many automation peers have been added and improved
Expand Down
1 change: 1 addition & 0 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,7 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr
MinItemsInRow="2"
ItemWidth="40"
ItemHeight="55"
Width="300"
MinItemsInDropDownRow="5">
<Fluent:InRibbonGallery.Filters>
<Fluent:GalleryGroupFilter Title="All"
Expand Down
3 changes: 2 additions & 1 deletion Fluent.Ribbon/Controls/InRibbonGallery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,9 @@ private void OnDropDownOpened(object sender, EventArgs e)
{
this.galleryPanel.MinItemsInRow = this.MinItemsInDropDownRow;
this.galleryPanel.MaxItemsInRow = this.MaxItemsInDropDownRow;
this.galleryPanel.UpdateMinAndMaxWidth();
this.galleryPanel.IsGrouped = true;

this.galleryPanel.UpdateMinAndMaxWidth();
}

this.DropDownOpened?.Invoke(this, e);
Expand Down
9 changes: 8 additions & 1 deletion Fluent.Ribbon/Themes/Controls/GalleryGroupContainer.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">

Expand Down Expand Up @@ -35,6 +35,8 @@
TargetType="{x:Type Fluent:GalleryGroupContainer}">
<Setter Property="Template"
Value="{DynamicResource GalleryGroupContainerTemplate}" />
<Setter Property="HorizontalAlignment"
Value="Stretch" />
<Setter Property="Focusable"
Value="False" />
<Setter Property="ItemsPanel">
Expand All @@ -60,6 +62,11 @@
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsHeadered"
Value="False">
<Setter Property="HorizontalAlignment"
Value="Left" />
</Trigger>
</Style.Triggers>
</Style>

Expand Down

0 comments on commit 0ca0919

Please sign in to comment.