Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kikipoulet committed Jan 27, 2025
1 parent aff7895 commit 7fa81b6
Showing 1 changed file with 2 additions and 210 deletions.
212 changes: 2 additions & 210 deletions SukiUI/Theme/TextBoxStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
FontSize="13"
FontWeight="{DynamicResource DefaultDemiBold}"
Text="Username" />
<TextBox />
<TextBox BorderThickness="1" BorderBrush="Red" />

<TextBlock Margin="6,18,0,3"
FontSize="13"
Expand Down Expand Up @@ -123,214 +123,6 @@

</Style>

<Style Selector="TextBox.Prefix">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="1.2" />
<Setter Property="BorderBrush" Value="{DynamicResource SukiControlBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource SmallCornerRadius}" />
<Setter Property="Background" Value="{DynamicResource SukiBackground}" />
<Setter Property="CaretBrush" Value="{DynamicResource ThemeForegroundBrush}" />

<Setter Property="SelectionBrush" Value="{DynamicResource HighlightBrush}" />
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource HighlightForegroundBrush}" />
<Setter Property="Padding" Value="4" />
<Setter Property="ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" />

<Setter Property="Template">
<ControlTemplate>
<Border Padding="5">
<Border Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
BoxShadow="{DynamicResource SukiLowShadow}"
CornerRadius="{TemplateBinding CornerRadius}">
<Border.Transitions>
<Transitions>
<BrushTransition Property="BorderBrush" Duration="0:0:0.2" />
</Transitions>
</Border.Transitions>
<DockPanel>

<Border Margin="0,0,0,0"
Padding="8,5"
Background="Transparent"
BorderBrush="{DynamicResource SukiControlBorderBrush}"
BorderThickness="0,0,0,0"
CornerRadius="5,0,0,5"
DockPanel.Dock="Left">
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Gray"
Text="{TemplateBinding Watermark}" />
</Border>


<DockPanel Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">

<TextBlock Name="floatingWatermark"
DockPanel.Dock="Top"
Foreground="{DynamicResource ThemeAccentBrush}"
Text="{TemplateBinding Watermark}">
<TextBlock.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="UseFloatingWatermark" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Converter="{x:Static StringConverters.IsNotNullOrEmpty}"
Path="Text"
RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</TextBlock.IsVisible>
</TextBlock>

<DataValidationErrors>

<Grid ColumnDefinitions="Auto,*,Auto">
<ContentPresenter Grid.Column="0" Content="{TemplateBinding InnerLeftContent}" />
<ScrollViewer Grid.Column="1"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<Panel Margin="0,0,0,0">
<TextBlock Name="watermark"
IsVisible="{TemplateBinding Text,
Converter={x:Static StringConverters.IsNullOrEmpty}}"
Opacity="0.5"
Text="{TemplateBinding Watermark}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />
<TextPresenter Name="PART_TextPresenter"
CaretBrush="{TemplateBinding CaretBrush}"
CaretIndex="{TemplateBinding CaretIndex}"
PasswordChar="{TemplateBinding PasswordChar}"
RevealPassword="{TemplateBinding RevealPassword}"
SelectionBrush="{TemplateBinding SelectionBrush}"
SelectionEnd="{TemplateBinding SelectionEnd}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
SelectionStart="{TemplateBinding SelectionStart}"
Text="{TemplateBinding Text,
Mode=TwoWay}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />
</Panel>
</ScrollViewer>
<ContentPresenter Grid.Column="2" Content="{TemplateBinding InnerRightContent}" />
</Grid>
</DataValidationErrors>
</DockPanel>
</DockPanel>
</Border>
</Border>
</ControlTemplate>
</Setter>
</Style>


<Style Selector="TextBox.Suffix">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="1.2" />
<Setter Property="BorderBrush" Value="{DynamicResource SukiControlBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource SmallCornerRadius}" />
<Setter Property="Background" Value="{DynamicResource SukiBackground}" />
<Setter Property="CaretBrush" Value="{DynamicResource ThemeForegroundBrush}" />

<Setter Property="SelectionBrush" Value="{DynamicResource HighlightBrush}" />
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource HighlightForegroundBrush}" />
<Setter Property="Padding" Value="4" />
<Setter Property="ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" />

<Setter Property="Template">
<ControlTemplate>
<Border Padding="5">
<Border Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
BoxShadow="{DynamicResource SukiLowShadow}"
CornerRadius="{TemplateBinding CornerRadius}">
<Border.Transitions>
<Transitions>
<BrushTransition Property="BorderBrush" Duration="0:0:0.2" />
</Transitions>
</Border.Transitions>
<DockPanel>

<Border Margin="0,0,0,0"
Padding="8,5"
Background="Transparent"
BorderBrush="{DynamicResource SukiControlBorderBrush}"
BorderThickness="0,0,0,0"
CornerRadius="0,5,5,0"
DockPanel.Dock="Right">
<TextBlock HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="Gray"
Text="{TemplateBinding Watermark}" />
</Border>


<DockPanel Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">

<TextBlock Name="floatingWatermark"
DockPanel.Dock="Top"
Foreground="{DynamicResource ThemeAccentBrush}"
Text="{TemplateBinding Watermark}">
<TextBlock.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding Path="UseFloatingWatermark" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding Converter="{x:Static StringConverters.IsNotNullOrEmpty}"
Path="Text"
RelativeSource="{RelativeSource TemplatedParent}" />
</MultiBinding>
</TextBlock.IsVisible>
</TextBlock>

<DataValidationErrors>

<Grid ColumnDefinitions="Auto,*,Auto">
<ContentPresenter Grid.Column="0" Content="{TemplateBinding InnerLeftContent}" />
<ScrollViewer Grid.Column="1"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<Panel>
<TextBlock Name="watermark"
IsVisible="{TemplateBinding Text,
Converter={x:Static StringConverters.IsNullOrEmpty}}"
Opacity="0.5"
Text="{TemplateBinding Watermark}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />


<TextPresenter Name="PART_TextPresenter"
CaretBrush="{TemplateBinding CaretBrush}"
CaretIndex="{TemplateBinding CaretIndex}"
PasswordChar="{TemplateBinding PasswordChar}"
RevealPassword="{TemplateBinding RevealPassword}"
SelectionBrush="{TemplateBinding SelectionBrush}"
SelectionEnd="{TemplateBinding SelectionEnd}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
SelectionStart="{TemplateBinding SelectionStart}"
Text="{TemplateBinding Text,
Mode=TwoWay}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />

</Panel>
</ScrollViewer>
<ContentPresenter Grid.Column="2" Content="{TemplateBinding InnerRightContent}" />
</Grid>

</DataValidationErrors>
</DockPanel>
</DockPanel>
</Border>
</Border>
</ControlTemplate>
</Setter>
</Style>

<Style Selector="TextBox">
<Setter Property="VerticalContentAlignment" Value="Center" />
Expand Down Expand Up @@ -360,7 +152,7 @@
Padding="0"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Classes="Discrete"

CornerRadius="{TemplateBinding CornerRadius}">
<suki:GlassCard.Transitions>
<Transitions>
Expand Down

0 comments on commit 7fa81b6

Please sign in to comment.