Skip to content

Commit

Permalink
Fix watermark alignment
Browse files Browse the repository at this point in the history
Fix alignment of watermark hosts in text boxes, combo boxes and date pickers. Watermarks did not respect content alignment properties resulting in misplaced watermarks when the controls' heights were specified explicitly.
  • Loading branch information
benruehl committed Oct 14, 2020
1 parent 26e6eee commit a4a2387
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/AdonisUI.ClassicTheme/DefaultStyles/ComboBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@
<Grid>
<ContentPresenter x:Name="PlaceholderHost"
Content="{Binding Path=(adonisExtensions:WatermarkExtension.Watermark), RelativeSource={RelativeSource FindAncestor, AncestorType=ComboBox}}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Opacity="0.5"
IsHitTestVisible="False"
Visibility="Collapsed"/>
Expand Down
4 changes: 2 additions & 2 deletions src/AdonisUI.ClassicTheme/DefaultStyles/DatePicker.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<ContentPresenter x:Name="PlaceholderHost"
Content="{Binding Path=(adonisExtensions:WatermarkExtension.Watermark), RelativeSource={RelativeSource FindAncestor, AncestorType=DatePicker}}"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Opacity="0.5"
IsHitTestVisible="False"
Visibility="Collapsed"/>
Expand Down
4 changes: 2 additions & 2 deletions src/AdonisUI.ClassicTheme/DefaultStyles/TextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
<Grid>
<ContentPresenter x:Name="PlaceholderHost"
Content="{TemplateBinding adonisExtensions:WatermarkExtension.Watermark}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Opacity="0.5"
IsHitTestVisible="False"
Visibility="Collapsed"/>
Expand Down

0 comments on commit a4a2387

Please sign in to comment.