fix: fix drawer measure
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:helpers="clr-namespace:Irihi.Avalonia.Shared.Helpers;assembly=Irihi.Avalonia.Shared">
|
||||
xmlns:helpers="clr-namespace:Irihi.Avalonia.Shared.Helpers;assembly=Irihi.Avalonia.Shared"
|
||||
xmlns:u="https://irihi.tech/ursa">
|
||||
|
||||
<ControlTheme x:Key="{x:Type u:OverlayDialogHost}" TargetType="u:OverlayDialogHost">
|
||||
<Setter Property="OverlayMaskBrush" Value="{DynamicResource OverlayDialogMaskBrush}" />
|
||||
@@ -26,20 +26,22 @@
|
||||
Padding="0"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Background="{DynamicResource SemiColorBackground2}"
|
||||
Classes="Shadow"
|
||||
ClipToBounds="False"
|
||||
Background="{DynamicResource SemiColorBackground2}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Focusable="True"
|
||||
IsHitTestVisible="True"
|
||||
Theme="{DynamicResource CardBorder}">
|
||||
<Border ClipToBounds="True" CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
<ScrollViewer
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Content="{TemplateBinding Content}" />
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ContentPresenter Name="PART_ContentPresenter" Content="{TemplateBinding Content}" />
|
||||
</ScrollViewer>
|
||||
<Grid Grid.Row="0" ColumnDefinitions="*, Auto">
|
||||
<Panel
|
||||
Name="{x:Static u:DialogControlBase.PART_TitleArea}"
|
||||
@@ -56,7 +58,7 @@
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
<u:DialogResizer IsVisible="{TemplateBinding CanResize}" Margin="{Binding #PART_Border.Margin}" />
|
||||
<u:DialogResizer Margin="{Binding #PART_Border.Margin}" IsVisible="{TemplateBinding CanResize}" />
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
@@ -75,9 +77,7 @@
|
||||
<MenuFlyout>
|
||||
<MenuItem Command="{Binding $parent[u:DialogControlBase].Close}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource SemiIconClose}" />
|
||||
<PathIcon Data="{DynamicResource SemiIconClose}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuFlyout>
|
||||
@@ -91,9 +91,7 @@
|
||||
CommandParameter="{x:Static u:DialogLayerChangeType.BringForward}"
|
||||
Header="{DynamicResource STRING_MENU_BRING_FORWARD}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource DialogArrangeBringForwardGlyph}" />
|
||||
<PathIcon Data="{DynamicResource DialogArrangeBringForwardGlyph}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
@@ -101,9 +99,7 @@
|
||||
CommandParameter="{x:Static u:DialogLayerChangeType.BringToFront}"
|
||||
Header="{DynamicResource STRING_MENU_BRING_TO_FRONT}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource DialogArrangeBringToFrontGlyph}" />
|
||||
<PathIcon Data="{DynamicResource DialogArrangeBringToFrontGlyph}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
@@ -111,9 +107,7 @@
|
||||
CommandParameter="{x:Static u:DialogLayerChangeType.SendBackward}"
|
||||
Header="{DynamicResource STRING_MENU_SEND_BACKWARD}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource DialogArrangeSendBackwardGlyph}" />
|
||||
<PathIcon Data="{DynamicResource DialogArrangeSendBackwardGlyph}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
@@ -121,16 +115,12 @@
|
||||
CommandParameter="{x:Static u:DialogLayerChangeType.SendToBack}"
|
||||
Header="{DynamicResource STRING_MENU_SEND_TO_BACK}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource DialogArrangeSendToBackGlyph}" />
|
||||
<PathIcon Data="{DynamicResource DialogArrangeSendToBackGlyph}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding $parent[u:DialogControlBase].Close}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource SemiIconClose}" />
|
||||
<PathIcon Data="{DynamicResource SemiIconClose}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuFlyout>
|
||||
@@ -155,9 +145,9 @@
|
||||
Padding="0"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Background="{DynamicResource SemiColorBackground2}"
|
||||
BoxShadow="0 0 8 0 #1A000000"
|
||||
Classes="Shadow"
|
||||
Background="{DynamicResource SemiColorBackground2}"
|
||||
ClipToBounds="False"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Focusable="True"
|
||||
@@ -165,7 +155,10 @@
|
||||
Theme="{DynamicResource CardBorder}">
|
||||
<Border ClipToBounds="True" CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid RowDefinitions="Auto, *, Auto">
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<ScrollViewer
|
||||
Grid.Row="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Margin="24,8"
|
||||
@@ -180,10 +173,10 @@
|
||||
<PathIcon
|
||||
Name="PART_Icon"
|
||||
Grid.Column="0"
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Classes="ExtraLarge"
|
||||
Margin="24,24,8,0"
|
||||
VerticalAlignment="Center" />
|
||||
VerticalAlignment="Center"
|
||||
Classes="ExtraLarge"
|
||||
Theme="{StaticResource InnerPathIcon}" />
|
||||
<TextBlock
|
||||
Name="PART_Title"
|
||||
Grid.Column="1"
|
||||
@@ -208,24 +201,16 @@
|
||||
Margin="24,0,24,24"
|
||||
HorizontalAlignment="Right"
|
||||
ColumnDefinitions="Auto, Auto, Auto, Auto">
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_CancelButton}"
|
||||
Margin="8,0,0,0" />
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_NoButton}"
|
||||
Margin="8,0,0,0"/>
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_YesButton}"
|
||||
Margin="8,0,0,0"/>
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_OKButton}"
|
||||
Margin="8,0,0,0"/>
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_CancelButton}" Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_NoButton}" Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_YesButton}" Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_OKButton}" Margin="8,0,0,0" />
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
<u:DialogResizer IsVisible="{TemplateBinding CanResize}" Margin="{Binding #PART_Border.Margin}"/>
|
||||
<u:DialogResizer Margin="{Binding #PART_Border.Margin}" IsVisible="{TemplateBinding CanResize}" />
|
||||
</Panel>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
@@ -245,19 +230,19 @@
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_CANCEL}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_NoButton">
|
||||
<Setter Property="Grid.Column" Value="1"></Setter>
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="helpers:ClassHelper.Classes" Value="Danger" />
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_NO}" />
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_YesButton">
|
||||
<Setter Property="Grid.Column" Value="2"></Setter>
|
||||
<Setter Property="Grid.Column" Value="2" />
|
||||
<Setter Property="helpers:ClassHelper.Classes" Value="Primary" />
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_YES}" />
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_OKButton">
|
||||
<Setter Property="Grid.Column" Value="3"></Setter>
|
||||
<Setter Property="Grid.Column" Value="3" />
|
||||
<Setter Property="helpers:ClassHelper.Classes" Value="Primary" />
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_OK}" />
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
@@ -385,9 +370,7 @@
|
||||
<MenuFlyout>
|
||||
<MenuItem Command="{Binding $parent[u:DialogControlBase].Close}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource SemiIconClose}" />
|
||||
<PathIcon Data="{DynamicResource SemiIconClose}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuFlyout>
|
||||
@@ -401,9 +384,7 @@
|
||||
CommandParameter="{x:Static u:DialogLayerChangeType.BringForward}"
|
||||
Header="{DynamicResource STRING_MENU_BRING_FORWARD}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource DialogArrangeBringForwardGlyph}" />
|
||||
<PathIcon Data="{DynamicResource DialogArrangeBringForwardGlyph}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
@@ -411,9 +392,7 @@
|
||||
CommandParameter="{x:Static u:DialogLayerChangeType.BringToFront}"
|
||||
Header="{DynamicResource STRING_MENU_BRING_TO_FRONT}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource DialogArrangeBringToFrontGlyph}" />
|
||||
<PathIcon Data="{DynamicResource DialogArrangeBringToFrontGlyph}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
@@ -421,9 +400,7 @@
|
||||
CommandParameter="{x:Static u:DialogLayerChangeType.SendBackward}"
|
||||
Header="{DynamicResource STRING_MENU_SEND_BACKWARD}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource DialogArrangeSendBackwardGlyph}" />
|
||||
<PathIcon Data="{DynamicResource DialogArrangeSendBackwardGlyph}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
@@ -431,9 +408,7 @@
|
||||
CommandParameter="{x:Static u:DialogLayerChangeType.SendToBack}"
|
||||
Header="{DynamicResource STRING_MENU_SEND_TO_BACK}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource DialogArrangeSendToBackGlyph}" />
|
||||
<PathIcon Data="{DynamicResource DialogArrangeSendToBackGlyph}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
@@ -441,9 +416,7 @@
|
||||
CommandParameter="{x:Static u:DialogLayerChangeType.BringForward}"
|
||||
Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Data="{DynamicResource SemiIconClose}" />
|
||||
<PathIcon Data="{DynamicResource SemiIconClose}" Theme="{StaticResource InnerPathIcon}" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</MenuFlyout>
|
||||
@@ -576,10 +549,10 @@
|
||||
<PathIcon
|
||||
Name="PART_Icon"
|
||||
Grid.Column="0"
|
||||
Theme="{StaticResource InnerPathIcon}"
|
||||
Classes="ExtraLarge"
|
||||
Margin="24,24,8,0"
|
||||
VerticalAlignment="Center" />
|
||||
VerticalAlignment="Center"
|
||||
Classes="ExtraLarge"
|
||||
Theme="{StaticResource InnerPathIcon}" />
|
||||
<TextBlock
|
||||
Name="PART_Title"
|
||||
Grid.Column="1"
|
||||
@@ -604,18 +577,10 @@
|
||||
Margin="24,0,24,24"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_CancelButton}"
|
||||
Margin="8,0,0,0" />
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_NoButton}"
|
||||
Margin="8,0,0,0" />
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_YesButton}"
|
||||
Margin="8,0,0,0" />
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_OKButton}"
|
||||
Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_CancelButton}" Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_NoButton}" Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_YesButton}" Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_OKButton}" Margin="8,0,0,0" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
@@ -630,19 +595,19 @@
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_CANCEL}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_NoButton">
|
||||
<Setter Property="Grid.Column" Value="1"></Setter>
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="helpers:ClassHelper.Classes" Value="Danger" />
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_NO}" />
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_YesButton">
|
||||
<Setter Property="Grid.Column" Value="2"></Setter>
|
||||
<Setter Property="Grid.Column" Value="2" />
|
||||
<Setter Property="helpers:ClassHelper.Classes" Value="Primary" />
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_YES}" />
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_OKButton">
|
||||
<Setter Property="Grid.Column" Value="3"></Setter>
|
||||
<Setter Property="Grid.Column" Value="3" />
|
||||
<Setter Property="helpers:ClassHelper.Classes" Value="Primary" />
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_OK}" />
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:c="clr-namespace:Ursa.Themes.Semi.Converters"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:helpers="clr-namespace:Irihi.Avalonia.Shared.Helpers;assembly=Irihi.Avalonia.Shared">
|
||||
xmlns:helpers="clr-namespace:Irihi.Avalonia.Shared.Helpers;assembly=Irihi.Avalonia.Shared"
|
||||
xmlns:u="https://irihi.tech/ursa">
|
||||
<ControlTheme x:Key="{x:Type u:CustomDrawerControl}" TargetType="u:CustomDrawerControl">
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
@@ -19,10 +19,10 @@
|
||||
Name="PART_Root"
|
||||
Margin="{TemplateBinding Padding,
|
||||
Converter={x:Static c:ThicknessTakeConverter.Left}}"
|
||||
Background="{DynamicResource SemiColorBackground2}"
|
||||
Padding="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{DynamicResource SemiColorBackground2}"
|
||||
BorderThickness="{TemplateBinding BorderThickness,
|
||||
Converter={x:Static c:ThicknessTakeConverter.Left}}"
|
||||
Classes="Shadow"
|
||||
@@ -34,11 +34,13 @@
|
||||
Theme="{DynamicResource CardBorder}">
|
||||
<Border ClipToBounds="True" CornerRadius="{Binding #PART_Root.CornerRadius}">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
<ScrollViewer
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Content="{TemplateBinding Content}" />
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ContentPresenter Name="PART_ContentPresenter" Content="{TemplateBinding Content}" />
|
||||
</ScrollViewer>
|
||||
<Grid Grid.Row="0" ColumnDefinitions="*, Auto">
|
||||
<Panel
|
||||
Name="{x:Static u:DialogControlBase.PART_TitleArea}"
|
||||
@@ -112,10 +114,10 @@
|
||||
Name="PART_Root"
|
||||
Margin="{TemplateBinding Padding,
|
||||
Converter={x:Static c:ThicknessTakeConverter.Left}}"
|
||||
Background="{DynamicResource SemiColorBackground2}"
|
||||
Padding="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{DynamicResource SemiColorBackground2}"
|
||||
BorderThickness="{TemplateBinding BorderThickness,
|
||||
Converter={x:Static c:ThicknessTakeConverter.Left}}"
|
||||
Classes="Shadow"
|
||||
@@ -127,7 +129,10 @@
|
||||
Theme="{DynamicResource CardBorder}">
|
||||
<Border ClipToBounds="True" CornerRadius="{Binding #PART_Root.CornerRadius}">
|
||||
<Grid RowDefinitions="Auto, *, Auto">
|
||||
<ScrollViewer Grid.Row="1">
|
||||
<ScrollViewer
|
||||
Grid.Row="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<ContentPresenter
|
||||
Name="PART_ContentPresenter"
|
||||
Margin="24,8"
|
||||
@@ -158,18 +163,10 @@
|
||||
Margin="24,0,24,24"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_CancelButton}"
|
||||
Margin="8,0,0,0" />
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_NoButton}"
|
||||
Margin="8,0,0,0" />
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_YesButton}"
|
||||
Margin="8,0,0,0" />
|
||||
<Button
|
||||
Name="{x:Static u:DefaultDialogControl.PART_OKButton}"
|
||||
Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_CancelButton}" Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_NoButton}" Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_YesButton}" Margin="8,0,0,0" />
|
||||
<Button Name="{x:Static u:DefaultDialogControl.PART_OKButton}" Margin="8,0,0,0" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
@@ -184,19 +181,19 @@
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_CANCEL}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_NoButton">
|
||||
<Setter Property="Grid.Column" Value="1"></Setter>
|
||||
<Setter Property="Grid.Column" Value="1" />
|
||||
<Setter Property="helpers:ClassHelper.Classes" Value="Danger" />
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_NO}" />
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_YesButton">
|
||||
<Setter Property="Grid.Column" Value="2"></Setter>
|
||||
<Setter Property="Grid.Column" Value="2" />
|
||||
<Setter Property="helpers:ClassHelper.Classes" Value="Primary" />
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_YES}" />
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ Button#PART_OKButton">
|
||||
<Setter Property="Grid.Column" Value="3"></Setter>
|
||||
<Setter Property="Grid.Column" Value="3" />
|
||||
<Setter Property="helpers:ClassHelper.Classes" Value="Primary" />
|
||||
<Setter Property="Content" Value="{DynamicResource STRING_MENU_DIALOG_OK}" />
|
||||
<Setter Property="Theme" Value="{DynamicResource SolidButton}" />
|
||||
|
||||
@@ -26,6 +26,8 @@ public partial class OverlayDialogHost
|
||||
|
||||
_layers.Add(new DialogPair(mask, control));
|
||||
ResetZIndices();
|
||||
control.MaxWidth = Math.Min(control.MaxWidth, this.Bounds.Width);
|
||||
control.MaxHeight = Math.Min(control.MaxHeight, this.Bounds.Height);
|
||||
if (mask is not null) this.Children.Add(mask);
|
||||
this.Children.Add(control);
|
||||
control.Measure(this.Bounds.Size);
|
||||
@@ -53,6 +55,8 @@ public partial class OverlayDialogHost
|
||||
internal async void AddModalDrawer(DrawerControlBase control)
|
||||
{
|
||||
PureRectangle mask = CreateOverlayMask(true, control.CanLightDismiss);
|
||||
control.MaxWidth = Math.Min(control.MaxWidth, this.Bounds.Width);
|
||||
control.MaxHeight = Math.Min(control.MaxHeight, this.Bounds.Height);
|
||||
_layers.Add(new DialogPair(mask, control));
|
||||
this.Children.Add(mask);
|
||||
this.Children.Add(control);
|
||||
|
||||
@@ -57,10 +57,10 @@ public class DrawerMeasureTest
|
||||
};
|
||||
window.Show();
|
||||
Dispatcher.UIThread.RunJobs();
|
||||
var d = window.GetVisualDescendants().ToList();
|
||||
Drawer.ShowCustom(textBlock, "hello world", null,
|
||||
new DrawerOptions { Position = position, TopLevelHashCode = window.GetHashCode() });
|
||||
await Task.Delay(TimeSpan.FromSeconds(0.1));
|
||||
var d = window.GetVisualDescendants().ToList();
|
||||
var dialogControl = window.GetVisualDescendants().OfType<CustomDrawerControl>().SingleOrDefault();
|
||||
Assert.NotNull(dialogControl);
|
||||
Assert.True(dialogControl.Bounds.Width <= window.Bounds.Width);
|
||||
|
||||
Reference in New Issue
Block a user