Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Nov 22, 2024
2 parents 0dcc87c + 5b69e88 commit 5935672
Show file tree
Hide file tree
Showing 12 changed files with 175 additions and 87 deletions.
1 change: 1 addition & 0 deletions .build/ResourceKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static string GetPrefixPart(XName name) =>
"Color" => "Colors",
"SolidColorBrush" => "Brushes",
"LinearGradientBrush" => "Brushes",
"GridLength" => "Values",
"Thickness" => "Values",
"String" => "Values",
"Boolean" => "Values",
Expand Down
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@
- `IsSplit` is now automatically set by a style trigger. If `Command` is not null and `HasItems` is true.
- `RibbonMenu`
- Added support for `UsesItemContainerTemplate` and `ItemContainerTemplateSelector`
- Added `ExpandButtonContent` and `ExpandButtonContentTemplate` to `InRibbonGallery`

- ### Bug fixes

- [#1162](../../issues/1162) - Maximum dropdown height is not screen aware
- [#1196](../../issues/1196) - GroupName causes the selected ToggleButton to no longer trigger the click event
- [#1218](../../issues/1218) - Selected tab is lost on screen changes (thanks @cbra-caa)
- Value of `HideContextTabs` are now properly restored when `Backstage` is closed
- `RibbonTitleBar`
- Fixed rendering when `HideContextTabs` is `true`
Expand Down
6 changes: 6 additions & 0 deletions Fluent.Ribbon.Showcase/MinimalWindowSample.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
Target="{Binding ElementName=button}" />
</fluent:Ribbon.QuickAccessItems>

<fluent:Ribbon.Menu>
<fluent:Backstage Header="Project">
<fluent:BackstageTabControl />
</fluent:Backstage>
</fluent:Ribbon.Menu>

<fluent:Ribbon.ContextualGroups>
<fluent:RibbonContextualTabGroup x:Name="contextGroup1"
Header="Generic context"
Expand Down
97 changes: 50 additions & 47 deletions Fluent.Ribbon.Showcase/TestContent.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UserControl x:Class="FluentTest.TestContent"
<UserControl x:Class="FluentTest.TestContent"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="urn:fluent-ribbon"
Expand Down Expand Up @@ -2180,6 +2180,7 @@
<!-- InRibbonGallery -->
<Fluent:InRibbonGallery Header="InRibbonGallery"
Icon="Images\Gray.png"
ExpandButtonContent="{Binding DataItems.Count}"
ItemHeight="56"
ItemTemplate="{DynamicResource largeDataItemTemplate}"
ItemWidth="40"
Expand All @@ -2191,6 +2192,13 @@
ResizeMode="Both"
Selectable="False"
ToolTip="Items are not selectable here.">
<Fluent:InRibbonGallery.ExpandButtonContentTemplate>
<DataTemplate>
<ContentControl HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="{Binding .}" />
</DataTemplate>
</Fluent:InRibbonGallery.ExpandButtonContentTemplate>
<!-- You can also add items to context menu -->
<Fluent:InRibbonGallery.Menu>
<Fluent:RibbonMenu>
Expand Down Expand Up @@ -3156,20 +3164,19 @@
SelectedItem="{Binding Source={x:Static controlzEx:ThemeManager.Current}, Path=ThemeSyncMode}" />
<Fluent:CheckBox Header="Use HSL color"
IsChecked="{Binding Path=Options.UseHSL, Source={x:Static controlzEx:RuntimeThemeGenerator.Current}, Mode=TwoWay}" />
<Button Click="SyncThemeNow_OnClick">Sync now</Button>
<Fluent:Button Header="Sync now"
Click="SyncThemeNow_OnClick"
Size="Middle" />
</WrapPanel>
</GroupBox>

<GroupBox Header="WindowChrome">
<WrapPanel>
<StackPanel Orientation="Horizontal">
<Label>
CornerPreference
</Label>
<ComboBox VerticalAlignment="Center"
ItemsSource="{Binding Source={StaticResource CornerPreferenceEnumValues}}"
SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=CornerPreference, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
<Fluent:ComboBox Header="CornerPreference"
VerticalAlignment="Center"
IsEditable="False"
ItemsSource="{Binding Source={StaticResource CornerPreferenceEnumValues}}"
SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=CornerPreference, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</WrapPanel>
</GroupBox>

Expand Down Expand Up @@ -3233,31 +3240,27 @@
</Fluent:ComboBox.ItemTemplate>
</Fluent:ComboBox>

<StackPanel Orientation="Horizontal">
<Label>
GlowDepth
</Label>
<TextBox MinWidth="30"
VerticalAlignment="Center"
Text="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=GlowDepth, Mode=TwoWay}" />
</StackPanel>
<Fluent:TextBox Header="GlowDepth"
MinWidth="30"
VerticalAlignment="Center"
Text="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=GlowDepth, Mode=TwoWay}" />

<CheckBox VerticalAlignment="Center"
Content="IsGlowTransitionEnabled"
IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=IsGlowTransitionEnabled, Mode=TwoWay}" />
<Fluent:CheckBox Header="IsGlowTransitionEnabled"
VerticalAlignment="Center"
IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=IsGlowTransitionEnabled, Mode=TwoWay}" />

<CheckBox VerticalAlignment="Center"
Content="UseRadialGradientForCorners"
IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=UseRadialGradientForCorners, Mode=TwoWay}" />
<Fluent:CheckBox Header="UseRadialGradientForCorners"
VerticalAlignment="Center"
IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=UseRadialGradientForCorners, Mode=TwoWay}" />

<CheckBox VerticalAlignment="Center"
Content="PreferDWMBorderColor"
IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=PreferDWMBorderColor, Mode=TwoWay}" />
<Fluent:CheckBox Header="PreferDWMBorderColor"
VerticalAlignment="Center"
IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=PreferDWMBorderColor, Mode=TwoWay}" />

<CheckBox VerticalAlignment="Center"
Content="DWMSupportsBorderColor"
IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=DWMSupportsBorderColor, Mode=OneWay}"
IsEnabled="False" />
<Fluent:CheckBox Header="DWMSupportsBorderColor"
VerticalAlignment="Center"
IsChecked="{Binding RelativeSource={RelativeSource AncestorType=controlzEx:WindowChromeWindow}, Path=DWMSupportsBorderColor, Mode=OneWay}"
IsEnabled="False" />
</WrapPanel>
</GroupBox>

Expand Down Expand Up @@ -3312,26 +3315,25 @@
IsChecked="True">
IsStatusBarVisible
</Fluent:CheckBox>
<ComboBox AutomationProperties.Name="Window resize mode"
ItemsSource="{Binding Source={StaticResource ResizeModeEnumValues}}"
SelectedItem="{Binding Path=ResizeMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
<Fluent:ComboBox Header="Window resize mode"
IsEditable="False"
ItemsSource="{Binding Source={StaticResource ResizeModeEnumValues}}"
SelectedItem="{Binding Path=ResizeMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />

<ComboBox AutomationProperties.Name="Window flow direction"
ItemsSource="{Binding Source={StaticResource FlowDirectionEnumValues}}"
SelectedItem="{Binding Path=FlowDirection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
<Fluent:ComboBox Header="Window flow direction"
IsEditable="False"
ItemsSource="{Binding Source={StaticResource FlowDirectionEnumValues}}"
SelectedItem="{Binding Path=FlowDirection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />

<Fluent:CheckBox IsChecked="{Binding Path=IgnoreTaskbarOnMaximize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Fluent:RibbonWindow}}, FallbackValue=False}">
IgnoreTaskbarOnMaximize
</Fluent:CheckBox>

<StackPanel Orientation="Horizontal">
<Label>
BackDropType
</Label>
<ComboBox VerticalAlignment="Center"
ItemsSource="{Binding Source={StaticResource WindowBackdropTypeEnumValues}}"
SelectedItem="{Binding Path=(controlzEx:WindowBackdropManager.BackdropType), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
</StackPanel>
<Fluent:ComboBox Header="BackdropType"
VerticalAlignment="Center"
IsEditable="False"
ItemsSource="{Binding Source={StaticResource WindowBackdropTypeEnumValues}}"
SelectedItem="{Binding Path=(controlzEx:WindowBackdropManager.BackdropType), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
</WrapPanel>
</GroupBox>

Expand Down Expand Up @@ -3401,8 +3403,9 @@
</GroupBox>

<GroupBox Header="Commands">
<Button Click="HandleResetSavedState_OnClick"
Content="Reset saved state &amp; restart" />
<Fluent:Button Header="Reset saved state &amp; restart"
Click="HandleResetSavedState_OnClick"
Size="Middle" />
</GroupBox>
</StackPanel>
</GroupBox>
Expand Down
29 changes: 29 additions & 0 deletions Fluent.Ribbon/Controls/InRibbonGallery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,30 @@ public bool IsSimplified

#endregion

/// <summary>Identifies the <see cref="ExpandButtonContent"/> dependency property.</summary>
public static readonly DependencyProperty ExpandButtonContentProperty = DependencyProperty.Register(nameof(ExpandButtonContent), typeof(object), typeof(InRibbonGallery), new PropertyMetadata(LogicalChildSupportHelper.OnLogicalChildPropertyChanged));

/// <summary>
/// Gets or sets the content for the expand button.
/// </summary>
public object? ExpandButtonContent
{
get => (object?)this.GetValue(ExpandButtonContentProperty);
set => this.SetValue(ExpandButtonContentProperty, value);
}

/// <summary>Identifies the <see cref="ExpandButtonContentTemplate"/> dependency property.</summary>
public static readonly DependencyProperty ExpandButtonContentTemplateProperty = DependencyProperty.Register(nameof(ExpandButtonContentTemplate), typeof(DataTemplate), typeof(InRibbonGallery), new PropertyMetadata(default(DataTemplate)));

/// <summary>
/// Gets or sets the content template for the expand button.
/// </summary>
public DataTemplate? ExpandButtonContentTemplate
{
get => (DataTemplate?)this.GetValue(ExpandButtonContentTemplateProperty);
set => this.SetValue(ExpandButtonContentTemplateProperty, value);
}

#endregion Properties

#region Events
Expand Down Expand Up @@ -1600,6 +1624,11 @@ protected override IEnumerator LogicalChildren
{
yield return this.Header;
}

if (this.ExpandButtonContent is not null)
{
yield return this.ExpandButtonContent;
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions Fluent.Ribbon/Themes/Common.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

<Thickness x:Key="Fluent.Ribbon.Values.RibbonTabItem.Active.BorderThickness">0 0 0 2</Thickness>

<GridLength x:Key="Fluent.Ribbon.Values.MenuItem.IconColumnWidth">25</GridLength>

<PathGeometry x:Key="Fluent.Ribbon.Values.Arrow.Left">M 0 0 L -5 5 L 0 10</PathGeometry>
<PathGeometry x:Key="Fluent.Ribbon.Values.Arrow.Up">M 0 0 L -5 -5 L -10 0</PathGeometry>
<PathGeometry x:Key="Fluent.Ribbon.Values.Arrow.Right">M 0 0 L 5 -5 L -0 -10</PathGeometry>
Expand Down
Loading

0 comments on commit 5935672

Please sign in to comment.