Browse Source

Fix #13249 Mouse cursor on TextBox scrollbars shows as caret (#13542)

* Add styles to scrollviewers

* pr comment fix

* remove styles from scrollviewer

* add styles to scrollviewers

* add Ibeam to floating watermark

---------

Co-authored-by: Robert Mutniański <robert.mutnianski@inetum.com>
pull/13673/head
Robert Mutniański 3 years ago
committed by GitHub
parent
commit
e43311bd46
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml
  2. 10
      src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
  3. 2
      src/Avalonia.Themes.Simple/Controls/ScrollViewer.xaml
  4. 8
      src/Avalonia.Themes.Simple/Controls/TextBox.xaml

4
src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml

@ -44,10 +44,10 @@
</ScrollContentPresenter>
<ScrollBar Name="PART_HorizontalScrollBar"
Orientation="Horizontal"
Grid.Row="1" />
Grid.Row="1"/>
<ScrollBar Name="PART_VerticalScrollBar"
Orientation="Vertical"
Grid.Column="1" />
Grid.Column="1"/>
<Panel x:Name="PART_ScrollBarsSeparator"
Grid.Row="1"
Grid.Column="1"

10
src/Avalonia.Themes.Fluent/Controls/TextBox.xaml

@ -131,7 +131,6 @@
<DockPanel x:Name="PART_InnerDockPanel"
Grid.Column="1"
Grid.ColumnSpan="1"
Cursor="IBeam"
Margin="{TemplateBinding Padding}">
<TextBlock Name="PART_FloatingWatermark"
Foreground="{DynamicResource SystemAccentColor}"
@ -171,6 +170,11 @@
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Panel>
<ScrollViewer.Styles>
<Style Selector="ScrollContentPresenter#PART_ContentPresenter">
<Setter Property="Cursor" Value="IBeam" />
</Style>
</ScrollViewer.Styles>
</ScrollViewer>
</DockPanel>
<ContentPresenter Grid.Column="2" Grid.ColumnSpan="1" Content="{TemplateBinding InnerRightContent}"/>
@ -228,6 +232,10 @@
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/>
</Style>
<Style Selector="^ /template/ TextBlock#PART_FloatingWatermark">
<Setter Property="Cursor" Value="IBeam"/>
</Style>
<Style Selector="^[UseFloatingWatermark=true]:not(:empty) /template/ TextBlock#PART_FloatingWatermark">
<Setter Property="IsVisible" Value="True" />
</Style>

2
src/Avalonia.Themes.Simple/Controls/ScrollViewer.xaml

@ -31,7 +31,7 @@
Orientation="Vertical"/>
<Panel Grid.Row="1"
Grid.Column="1"
Background="{DynamicResource ThemeControlMidBrush}" />
Background="{DynamicResource ThemeControlMidBrush}"/>
</Grid>
</ControlTemplate>
</Setter>

8
src/Avalonia.Themes.Simple/Controls/TextBox.xaml

@ -157,6 +157,11 @@
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}" />
</Panel>
<ScrollViewer.Styles>
<Style Selector="ScrollContentPresenter#PART_ContentPresenter">
<Setter Property="Cursor" Value="IBeam" />
</Style>
</ScrollViewer.Styles>
</ScrollViewer>
<ContentPresenter Grid.Column="2"
Grid.ColumnSpan="1"
@ -183,6 +188,9 @@
<Style Selector="^:disabled /template/ Border#border">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
</Style>
<Style Selector="^ /template/ TextBlock#floatingWatermark">
<Setter Property="Cursor" Value="IBeam"/>
</Style>
<Style Selector="^.clearButton[AcceptsReturn=False][IsReadOnly=False]:focus:not(TextBox:empty)">
<Setter Property="InnerRightContent">

Loading…
Cancel
Save