Browse Source
Merge branch 'master' into devtools-property-nav
pull/7860/head
Dariusz Komosiński
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
19 additions and
1 deletions
-
src/Avalonia.Diagnostics/Diagnostics/DevToolsOptions.cs
-
src/Avalonia.Diagnostics/Diagnostics/Views/LayoutExplorerView.axaml
-
src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs
|
|
|
@ -41,5 +41,10 @@ namespace Avalonia.Diagnostics |
|
|
|
/// <remarks>Default handler is <see cref="Screenshots.FilePickerHandler"/></remarks>
|
|
|
|
public IScreenshotHandler ScreenshotHandler { get; set; } |
|
|
|
= Convetions.DefaultScreenshotHandler; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets whether DevTools should use the dark mode theme
|
|
|
|
/// </summary>
|
|
|
|
public bool UseDarkMode { get; set; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -15,6 +15,7 @@ |
|
|
|
<SolidColorBrush x:Key="PaddingHighlightBrush" Color="#CEDA8E" /> |
|
|
|
<SolidColorBrush x:Key="SizeBackgroundBrush" Color="#88B2BD" /> |
|
|
|
<SolidColorBrush x:Key="SizeHighlightBrush" Color="#9ED0DC" /> |
|
|
|
<SolidColorBrush x:Key="ThicknessEditorForeground" Color="Black" /> |
|
|
|
</UserControl.Resources> |
|
|
|
|
|
|
|
<Grid RowDefinitions="*,Auto"> |
|
|
|
@ -46,6 +47,7 @@ |
|
|
|
|
|
|
|
<controls:ThicknessEditor Grid.Row="0" Grid.Column="0" Header="margin" VerticalAlignment="Top" |
|
|
|
HorizontalAlignment="Center" |
|
|
|
TextBlock.Foreground="{StaticResource ThicknessEditorForeground}" |
|
|
|
Background="{StaticResource MarginBackgroundBrush}" |
|
|
|
Highlight="{StaticResource MarginHighlightBrush}" |
|
|
|
Thickness="{Binding MarginThickness}"> |
|
|
|
|
|
|
|
@ -11,6 +11,7 @@ using Avalonia.Input; |
|
|
|
using Avalonia.Input.Raw; |
|
|
|
using Avalonia.Markup.Xaml; |
|
|
|
using Avalonia.Styling; |
|
|
|
using Avalonia.Themes.Default; |
|
|
|
using Avalonia.VisualTree; |
|
|
|
|
|
|
|
namespace Avalonia.Diagnostics.Views |
|
|
|
@ -242,7 +243,17 @@ namespace Avalonia.Diagnostics.Views |
|
|
|
|
|
|
|
private void RootClosed(object? sender, EventArgs e) => Close(); |
|
|
|
|
|
|
|
public void SetOptions(DevToolsOptions options) => |
|
|
|
public void SetOptions(DevToolsOptions options) |
|
|
|
{ |
|
|
|
(DataContext as MainViewModel)?.SetOptions(options); |
|
|
|
|
|
|
|
if (options.UseDarkMode) |
|
|
|
{ |
|
|
|
if (Styles[0] is SimpleTheme st) |
|
|
|
{ |
|
|
|
st.Mode = SimpleThemeMode.Dark; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|