-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #388 from AvaloniaCommunity/textboxMobileSupport
Implement Text Selection handles in TextBox for touch input
- Loading branch information
Showing
5 changed files
with
90 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Material.Styles/Resources/Themes/TextSelectionHandle.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<ResourceDictionary xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
<x:Double x:Key="TextSelectHandleSize">32</x:Double> | ||
<GeometryGroup x:Key="TextSelectionHandlePath" FillRule="NonZero"> | ||
<RectangleGeometry Rect="0,0,16,16"/> | ||
<EllipseGeometry Center="16,16" | ||
RadiusX="16" | ||
RadiusY="16"/> | ||
</GeometryGroup> | ||
<GeometryGroup x:Key="TextCaretHandlePath" FillRule="NonZero"> | ||
<RectangleGeometry Rect="0,0,16,16"> | ||
<RectangleGeometry.Transform> | ||
<TransformGroup > | ||
<RotateTransform CenterX="16" | ||
Angle="-45"/> | ||
</TransformGroup> | ||
</RectangleGeometry.Transform> | ||
</RectangleGeometry> | ||
<EllipseGeometry Center="16,22.7" | ||
RadiusX="16" | ||
RadiusY="16"/> | ||
</GeometryGroup> | ||
<ControlTheme x:Key="{x:Type TextSelectionHandle}" | ||
TargetType="TextSelectionHandle"> | ||
<Setter Property="Background" | ||
Value="{DynamicResource TextControlSelectionHighlightColor}" /> | ||
<Setter Property="HorizontalAlignment" | ||
Value="Center" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate> | ||
<Grid> | ||
<PathIcon | ||
Cursor="Arrow" | ||
Name="PART_HandlePathIcon" | ||
HorizontalAlignment="Stretch" | ||
Height="{DynamicResource TextSelectHandleSize}" | ||
Foreground="{TemplateBinding Background}" | ||
Data="{DynamicResource TextSelectionHandlePath}" | ||
/> | ||
</Grid> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
<Style Selector="^.caret /template/ PathIcon#PART_HandlePathIcon"> | ||
<Setter Property="Data" Value="{DynamicResource TextCaretHandlePath}" /> | ||
</Style> | ||
</ControlTheme> | ||
</ResourceDictionary> |