Fix DataGrid Cell click bug

This commit is contained in:
CHINBOY
2025-07-13 10:50:03 +08:00
parent 3edacf3f9d
commit 12c65dd1c7
5 changed files with 9 additions and 23 deletions
@@ -22,7 +22,7 @@ namespace AtomUI.Controls;
[TemplatePart(DataGridCellThemeConstants.RightGridLinePart, typeof(Rectangle))]
[PseudoClasses(StdPseudoClass.Selected, StdPseudoClass.Current, StdPseudoClass.Edited, StdPseudoClass.Invalid,
StdPseudoClass.Focus)]
public class DataGridCell : ContentControl, ICustomHitTest
public class DataGridCell : ContentControl
{
#region 公共属性定义
@@ -354,8 +354,8 @@ public class DataGridCell : ContentControl, ICustomHitTest
_compositeDisposable.Clear();
}
public bool HitTest(Point point)
{
return true;
}
// public bool HitTest(Point point)
// {
// return true;
// }
}
@@ -58,6 +58,7 @@
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="ClipToBounds" Value="False"/>
<Setter Property="Background" Value="Transparent"/>
<Style Selector="^ /template/ Rectangle#PART_RightGridLine">
<Setter Property="Fill" Value="{DynamicResource {x:Static atom:DataGridTokenKey.TableBorderColor}}"/>
@@ -5,13 +5,11 @@
<ControlTheme x:Key="{x:Type atom:HyperLinkTextBlock}" TargetType="atom:HyperLinkTextBlock">
<Setter Property="Template">
<ControlTemplate>
<TextBlock Name="{x:Static atom:HyperLinkTextBlockThemeConstants.TextPart}"
<atom:TextBlock Name="{x:Static atom:HyperLinkTextBlockThemeConstants.TextPart}"
FontWeight="{TemplateBinding FontWeight}"
FontStyle="{TemplateBinding FontStyle}"
FontSize="{TemplateBinding FontSize}"
Text="{TemplateBinding Text}">
</TextBlock>
Text="{TemplateBinding Text}"/>
</ControlTemplate>
</Setter>
@@ -1,14 +0,0 @@
using Avalonia.Styling;
namespace AtomUI.Controls;
public class CaptionButtonThemeProvider
{
public object Key { get; } = typeof(CaptionButton);
public Type TargetType { get; } = typeof(Button);
public ControlTheme BuildControlTheme()
{
return default!;
}
}
+1
View File
@@ -4,4 +4,5 @@ using AvaloniaTitleBar = Avalonia.Controls.Chrome.TitleBar;
public class TitleBar : AvaloniaTitleBar
{
protected override Type StyleKeyOverride { get; } = typeof(AvaloniaTitleBar);
}