Skip to content

Commit

Permalink
Merge pull request #1006 from koal44/enhancement/textbox-border
Browse files Browse the repository at this point in the history
Improve lineargradient border for TextBox in Light/Dark themes
  • Loading branch information
pomianowski authored Mar 19, 2024
2 parents 7731860 + 612a785 commit 4b34485
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
7 changes: 5 additions & 2 deletions src/Wpf.Ui.Gallery/Views/Pages/Text/TextBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
controls:PageControlDocumentation.DocumentationType="{x:Type ui:TextBox}"
d:DataContext="{d:DesignInstance local:TextBoxPage,
IsDesignTimeCreatable=False}"
d:DesignHeight="450"
d:DesignHeight="750"
d:DesignWidth="800"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Expand All @@ -34,7 +34,10 @@
Margin="0,36,0,0"
HeaderText="A multi-line TextBox."
XamlCode="<ui:TextBox PlaceholderText="Type something..."TextWrapping="Wrap" />">
<ui:TextBox PlaceholderText="Type something..." TextWrapping="Wrap" />
<ui:TextBox
MinHeight="100"
PlaceholderText="Type something..."
TextWrapping="Wrap" />
</controls:ControlExample>
</StackPanel>
</Page>
6 changes: 3 additions & 3 deletions src/Wpf.Ui/Controls/TextBox/TextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
xmlns:controls="clr-namespace:Wpf.Ui.Controls"
xmlns:system="clr-namespace:System;assembly=System.Runtime">

<Thickness x:Key="TextBoxBorderThemeThickness">1,1,1,0</Thickness>
<Thickness x:Key="TextBoxBorderThemeThickness">1,1,1,1</Thickness>
<Thickness x:Key="TextBoxAccentBorderThemeThickness">0,0,0,1</Thickness>
<Thickness x:Key="TextBoxLeftIconMargin">10,0,0,0</Thickness>
<Thickness x:Key="TextBoxRightIconMargin">0,0,10,0</Thickness>
Expand Down Expand Up @@ -206,8 +206,8 @@
BorderBrush="Transparent"
Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}"
Cursor="Arrow"
IsTabStop="False"
Foreground="{DynamicResource TextControlButtonForeground}">
Foreground="{DynamicResource TextControlButtonForeground}"
IsTabStop="False">
<controls:Button.Icon>
<controls:SymbolIcon FontSize="{TemplateBinding FontSize}" Symbol="Dismiss24" />
</controls:Button.Icon>
Expand Down
9 changes: 3 additions & 6 deletions src/Wpf.Ui/Resources/Theme/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,10 @@
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>

<LinearGradientBrush x:Key="TextControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,2">
<LinearGradientBrush.RelativeTransform>
<ScaleTransform CenterY="0.5" ScaleY="-1" />
</LinearGradientBrush.RelativeTransform>
<LinearGradientBrush x:Key="TextControlElevationBorderBrush" MappingMode="RelativeToBoundingBox" StartPoint="0,0" EndPoint="0,2">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0.5" Color="{StaticResource ControlStrongStrokeColorDefault}" />
<GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" />
<GradientStop Offset="0.0" Color="{StaticResource ControlStrokeColorDefault}" />
<GradientStop Offset="1.0" Color="{StaticResource ControlStrongStrokeColorDefault}" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>

Expand Down
9 changes: 3 additions & 6 deletions src/Wpf.Ui/Resources/Theme/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,10 @@
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>

<LinearGradientBrush x:Key="TextControlElevationBorderBrush" MappingMode="Absolute" StartPoint="0,0" EndPoint="0,2">
<LinearGradientBrush.RelativeTransform>
<ScaleTransform CenterY="0.5" ScaleY="-1" />
</LinearGradientBrush.RelativeTransform>
<LinearGradientBrush x:Key="TextControlElevationBorderBrush" MappingMode="RelativeToBoundingBox" StartPoint="0,0" EndPoint="0,2">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0.5" Color="{StaticResource ControlStrongStrokeColorDefault}" />
<GradientStop Offset="1.0" Color="{StaticResource ControlStrokeColorDefault}" />
<GradientStop Offset="0.0" Color="{StaticResource ControlStrokeColorDefault}" />
<GradientStop Offset="1.0" Color="{StaticResource ControlStrongStrokeColorDefault}" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>

Expand Down

0 comments on commit 4b34485

Please sign in to comment.