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

Improve lineargradient border for TextBox in Light/Dark themes #1006

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading