Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to correct the borderThickess of GroupBox when the value of basecolors is dark #818

Open
verk123 opened this issue Jun 16, 2020 · 1 comment
Assignees

Comments

@verk123
Copy link

verk123 commented Jun 16, 2020

from:https://docs.microsoft.com/en-us/dotnet/framework/wpf/controls/how-to-define-a-groupbox-template
Before:
before

After:
after

Add the following code into RibbonGroupBox.xaml

<BorderGapMaskConverter x:Key="BorderGapMaskConverter"/> <Style x:Key="{x:Type GroupBox}" TargetType="{x:Type GroupBox}"> <!--<Setter Property="BorderBrush" Value="Gray"/> <Setter Property="Foreground" Value="White"/>--> <Setter Property="BorderThickness" Value="1"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupBox}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="4"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> <ColumnDefinition Width="4"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> <RowDefinition Height="4"/> </Grid.RowDefinitions> <Border CornerRadius="4" Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Grid.ColumnSpan="4" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="Transparent" Background="{TemplateBinding Background}"/> <!-- ContentPresenter for the header --> <Border x:Name="Header" Padding="6,0,6,0" Grid.Row="0" Grid.RowSpan="2" Grid.Column="1"> <ContentPresenter ContentSource="Header" RecognizesAccessKey="True" /> </Border> <!-- Primary content for GroupBox --> <ContentPresenter Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Margin="{TemplateBinding Padding}"/> <Border CornerRadius="0" Grid.Row="1" Grid.RowSpan="3" Grid.ColumnSpan="4" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"> <Border.OpacityMask> <MultiBinding Converter= "{StaticResource BorderGapMaskConverter}" ConverterParameter="6"> <Binding ElementName="Header" Path="ActualWidth"/> <Binding RelativeSource="{RelativeSource Self}" Path="ActualWidth"/> <Binding RelativeSource="{RelativeSource Self}" Path="ActualHeight"/> </MultiBinding> </Border.OpacityMask> </Border> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>

@verk123 verk123 changed the title A way to remove the white border line from RibbonGroupBox when the value of basecolors is dark A way to correct the borderThickess of RibbonGroupBox when the value of basecolors is dark Jun 16, 2020
@batzen
Copy link
Member

batzen commented Jun 16, 2020

Thanks for your suggestion.
I might add this, or something like this, to the showcase application to improve it's look.

But styling default WPF elements, outside of the ribbon itself, is not the scope of Fluent.Ribbon.

@batzen batzen self-assigned this Jun 16, 2020
@batzen batzen added the Styles label Jun 16, 2020
@batzen batzen changed the title A way to correct the borderThickess of RibbonGroupBox when the value of basecolors is dark A way to correct the borderThickess of GroupBox when the value of basecolors is dark Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants