Browse Source

Merge pull request #4950 from pr8x/devtools-misc-fixes

Devtools misc fixes
Benedikt Stebner 5 years ago
parent
commit
f1301f4aa3

+ 7 - 0
src/Avalonia.Diagnostics/Diagnostics/ViewModels/TreeNode.cs

@@ -23,6 +23,8 @@ namespace Avalonia.Diagnostics.ViewModels
 
             if (visual is IControl control)
             {
+                ElementName = control.Name;
+
                 var removed = Observable.FromEventPattern<LogicalTreeAttachmentEventArgs>(
                     x => control.DetachedFromLogicalTree += x,
                     x => control.DetachedFromLogicalTree -= x);
@@ -61,6 +63,11 @@ namespace Avalonia.Diagnostics.ViewModels
             private set { RaiseAndSetIfChanged(ref _classes, value); }
         }
 
+        public string ElementName
+        {
+            get;
+        }
+
         public IVisual Visual
         {
             get;

+ 6 - 0
src/Avalonia.Diagnostics/Diagnostics/Views/ControlDetailsView.xaml

@@ -26,6 +26,12 @@
         <DataGridTextColumn Header="Type" Binding="{Binding Type}" />
         <DataGridTextColumn Header="Priority" Binding="{Binding Priority}" IsReadOnly="True" />
       </DataGrid.Columns>
+
+      <DataGrid.Styles>
+        <Style Selector="DataGridRow TextBox">
+          <Setter Property="SelectionBrush" Value="LightBlue"/>
+        </Style>
+      </DataGrid.Styles>
     </DataGrid>
 
   </Grid>

+ 2 - 1
src/Avalonia.Diagnostics/Diagnostics/Views/TreePageView.xaml

@@ -2,7 +2,7 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:vm="clr-namespace:Avalonia.Diagnostics.ViewModels"
              x:Class="Avalonia.Diagnostics.Views.TreePageView">
-  <Grid ColumnDefinitions="*,4,3*">    
+  <Grid ColumnDefinitions="0.8*,4,*">    
     <TreeView Name="tree"
               BorderThickness="0"
               Items="{Binding Nodes}"
@@ -13,6 +13,7 @@
           <StackPanel Orientation="Horizontal" Spacing="8">
             <TextBlock Text="{Binding Type}"/>
             <TextBlock Text="{Binding Classes}"/>
+            <TextBlock Foreground="Gray" Text="{Binding ElementName}"/>
           </StackPanel>
         </TreeDataTemplate>
       </TreeView.DataTemplates>