Skip to content

Commit

Permalink
Merge pull request #996 from lepoco/development
Browse files Browse the repository at this point in the history
Merge development and bump version to 3.0.1
  • Loading branch information
pomianowski committed Mar 13, 2024
2 parents baaf749 + 699edcb commit 65e7bc6
Show file tree
Hide file tree
Showing 20 changed files with 296 additions and 50 deletions.
41 changes: 26 additions & 15 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
---
PR:
- "*"

dotnet:
- '**/*.cs'

github_actions:
- .github/workflows/*
- ".github/workflows/*"

documentation:
- docs/*
- "docs/*"

update:
- src/Directory.Build.props
- "src/Directory.Build.props"

controls:
- src/Wpf.Ui/Controls/*
dependencies:
- "src/Packages.props"
- "branding/package.json"
- "src/Packages.props"

NuGet:
- "src/Packages.props"

styles:
- src/Wpf.Ui/Styles/*
- "src/Wpf.Ui/**/*.xaml"

icons:
- src/Wpf.Ui/Fonts/FluentSystemIcons-Filled.ttf
- src/Wpf.Ui/Fonts/FluentSystemIcons-Regular.ttf
themes:
- "src/Wpf.Ui/Appearance/*"

dependencies:
- src/Packages.props
- branding/package.json
tray:
- "src/Wpf.Ui.Tray/*"

NuGet:
- src/Packages.props
controls:
- "src/Wpf.Ui/Controls/*"

icons:
- "src/Wpf.Ui/Resources/Fonts/*"

navigation:
- "src/Wpf.Ui/Controls/NavigationView/*"
5 changes: 4 additions & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
- name: "icons"
color: "86CBEC"
description: "Fonts and icons updates"
Expand Down Expand Up @@ -47,6 +46,9 @@
- name: ".NET"
color: "7121c6"
description: "Pull requests that update .NET code."
- name: "dotnet"
color: "7121c6"
description: "Pull requests that update .NET code."
- name: "NuGet"
color: "004880"
description: "Update of the NuGet package."
Expand All @@ -71,3 +73,4 @@
- name: "wontfix"
color: "ffffff"
description: "This will not be worked on."

39 changes: 39 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
branches: [ development ]

jobs:
analyze:
name: Analyze
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: microsoft/setup-msbuild@v1.3
with:
msbuild-architecture: x64

- name: Setup .NET Core SDK 8.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build src\Wpf.Ui.Gallery\Wpf.Ui.Gallery.csproj --configuration Release --no-restore

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: "csharp"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>3.0.0</Version>
<Version>3.0.1</Version>
<LangVersion>12.0</LangVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,16 @@ public partial class MainWindow
Now you can create fantastic apps, e.g. with one button:

```xml
<ui:UiWindow
<ui:FluentWindow
...
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
<Grid>
<ui:Button
Content="Hello World"
Icon="Fluent24"/>
</Grid>
</ui:UiWindow>
<StackPanel>
<ui:TitleBar Title="WPF UI"/>
<ui:Card Margin="8">
<ui:Button Content="Hello World" Icon="{ui:SymbolIcon Fluent24}" />
</ui:Card>
</StackPanel>
</ui:FluentWindow>
```

## Special thanks
Expand Down
2 changes: 1 addition & 1 deletion src/Wpf.Ui/Appearance/ApplicationThemeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public static void ApplySystemTheme(bool updateAccent)
themeToSet = ApplicationTheme.HighContrast;
}

Apply(themeToSet);
Apply(themeToSet, updateAccent: updateAccent);
}

/// <summary>
Expand Down
7 changes: 3 additions & 4 deletions src/Wpf.Ui/Controls/ComboBox/ComboBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Thickness x:Key="ComboBoxBorderThemeThickness">1,1,1,1</Thickness>
<Thickness x:Key="ComboBoxAccentBorderThemeThickness">0,0,0,2</Thickness>
<Thickness x:Key="ComboBoxChevronMargin">8,0,10,0</Thickness>
<Thickness x:Key="ComboBoxItemMargin">3,2,3,0</Thickness>
<Thickness x:Key="ComboBoxItemMargin">6,4,6,0</Thickness>
<Thickness x:Key="ComboBoxItemContentMargin">10,8,8,8</Thickness>
<system:Double x:Key="ComboBoxChevronSize">11.0</system:Double>
<system:Double x:Key="ComboBoxPopupMinHeight">32.0</system:Double>
Expand Down Expand Up @@ -92,7 +92,6 @@
<!-- Universal WPF UI focus -->
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForeground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Margin" Value="{StaticResource ComboBoxItemMargin}" />
<Setter Property="Padding" Value="{StaticResource ComboBoxItemContentMargin}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
Expand All @@ -101,10 +100,10 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ComboBoxItem}">
<Grid>
<Grid Background="Transparent">
<Border
Name="ContentBorder"
Margin="{TemplateBinding Margin}"
Margin="{DynamicResource ComboBoxItemMargin}"
Padding="0"
VerticalAlignment="Stretch"
CornerRadius="{TemplateBinding Border.CornerRadius}"
Expand Down
4 changes: 3 additions & 1 deletion src/Wpf.Ui/Controls/ContentDialog/ContentDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
<Setter Property="DialogMaxWidth" Value="1000" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Focusable" Value="False" />
<Setter Property="Focusable" Value="True" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />
<Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle" />
<Setter Property="DialogMargin" Value="35" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="{DynamicResource ContentDialogForeground}" />
Expand Down
57 changes: 56 additions & 1 deletion src/Wpf.Ui/Controls/NavigationView/NavigationView.Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Copyright(c) Microsoft Corporation.All rights reserved.

using System.Collections;
using System.Collections.Specialized;
using System.Windows.Controls;
using Wpf.Ui.Animations;

Expand Down Expand Up @@ -82,7 +83,7 @@ public partial class NavigationView
nameof(FooterMenuItemsProperty),
typeof(IList),
typeof(NavigationView),
new FrameworkPropertyMetadata(null)
new FrameworkPropertyMetadata(null, OnFooterMenuItemsPropertyChanged)
);

/// <summary>
Expand Down Expand Up @@ -513,16 +514,45 @@ private static void OnMenuItemsPropertyChanged(DependencyObject? d, DependencyPr

if (navigationView.MenuItemsItemsControl is null)
{
navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList);
return;
}

if (navigationView.MenuItemsItemsControl.ItemsSource.Equals(enumerableNewValue))
{
navigationView.UpdateMenuItemsTemplate(enumerableNewValue);
return;
}

navigationView.MenuItemsItemsControl.ItemsSource = null;
navigationView.MenuItemsItemsControl.ItemsSource = enumerableNewValue;
navigationView.UpdateMenuItemsTemplate(enumerableNewValue);
navigationView.AddItemsToDictionaries(enumerableNewValue);

navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList);
}

private void UpdateCollectionChangedEvent(IList? oldMenuItems, IList? newMenuItems)
{
if(oldMenuItems is INotifyCollectionChanged notifyCollection)
{
notifyCollection.CollectionChanged -= OnMenuItems_CollectionChanged;
}
if(newMenuItems is INotifyCollectionChanged newNotifyCollection)
{
newNotifyCollection.CollectionChanged += OnMenuItems_CollectionChanged;
}
}

private void OnMenuItems_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
if (e.NewItems is null)
{
return;
}

UpdateMenuItemsTemplate(e.NewItems);
AddItemsToDictionaries(e.NewItems);
}

private static void OnMenuItemsSourcePropertyChanged(
Expand Down Expand Up @@ -551,6 +581,31 @@ DependencyPropertyChangedEventArgs e
navigationView.FooterMenuItems = enumerableNewValue;
}

private static void OnFooterMenuItemsPropertyChanged(DependencyObject? d, DependencyPropertyChangedEventArgs e)
{
if (d is not NavigationView navigationView || e.NewValue is not IList enumerableNewValue)
{
return;
}

if (navigationView.FooterMenuItemsItemsControl is null)
{
navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList);
return;
}

if (navigationView.FooterMenuItemsItemsControl.ItemsSource.Equals(enumerableNewValue))
{
return;
}

navigationView.FooterMenuItemsItemsControl.ItemsSource = null;
navigationView.FooterMenuItemsItemsControl.ItemsSource = enumerableNewValue;
navigationView.UpdateMenuItemsTemplate(enumerableNewValue);
navigationView.AddItemsToDictionaries(enumerableNewValue);
navigationView.UpdateCollectionChangedEvent(e.OldValue as IList, e.NewValue as IList);
}

private static void OnPaneDisplayModePropertyChanged(
DependencyObject? d,
DependencyPropertyChangedEventArgs e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Border
x:Name="MainBorder"
Grid.Row="0"
MinWidth="310"
MinWidth="40"
MinHeight="40"
Margin="0"
Padding="0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Border
x:Name="MainBorder"
Grid.Row="0"
MinWidth="310"
MinWidth="40"
MinHeight="40"
Margin="0"
Padding="0"
Expand Down
5 changes: 5 additions & 0 deletions src/Wpf.Ui/Controls/NumberBox/NumberBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
VerticalAlignment="Top"
Content="{TemplateBinding Icon}"
FontSize="16"
IsTabStop="False"
Foreground="{TemplateBinding Foreground}" />
<Grid Grid.Column="1" Margin="{TemplateBinding Padding}">
<Decorator
Expand Down Expand Up @@ -115,6 +116,7 @@
Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}"
CommandParameter="clear"
Cursor="Arrow"
IsTabStop="False"
Foreground="{DynamicResource TextControlButtonForeground}">
<controls:Button.Icon>
<controls:SymbolIcon FontSize="{StaticResource NumberBoxButtonIconSize}" Symbol="Dismiss24" />
Expand All @@ -138,6 +140,7 @@
CommandParameter="increment"
Cursor="Arrow"
Foreground="{DynamicResource TextControlButtonForeground}"
IsTabStop="False"
Visibility="Collapsed">
<controls:Button.Icon>
<controls:SymbolIcon FontSize="{StaticResource NumberBoxButtonIconSize}" Symbol="ChevronUp24" />
Expand All @@ -162,6 +165,7 @@
Cursor="Arrow"
FontSize="{StaticResource NumberBoxButtonIconSize}"
Foreground="{DynamicResource TextControlButtonForeground}"
IsTabStop="False"
Visibility="Collapsed">
<controls:Button.Icon>
<controls:SymbolIcon FontSize="{StaticResource NumberBoxButtonIconSize}" Symbol="ChevronDown24" />
Expand All @@ -175,6 +179,7 @@
VerticalAlignment="Top"
Content="{TemplateBinding Icon}"
FontSize="16"
IsTabStop="False"
Foreground="{TemplateBinding Foreground}" />
</Grid>
</Border>
Expand Down
2 changes: 2 additions & 0 deletions src/Wpf.Ui/Controls/PasswordBox/PasswordBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}"
CommandParameter="clear"
Cursor="Arrow"
IsTabStop="False"
Foreground="{DynamicResource TextControlButtonForeground}">
<controls:Button.Icon>
<controls:SymbolIcon FontSize="{StaticResource PasswordBoxButtonIconSize}" Symbol="Dismiss24" />
Expand All @@ -229,6 +230,7 @@
Command="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource TemplatedParent}}"
CommandParameter="reveal"
Cursor="Arrow"
IsTabStop="False"
Foreground="{DynamicResource TextControlButtonForeground}">
<controls:Button.Icon>
<controls:SymbolIcon FontSize="{StaticResource PasswordBoxButtonIconSize}" Symbol="Eye24" />
Expand Down
Loading

0 comments on commit 65e7bc6

Please sign in to comment.