Browse Source

Fix dock panel context menu and transparency

pull/165/head
Ionite 1 year ago
parent
commit
8b0b4480f5
No known key found for this signature in database
  1. 74
      StabilityMatrix.Avalonia/Styles/ContextMenuStyles.axaml
  2. 5
      StabilityMatrix.Avalonia/Styles/DockStyles.axaml
  3. 9
      StabilityMatrix.Avalonia/Styles/ThemeColors.axaml
  4. 3
      StabilityMatrix.Avalonia/Views/Inference/InferenceImageUpscaleView.axaml

74
StabilityMatrix.Avalonia/Styles/ContextMenuStyles.axaml

@ -0,0 +1,74 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith>
<Border
Width="400"
Height="200"
Margin="16"
Padding="48"
Background="{DynamicResource SystemAccentColor}">
<Border.ContextMenu>
<ContextMenu>
<MenuItem Header="Standard _Menu Item" />
<MenuItem Header="Disabled" IsEnabled="False" />
<Separator />
<MenuItem Header="Menu with _Submenu">
<MenuItem Header="Submenu _1" />
<MenuItem Header="Submenu _2" />
</MenuItem>
<MenuItem Header="Menu Item with _Icon" />
<MenuItem Header="Menu Item with _Checkbox">
<MenuItem.Icon>
<CheckBox
BorderThickness="0"
IsChecked="True"
IsHitTestVisible="False" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</Border.ContextMenu>
<TextBlock Text="Defined in XAML" />
</Border>
</Design.PreviewWith>
<!-- Added missing resource -->
<Thickness x:Key="MenuFlyoutScrollerMargin">0,4,0,4</Thickness>
<ControlTheme x:Key="{x:Type ContextMenu}" TargetType="ContextMenu">
<Setter Property="Background" Value="{DynamicResource MenuFlyoutPresenterBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutPresenterBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
<Setter Property="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" />
<Setter Property="MinHeight" Value="{DynamicResource MenuFlyoutThemeMinHeight}" />
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutPresenterThemePadding}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="TextBlock.FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="TextBlock.FontWeight" Value="Normal" />
<Setter Property="WindowManagerAddShadowHint" Value="False" />
<Setter Property="Template">
<ControlTemplate>
<Border
MinHeight="{TemplateBinding MinHeight}"
MaxWidth="{TemplateBinding MaxWidth}"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<ScrollViewer>
<ItemsPresenter
Name="PART_ItemsPresenter"
Margin="{DynamicResource MenuFlyoutScrollerMargin}"
Grid.IsSharedSizeScope="True"
ItemsPanel="{TemplateBinding ItemsPanel}"
KeyboardNavigation.TabNavigation="Continue" />
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>

5
StabilityMatrix.Avalonia/Styles/DockStyles.axaml

@ -16,7 +16,10 @@
</Style>
<!-- Remove accent color from active dock bar -->
<Style Selector="ToolChromeControl">
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
</Style>
<Style Selector="ToolChromeControl:active /template/ Grid#PART_Grip">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
</Style>
</Styles>

9
StabilityMatrix.Avalonia/Styles/ThemeColors.axaml

@ -35,6 +35,9 @@
<!-- Dark / light dynamic colors -->
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="ThemeBackgroundBrush" Color="#AAAAAA"/>
<SolidColorBrush x:Key="RegionColor" Color="#AAAAAA"/>
<SolidColorBrush x:Key="CompletionBorderBrush" Color="#43454A"/>
<SolidColorBrush x:Key="CompletionBackgroundBrush" Color="#2B2D30"/>
<SolidColorBrush x:Key="CompletionSecondaryBackgroundBrush" Color="#393B40"/>
@ -45,6 +48,9 @@
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="ThemeBackgroundBrush" Color="#282828"/>
<SolidColorBrush x:Key="RegionColor" Color="#282828"/>
<SolidColorBrush x:Key="CompletionBorderBrush" Color="#43454A"/>
<SolidColorBrush x:Key="CompletionBackgroundBrush" Color="#2B2D30"/>
<SolidColorBrush x:Key="CompletionSecondaryBackgroundBrush" Color="#393B40"/>
@ -55,6 +61,9 @@
</ResourceDictionary>
<ResourceDictionary x:Key="{x:Static sty:FluentAvaloniaTheme.HighContrastTheme}">
<SolidColorBrush x:Key="ThemeBackgroundBrush" Color="#AAAAAA"/>
<SolidColorBrush x:Key="RegionColor" Color="#AAAAAA"/>
<SolidColorBrush x:Key="CompletionBorderBrush" Color="#43454A"/>
<SolidColorBrush x:Key="CompletionBackgroundBrush" Color="#2B2D30"/>
<SolidColorBrush x:Key="CompletionSecondaryBackgroundBrush" Color="#393B40"/>

3
StabilityMatrix.Avalonia/Views/Inference/InferenceImageUpscaleView.axaml

@ -7,9 +7,6 @@
xmlns:icons="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:ui="using:FluentAvalonia.UI.Controls"
xmlns:vm="clr-namespace:StabilityMatrix.Avalonia.ViewModels"
xmlns:vmInference="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Inference"
d:DataContext="{x:Static mocks:DesignData.InferenceImageUpscaleViewModel}"
d:DesignHeight="450"

Loading…
Cancel
Save