Skip to content

Commit bc5f489

Browse files
committed
Merge branch 'main' into d2/f_compress
2 parents 280c8ad + 3bcaaf3 commit bc5f489

File tree

83 files changed

+1788
-1394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1788
-1394
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@
6161
#*.PDF diff=astextplain
6262
#*.rtf diff=astextplain
6363
#*.RTF diff=astextplain
64+
65+
*.h linguist-language=C++

.github/workflows/ci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ jobs:
4949

5050
if: github.repository_owner == 'files-community'
5151

52-
runs-on: ubuntu-latest
53-
defaults:
54-
run:
55-
shell: pwsh
52+
runs-on: windows-latest
5653

5754
steps:
5855

@@ -62,10 +59,8 @@ jobs:
6259
fetch-depth: 2
6360
- name: Setup .NET 8
6461
uses: actions/setup-dotnet@v4
65-
with:
66-
global-json-file: global.json
6762

68-
- name: Install XamlStyler console
63+
- name: Install XamlStyler.Console
6964
run: 'dotnet tool install --global XamlStyler.Console'
7065

7166
- name: Check XAML formatting

.github/workflows/format-xaml.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ on:
66
jobs:
77
format-xaml:
88
if: github.event.issue.pull_request && github.event.comment.body == '/format'
9-
runs-on: ubuntu-latest
9+
runs-on: windows-latest
1010
environment: Pull Requests
11-
defaults:
12-
run:
13-
shell: pwsh
1411
permissions:
1512
contents: write
1613

@@ -48,8 +45,6 @@ jobs:
4845

4946
- name: Setup .NET 8
5047
uses: actions/setup-dotnet@v4
51-
with:
52-
global-json-file: global.json
5348

5449
- name: Set git identity
5550
if: env.CAN_RUN == 1
@@ -79,7 +74,7 @@ jobs:
7974
"CAN_RUN=0" | Out-File -FilePath $env:GITHUB_ENV -Append
8075
}
8176
82-
- name: Install Xaml Styler
77+
- name: Install XamlStyler.Console
8378
if: env.CAN_RUN == 1
8479
run: dotnet tool install --global XamlStyler.Console
8580

src/Files.App (Package)/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Identity
1717
Name="FilesDev"
1818
Publisher="CN=Files"
19-
Version="3.7.10.0" />
19+
Version="3.7.11.0" />
2020

2121
<Properties>
2222
<DisplayName>Files - Dev</DisplayName>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (c) 2024 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
namespace Files.App.Controls
5+
{
6+
/// <summary>
7+
/// Defines the IconColorTypes for <see cref="ThemedIcon"/> which sets the visual state
8+
/// to use the correct brush values which match system signal colors.
9+
/// </summary>
10+
public enum ThemedIconColorType
11+
{
12+
None,
13+
14+
/// <summary>
15+
/// Icon color type of <see cref="ThemedIcon"/> is Normal. Default Value.
16+
/// </summary>
17+
Normal,
18+
19+
/// <summary>
20+
/// Icon color type of <see cref="ThemedIcon"/> is Critical.
21+
/// </summary>
22+
Critical,
23+
24+
/// <summary>
25+
/// Icon color type of <see cref="ThemedIcon"/> is Caution.
26+
/// </summary>
27+
Caution,
28+
29+
/// <summary>
30+
/// Icon color type of <see cref="ThemedIcon"/> is Success.
31+
/// </summary>
32+
Success,
33+
34+
/// <summary>
35+
/// Icon color type of <see cref="ThemedIcon"/> is Neutral.
36+
/// </summary>
37+
Neutral,
38+
39+
/// <summary>
40+
/// Icon color type of <see cref="ThemedIcon"/> is Accent.
41+
/// </summary>
42+
Accent,
43+
44+
/// <summary>
45+
/// Icon color type of <see cref="ThemedIcon"/> is Custom. Used in combination
46+
/// with the IconColor and Foreground brushes.
47+
/// </summary>
48+
Custom
49+
}
50+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) 2024 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
namespace Files.App.Controls
5+
{
6+
/// <summary>
7+
/// Defines LayerTypes for <see cref="ThemedIcon"/>.
8+
/// </summary>
9+
public enum ThemedIconLayerType
10+
{
11+
/// <summary>
12+
/// The LayerType uses the Base color. Default state.
13+
/// </summary>
14+
Base,
15+
/// <summary>
16+
/// The LayerType uses the Alt color.
17+
/// </summary>
18+
Alt,
19+
/// <summary>
20+
/// The LayerType uses an Accented color.
21+
/// </summary>
22+
Accent,
23+
/// <summary>
24+
/// The LayerType uses a contrasting color for the Accented color.
25+
/// </summary>
26+
AccentContrast,
27+
}
28+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) 2024 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
namespace Files.App.Controls
5+
{
6+
/// <summary>
7+
/// A collection of Layers for the ThemedIcon's Layered IconType
8+
/// </summary>
9+
public sealed class ThemedIconLayers : List<ThemedIconLayer>
10+
{
11+
}
12+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) 2024 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
namespace Files.App.Controls
5+
{
6+
/// <summary>
7+
/// Defines IconTypes for <see cref="ThemedIcon"/>.
8+
/// </summary>
9+
public enum ToggleBehaviors
10+
{
11+
/// <summary>
12+
/// Auto enables the ThemedIcon to listen to owner control states.
13+
/// </summary>
14+
Auto,
15+
16+
/// <summary>
17+
/// On will always use the ThemedIcon's Toggle state
18+
/// </summary>
19+
On,
20+
21+
/// <summary>
22+
/// Off will not use the ThemedIcon's Toggle state
23+
/// </summary>
24+
Off,
25+
}
26+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) 2024 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
namespace Files.App.Controls
5+
{
6+
/// <summary>
7+
/// Defines IconTypes for <see cref="ThemedIcon"/>.
8+
/// </summary>
9+
public enum ThemedIconTypes
10+
{
11+
/// <summary>
12+
/// Icon type of <see cref="ThemedIcon"/> is Outline.
13+
/// </summary>
14+
Outline,
15+
16+
/// <summary>
17+
/// Icon type of <see cref="ThemedIcon"/> is Layered.
18+
/// </summary>
19+
Layered,
20+
}
21+
}

src/Files.App.Controls/ThemedIcon/ThemedIcon.Consts.cs

Lines changed: 57 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -6,69 +6,65 @@
66

77
namespace Files.App.Controls
88
{
9-
// Template Parts
10-
[TemplatePart(Name = FilledPathIconViewBox, Type = typeof(Viewbox))]
11-
[TemplatePart(Name = OutlinePathIconViewBox, Type = typeof(Viewbox))]
12-
[TemplatePart(Name = LayeredPathIconViewBox, Type = typeof(Viewbox))]
13-
[TemplatePart(Name = LayeredPathCanvas, Type = typeof(Canvas))]
14-
15-
// Icon Type Visual States
16-
[TemplateVisualState(Name = OutlineTypeStateName, GroupName = IconTypeStateGroupName)]
17-
[TemplateVisualState(Name = LayeredTypeStateName, GroupName = IconTypeStateGroupName)]
18-
[TemplateVisualState(Name = FilledTypeStateName, GroupName = IconTypeStateGroupName)]
9+
// Template Parts
10+
[TemplatePart(Name = FilledPathIconViewBox, Type = typeof(Viewbox))]
11+
[TemplatePart(Name = OutlinePathIconViewBox, Type = typeof(Viewbox))]
12+
[TemplatePart(Name = LayeredPathIconViewBox, Type = typeof(Viewbox))]
13+
[TemplatePart(Name = LayeredPathCanvas, Type = typeof(Canvas))]
14+
// Icon Type Visual States
15+
[TemplateVisualState(Name = OutlineTypeStateName, GroupName = IconTypeStateGroupName)]
16+
[TemplateVisualState(Name = LayeredTypeStateName, GroupName = IconTypeStateGroupName)]
17+
[TemplateVisualState(Name = FilledTypeStateName, GroupName = IconTypeStateGroupName)]
18+
// Icon Color Visual States
19+
[TemplateVisualState(Name = NormalStateName, GroupName = IconColorStateGroupName)]
20+
[TemplateVisualState(Name = CriticalStateName, GroupName = IconColorStateGroupName)]
21+
[TemplateVisualState(Name = CautionStateName, GroupName = IconColorStateGroupName)]
22+
[TemplateVisualState(Name = SuccessStateName, GroupName = IconColorStateGroupName)]
23+
[TemplateVisualState(Name = NeutralStateName, GroupName = IconColorStateGroupName)]
24+
[TemplateVisualState(Name = AccentStateName, GroupName = IconColorStateGroupName)]
25+
[TemplateVisualState(Name = CustomColorStateName, GroupName = IconColorStateGroupName)]
26+
[TemplateVisualState(Name = ToggleStateName, GroupName = IconColorStateGroupName)]
27+
[TemplateVisualState(Name = DisabledColorStateName, GroupName = IconColorStateGroupName)]
28+
[TemplateVisualState(Name = DisabledToggleColorStateName, GroupName = IconColorStateGroupName)]
29+
// Icon IsEnabled Visual States
30+
[TemplateVisualState(Name = EnabledStateName, GroupName = EnabledStateGroupName)]
31+
[TemplateVisualState(Name = DisabledStateName, GroupName = EnabledStateGroupName)]
32+
public partial class ThemedIcon
33+
{
34+
// Visual State Group Names
35+
internal const string IconTypeStateGroupName = "IconTypeStates";
36+
internal const string IconColorStateGroupName = "IconColorStates";
37+
internal const string EnabledStateGroupName = "EnabledStates";
1938

20-
// Icon Color Visual States
21-
[TemplateVisualState(Name = NormalStateName, GroupName = IconColorStateGroupName)]
22-
[TemplateVisualState(Name = CriticalStateName, GroupName = IconColorStateGroupName)]
23-
[TemplateVisualState(Name = CautionStateName, GroupName = IconColorStateGroupName)]
24-
[TemplateVisualState(Name = SuccessStateName, GroupName = IconColorStateGroupName)]
25-
[TemplateVisualState(Name = NeutralStateName, GroupName = IconColorStateGroupName)]
26-
[TemplateVisualState(Name = AccentStateName, GroupName = IconColorStateGroupName)]
27-
[TemplateVisualState(Name = CustomColorStateName, GroupName = IconColorStateGroupName)]
28-
[TemplateVisualState(Name = ToggleStateName, GroupName = IconColorStateGroupName)]
29-
[TemplateVisualState(Name = DisabledColorStateName, GroupName = IconColorStateGroupName)]
30-
[TemplateVisualState(Name = DisabledToggleColorStateName, GroupName = IconColorStateGroupName)]
39+
// "Icon Type" Visual State Names
40+
internal const string OutlineTypeStateName = "Outline";
41+
internal const string FilledTypeStateName = "Filled";
42+
internal const string LayeredTypeStateName = "Layered";
3143

32-
// Icon IsEnabled Visual States
33-
[TemplateVisualState(Name = EnabledStateName, GroupName = EnabledStateGroupName)]
34-
[TemplateVisualState(Name = DisabledStateName, GroupName = EnabledStateGroupName)]
44+
// "Icon State" Visual State Names
45+
internal const string NormalStateName = "Normal";
46+
internal const string CriticalStateName = "Critical";
47+
internal const string CautionStateName = "Caution";
48+
internal const string SuccessStateName = "Success";
49+
internal const string NeutralStateName = "Neutral";
50+
internal const string AccentStateName = "Accent";
51+
internal const string CustomColorStateName = "Custom";
52+
internal const string ToggleStateName = "Toggle";
53+
internal const string DisabledColorStateName = "DisabledColor";
54+
internal const string DisabledToggleColorStateName = "DisabledToggleColor";
3555

36-
public partial class ThemedIcon
37-
{
38-
// Visual State Group Names
39-
internal const string IconTypeStateGroupName = "IconTypeStates";
40-
internal const string IconColorStateGroupName = "IconColorStates";
41-
internal const string EnabledStateGroupName = "EnabledStates";
56+
// "Enabled" Visual State Names
57+
internal const string EnabledStateName = "Enabled";
58+
internal const string DisabledStateName = "Disabled";
4259

43-
// "Icon Type" Visual State Names
44-
internal const string OutlineTypeStateName = "Outline";
45-
internal const string FilledTypeStateName = "Filled";
46-
internal const string LayeredTypeStateName = "Layered";
60+
// ViewBox Controls
61+
internal const string FilledPathIconViewBox = "PART_FilledIconViewBox";
62+
internal const string OutlinePathIconViewBox = "PART_OutlineIconViewBox";
63+
internal const string LayeredPathIconViewBox = "PART_LayeredIconViewBox";
64+
internal const string LayeredPathCanvas = "PART_LayerCanvas";
4765

48-
// "Icon State" Visual State Names
49-
internal const string NormalStateName = "Normal";
50-
internal const string CriticalStateName = "Critical";
51-
internal const string CautionStateName = "Caution";
52-
internal const string SuccessStateName = "Success";
53-
internal const string NeutralStateName = "Neutral";
54-
internal const string AccentStateName = "Accent";
55-
internal const string CustomColorStateName = "Custom";
56-
internal const string ToggleStateName = "Toggle";
57-
internal const string DisabledColorStateName = "DisabledColor";
58-
internal const string DisabledToggleColorStateName = "DisabledToggleColor";
59-
60-
// "Enabled" Visual State Names
61-
internal const string EnabledStateName = "Enabled";
62-
internal const string DisabledStateName = "Disabled";
63-
64-
// ViewBox Controls
65-
internal const string FilledPathIconViewBox = "PART_FilledIconViewBox";
66-
internal const string OutlinePathIconViewBox = "PART_OutlineIconViewBox";
67-
internal const string LayeredPathIconViewBox = "PART_LayeredIconViewBox";
68-
internal const string LayeredPathCanvas = "PART_LayerCanvas";
69-
70-
// Path Controls
71-
internal const string FilledIconPath = "PART_FilledPath";
72-
internal const string OutlineIconPath = "PART_OutlinePath";
73-
}
74-
}
66+
// Path Controls
67+
internal const string FilledIconPath = "PART_FilledPath";
68+
internal const string OutlineIconPath = "PART_OutlinePath";
69+
}
70+
}

0 commit comments

Comments
 (0)