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

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

Merged
merged 12 commits into from
Nov 20, 2023
4 changes: 2 additions & 2 deletions src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 9 additions & 1 deletion src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"/>
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Themes.Simple/Controls/ScrollViewer.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Orientation="Vertical"/>
<Panel Grid.Row="1"
Grid.Column="1"
Background="{DynamicResource ThemeControlMidBrush}" />
Background="{DynamicResource ThemeControlMidBrush}"/>
</Grid>
</ControlTemplate>
</Setter>
Expand Down
8 changes: 8 additions & 0 deletions src/Avalonia.Themes.Simple/Controls/TextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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">
Expand Down