Selaa lähdekoodia

Changes after review

Max Katz 4 vuotta sitten
vanhempi
sitoutus
67812f4e90

+ 12 - 3
src/Avalonia.Diagnostics/Diagnostics/Controls/FilterTextBox.axaml

@@ -17,9 +17,13 @@
         <StackPanel Orientation="Horizontal" Spacing="1">
           <Button Margin="0,0,2,0"
                   Classes="textBoxClearButton"
+                  ToolTip.Tip="Clear"
+                  Cursor="Hand"
                   Command="{ReflectionBinding $parent[TextBox].Clear}"
                   Opacity="0.5" />
-          <ToggleButton Classes="filter-text-box-toggle" IsChecked="{Binding $parent[controls:FilterTextBox].UseCaseSensitiveFilter}">
+          <ToggleButton Classes="filter-text-box-toggle"
+                        ToolTip.Tip="Match Case"
+                        IsChecked="{Binding $parent[controls:FilterTextBox].UseCaseSensitiveFilter}">
             <Image>
               <DrawingImage>
                 <GeometryDrawing Brush="{Binding $parent[ToggleButton].Foreground}">
@@ -28,7 +32,9 @@
               </DrawingImage>
             </Image>
           </ToggleButton>
-          <ToggleButton Classes="filter-text-box-toggle" IsChecked="{Binding $parent[controls:FilterTextBox].UseWholeWordFilter}">
+          <ToggleButton Classes="filter-text-box-toggle"
+                        ToolTip.Tip="Match Whole Word"
+                        IsChecked="{Binding $parent[controls:FilterTextBox].UseWholeWordFilter}">
             <Image>
               <DrawingImage>
                 <GeometryDrawing Brush="{Binding $parent[ToggleButton].Foreground}">
@@ -37,7 +43,9 @@
               </DrawingImage>
             </Image>
           </ToggleButton>
-          <ToggleButton Classes="filter-text-box-toggle" IsChecked="{Binding $parent[controls:FilterTextBox].UseRegexFilter}">
+          <ToggleButton Classes="filter-text-box-toggle"
+                        ToolTip.Tip="Use Regular Expression"
+                        IsChecked="{Binding $parent[controls:FilterTextBox].UseRegexFilter}">
             <Image>
               <DrawingImage>
                 <GeometryDrawing Brush="{Binding $parent[ToggleButton].Foreground}">
@@ -71,6 +79,7 @@
   </Style>
 
   <Style Selector="ToggleButton.filter-text-box-toggle">
+    <Setter Property="Cursor" Value="Hand" />
     <Setter Property="Padding" Value="0,1" />
     <Setter Property="Width" Value="24" />
     <Setter Property="BorderThickness" Value="1" />

+ 3 - 3
src/Avalonia.Diagnostics/Diagnostics/ViewModels/FilterViewModel.cs

@@ -9,7 +9,7 @@ namespace Avalonia.Diagnostics.ViewModels
     internal class FilterViewModel : ViewModelBase, INotifyDataErrorInfo
     {
         private readonly Dictionary<string, string> _errors = new Dictionary<string, string>();
-        private string _propertyString = string.Empty;
+        private string _filterString = string.Empty;
         private bool _useRegexFilter, _useCaseSensitiveFilter, _useWholeWordFilter;
         private string _processedFilter;
         private Regex _filterRegex;
@@ -59,10 +59,10 @@ namespace Avalonia.Diagnostics.ViewModels
 
         public string FilterString
         {
-            get => _propertyString;
+            get => _filterString;
             set
             {
-                if (RaiseAndSetIfChanged(ref _propertyString, value))
+                if (RaiseAndSetIfChanged(ref _filterString, value))
                 {
                     UpdateFilterRegex();
                     RefreshFilter?.Invoke(this, EventArgs.Empty);

+ 4 - 3
src/Avalonia.Themes.Default/TextBox.xaml

@@ -113,13 +113,13 @@
   </Style>
   
   <Style Selector="Button.textBoxClearButton">
+    <Setter Property="Cursor" Value="Arrow" />
     <Setter Property="Template">
       <Setter.Value>
         <ControlTemplate TargetType="Button">
           <Border x:Name="PART_ButtonLayoutBorder"
                   BorderThickness="{TemplateBinding BorderThickness}" 
-                  Background="Transparent" 
-                  Cursor="Arrow">
+                  Background="Transparent">
             <Path x:Name="PART_GlyphElement"
                   Fill="{DynamicResource ThemeForegroundColor}"
                   Data="{StaticResource TextBoxClearButtonData}"
@@ -146,13 +146,14 @@
               <Setter Property="(ToolTip.Tip)" Value="Show Password" />
             </Style>
           </Panel.Styles>
-          <ToggleButton Classes="passwordBoxRevealButton" Background="Transparent" Cursor="Arrow" IsChecked="{Binding $parent[TextBox].RevealPassword, Mode=TwoWay}" />
+          <ToggleButton Classes="passwordBoxRevealButton" Background="Transparent" IsChecked="{Binding $parent[TextBox].RevealPassword, Mode=TwoWay}" />
         </Panel>
       </Template>
     </Setter>
   </Style>
   
   <Style Selector="ToggleButton.passwordBoxRevealButton">
+    <Setter Property="Cursor" Value="Arrow" />
     <Setter Property="Template">
       <Setter.Value>
         <ControlTemplate TargetType="ToggleButton">