Hi,
Is there a way to change the width (11px) of the two scroll buttons in the ribbon? They show when the ribbon has nothing else to collapse or all groups in a tab have IsCollapsible="False".
Thanks.
[Modified 7 years ago]
Hi,
Is there a way to change the width (11px) of the two scroll buttons in the ribbon? They show when the ribbon has nothing else to collapse or all groups in a tab have IsCollapsible="False".
Thanks.
[Modified 7 years ago]
Nevermind, I figured it out. Getting the default style of the GroupPresenter then adding a MinWidth to each button did it.
Hi Adam,
Right now the default style for the ScrollLeftButton is:
<Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ribbon:Ribbon},ResourceId=ScrollLeftButton}" TargetType="{x:Type Button}">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Visibility" Value="Collapsed" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="RibbonGroupScrollButtonBorder" Margin="{TemplateBinding Margin}"
Background="{DynamicResource {x:Static themes:AssetResourceKeys.RibbonTabControlBackgroundNormalBrushKey}}"
BorderBrush="{DynamicResource {x:Static themes:AssetResourceKeys.RibbonTabControlBorderNormalBrushKey}}"
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3,0,0,3" SnapsToDevicePixels="True">
<Path Margin="3" VerticalAlignment="Center" HorizontalAlignment="Center"
Fill="{DynamicResource {x:Static themes:AssetResourceKeys.MenuItemPopupGlyphBackgroundNormalBrushKey}}"
Data="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type ribbon:Ribbon},ResourceId=MenuScrollViewerLeftArrow}}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="RibbonGroupScrollButtonBorder" Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.ToolBarButtonLargeBackgroundHoverBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
You could probably override that Template in a cloned implicit Style in your App.Resources. The matching ScrollRightButton Style is the same other than using a MenuScrollViewerRightArrow resource in the Path.
Or you could do it how you did it as well.
That works to, thanks.
Please log in to a validated account to post comments.