Skip to content

Commit

Permalink
DYN-5844-ColorPicker-MarginIssues (#13986)
Browse files Browse the repository at this point in the history
We have a Canvas inside a Grid but the Canvas doesn't support auto-size like other WPF controls then the only way to fix the problem of the CustomColorPicker appearing wrong under a 200% scale is to use a fixed height.
In this way this fix will make the NormalColors window with the same height than the CustomColors window.
  • Loading branch information
RobertGlobant20 authored May 12, 2023
1 parent 6b3e291 commit 0990de5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/DynamoCoreWpf/Views/Core/CustomColorPicker.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="420"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="420" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand All @@ -345,18 +345,18 @@
<Canvas
x:Name="PART_ColorShadingCanvas"
Width="420"
Height="200"
MinHeight="120"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Rectangle
x:Name="ColorShadingRectangle"
Width="{Binding ElementName=PART_ColorShadingCanvas, Path=Width}"
Height="{Binding ElementName=PART_ColorShadingCanvas, Path=Height}"
MinHeight="120"
Fill="{Binding SelectedColor, ElementName=PART_SpectrumSlider, Converter={StaticResource ColorToSolidColorBrushConverter}}" />
<Rectangle
x:Name="WhiteGradient"
Width="{Binding ElementName=PART_ColorShadingCanvas, Path=Width}"
Height="{Binding ElementName=PART_ColorShadingCanvas, Path=Height}">
MinHeight="120">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Offset="0" Color="#ffffffff" />
Expand All @@ -367,7 +367,7 @@
<Rectangle
x:Name="BlackGradient"
Width="{Binding ElementName=PART_ColorShadingCanvas, Path=Width}"
Height="{Binding ElementName=PART_ColorShadingCanvas, Path=Height}">
MinHeight="120">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,1" EndPoint="0, 0">
<GradientStop Offset="0" Color="#ff000000" />
Expand Down Expand Up @@ -669,7 +669,7 @@
FontSize="20"
FontWeight="Bold"
Foreground="Black"
Text="{x:Static p:Resources.CustomColorPickerTitle}"/>
Text="{x:Static p:Resources.CustomColorPickerTitle}" />
<Button
Name="NormalColorsCloseButton"
Grid.Column="1"
Expand All @@ -694,8 +694,8 @@
Margin="0,10,0,0"
Padding="2"
Background="Transparent"
FontSize="14"
FontFamily="{StaticResource ArtifaktElementRegular}"
FontSize="14"
Foreground="Black"
Text="{x:Static p:Resources.CustomColorPickerBasicColors}" />

Expand Down

0 comments on commit 0990de5

Please sign in to comment.