Skip to content

Commit

Permalink
Merge branch 'master' into devsecops
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-ivanov committed Nov 19, 2023
2 parents 2b90405 + 5f3de40 commit 587d284
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ModernWpf.Controls/AutoSuggestBox/AutoSuggestBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives">

<Style TargetType="local:AutoSuggestBox">
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="IsTabStop" Value="False" />
Expand Down
2 changes: 1 addition & 1 deletion ModernWpf.Controls/CommandBar/CommandBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
<Style TargetType="local:CommandBar">
<Setter Property="Background" Value="{DynamicResource CommandBarBackground}" />
<Setter Property="Foreground" Value="{DynamicResource CommandBarForeground}" />
<Setter Property="Padding" Value="9,0,0,0" />
<Setter Property="Padding" Value="4,0,0,0" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
Expand Down
3 changes: 2 additions & 1 deletion ModernWpf.Controls/NumberBox/NumberBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}"/>
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
Expand Down
8 changes: 4 additions & 4 deletions ModernWpf/Styles/CommandBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
<sys:Double x:Key="AppBarButtonContentHeight">16</sys:Double>
<sys:Double x:Key="AppBarThemeMinHeight">64</sys:Double>
<sys:Double x:Key="AppBarThemeCompactHeight">48</sys:Double>
<Thickness x:Key="AppBarEllipsisButtonInnerBorderMargin">0,9,9,9</Thickness>
<Thickness x:Key="AppBarEllipsisButtonInnerBorderMargin">2,6,6,6</Thickness>

<Thickness x:Key="AppBarButtonContentViewboxMargin">12,16,0,10</Thickness>
<Thickness x:Key="AppBarButtonContentViewboxCompactMargin">0,12,0,12</Thickness>
<Thickness x:Key="AppBarButtonContentViewboxCollapsedMargin">0,16,0,4</Thickness>
<Thickness x:Key="AppBarButtonContentViewboxCollapsedMargin">0,16,0,2</Thickness>
<Thickness x:Key="AppBarButtonOverflowTextTouchMargin">0,9,0,12</Thickness>
<Thickness x:Key="AppBarButtonOverflowTextLabelPadding">0,5,0,8</Thickness>
<Thickness x:Key="AppBarButtonTextLabelMargin">2,0,2,8</Thickness>
<Thickness x:Key="AppBarButtonTextLabelOnRightMargin">8,16,12,10</Thickness>
<Thickness x:Key="AppBarButtonInnerBorderMargin">0,9,0,9</Thickness>
<Thickness x:Key="AppBarButtonInnerBorderCompactMargin">0,9,0,25</Thickness>
<Thickness x:Key="AppBarButtonInnerBorderMargin">2,6,2,6</Thickness>
<Thickness x:Key="AppBarButtonInnerBorderCompactMargin">2,6,2,22</Thickness>
<Thickness x:Key="AppBarButtonInnerBorderOverflowMargin">4,0,4,0</Thickness>

<Thickness x:Key="AppBarToggleButtonOverflowTextTouchMargin">0,9,0,12</Thickness>
Expand Down
3 changes: 2 additions & 1 deletion ModernWpf/Styles/RichTextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" />
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" />
<Setter Property="primitives:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
Expand Down Expand Up @@ -60,7 +61,7 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding primitives:ControlHelper.CornerRadius}"
MinWidth="{DynamicResource TextControlThemeMinWidth}"
MinWidth="{TemplateBinding MinWidth}"
MinHeight="{DynamicResource TextControlThemeMinHeight}"
primitives:ValidationHelper.IsTemplateValidationAdornerSite="True" />
<ScrollViewer
Expand Down
3 changes: 1 addition & 2 deletions ModernWpf/ThemeResources/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@
<Color x:Key="SolidBackgroundFillColorTertiary">#282828</Color>
<Color x:Key="SolidBackgroundFillColorQuarternary">#2C2C2C</Color>

<Color x:Key="SystemFillColorAttention">#50C0FF</Color>
<Color x:Key="SystemFillColorSuccess">#6CCB5F</Color>
<Color x:Key="SystemFillColorCaution">#FCE100</Color>
<Color x:Key="SystemFillColorCritical">#FF99A4</Color>
Expand Down Expand Up @@ -386,7 +385,7 @@
<SolidColorBrush x:Key="SolidBackgroundFillColorTertiaryBrush" Color="{StaticResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="SolidBackgroundFillColorQuarternaryBrush" Color="{StaticResource SolidBackgroundFillColorQuarternary}" />

<SolidColorBrush x:Key="SystemFillColorAttentionBrush" Color="{StaticResource SystemFillColorAttention}" />
<SolidColorBrush x:Key="SystemFillColorAttentionBrush" Color="{m:DynamicColor SystemAccentColorLight2}" />
<SolidColorBrush x:Key="SystemFillColorSuccessBrush" Color="{StaticResource SystemFillColorSuccess}" />
<SolidColorBrush x:Key="SystemFillColorCautionBrush" Color="{StaticResource SystemFillColorCaution}" />
<SolidColorBrush x:Key="SystemFillColorCriticalBrush" Color="{StaticResource SystemFillColorCritical}" />
Expand Down
3 changes: 1 addition & 2 deletions ModernWpf/ThemeResources/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@
<Color x:Key="SolidBackgroundFillColorTertiary">#F9F9F9</Color>
<Color x:Key="SolidBackgroundFillColorQuarternary">#FFFFFF</Color>

<Color x:Key="SystemFillColorAttention">#0070CB</Color>
<Color x:Key="SystemFillColorSuccess">#0F7B0F</Color>
<Color x:Key="SystemFillColorCaution">#9D5D00</Color>
<Color x:Key="SystemFillColorCritical">#C42B1C</Color>
Expand Down Expand Up @@ -386,7 +385,7 @@
<SolidColorBrush x:Key="SolidBackgroundFillColorTertiaryBrush" Color="{StaticResource SolidBackgroundFillColorTertiary}" />
<SolidColorBrush x:Key="SolidBackgroundFillColorQuarternaryBrush" Color="{StaticResource SolidBackgroundFillColorQuarternary}" />

<SolidColorBrush x:Key="SystemFillColorAttentionBrush" Color="{StaticResource SystemFillColorAttention}" />
<SolidColorBrush x:Key="SystemFillColorAttentionBrush" Color="{m:DynamicColor SystemAccentColor}" />
<SolidColorBrush x:Key="SystemFillColorSuccessBrush" Color="{StaticResource SystemFillColorSuccess}" />
<SolidColorBrush x:Key="SystemFillColorCautionBrush" Color="{StaticResource SystemFillColorCaution}" />
<SolidColorBrush x:Key="SystemFillColorCriticalBrush" Color="{StaticResource SystemFillColorCritical}" />
Expand Down
9 changes: 7 additions & 2 deletions test/ModernWpfTestApp/ApiTests/AutoSuggestBoxTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ public void VerifyAutoSuggestBoxCornerRadius()
autoSuggestBox.CornerRadius = new CornerRadius(2);
autoSuggestBox.Focus(/*FocusState.Keyboard*/);
autoSuggestBox.Text = "123";
autoSuggestBox.MaxHeight = 32;
});
IdleSynchronizer.Wait();

RunOnUIThread.Execute(() =>
{
var textBox = TestUtilities.FindDescendents<TextBox>(autoSuggestBox).Where(e => e.Name == "TextBox").Single();
Verify.AreEqual(new CornerRadius(2, 2, 0, 0), textBox.GetCornerRadius());

// Flyout might open differently and as such flip corner radii values
Verify.IsTrue(new CornerRadius(2, 2, 0, 0) == textBox.GetCornerRadius() || new CornerRadius(0, 0, 2, 2) == textBox.GetCornerRadius());

var overlayCornerRadius = new CornerRadius(0, 0, 0, 0);
var radius = App.Current.Resources["OverlayCornerRadius"];
Expand All @@ -60,7 +63,9 @@ public void VerifyAutoSuggestBoxCornerRadius()
var popup = VisualTreeHelperEx.GetOpenPopups(WindowEx.Current).Last();
var popupBorder = TestUtilities.FindDescendents<Border>(popup).First();

Verify.AreEqual(new CornerRadius(0, 0, overlayCornerRadius.BottomRight, overlayCornerRadius.BottomLeft), popupBorder.CornerRadius);
// Flyout might open differently and as such flip corner radii values
Verify.IsTrue(new CornerRadius(0, 0, overlayCornerRadius.BottomRight, overlayCornerRadius.BottomLeft) == popupBorder.CornerRadius
|| new CornerRadius(overlayCornerRadius.TopRight, overlayCornerRadius.TopLeft, 0, 0) == popupBorder.CornerRadius);
});
}

Expand Down
2 changes: 1 addition & 1 deletion test/ModernWpfTestApp/CommandBarPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<AppBarButton Icon="Add" Label="Add"/>
<AppBarButton Icon="Remove" Label="Remove" LabelPosition="Collapsed"/>
<AppBarSeparator/>
<AppBarButton Icon="Save" Label="Save"/>
<AppBarButton Icon="Save" Label="Save And Quit"/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
<CommandBar.SecondaryCommands>
<AppBarButton Icon="Add" Label="Add"/>
Expand Down
10 changes: 10 additions & 0 deletions test/ModernWpfTestApp/NumberBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@
<controls:NumberBox x:Name="HeaderTemplateTestingNumberBox"/>
</StackPanel>

<!-- FontSize propagation -->
<controls:NumberBox Header="Header text" FontSize="50"/>

<StackPanel Orientation="Horizontal" Height="50">
<controls:NumberBox PlaceholderText="Number"/>
<TextBoxEx PlaceholderText="Text"/>
<controls:AutoSuggestBox PlaceholderText="Auto"/>
<RichEditBox PlaceholderText="Rich" Style="{StaticResource DefaultRichTextBoxStyle}"/>
</StackPanel>

<!-- Property propagation -->
<StackPanel Orientation="Horizontal">
<TextBoxEx Header="Header text" FontSize="14" Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
Expand Down

0 comments on commit 587d284

Please sign in to comment.