Skip to content

Commit 3554cfb

Browse files
committed
Merge
2 parents 9bf1499 + 50a0108 commit 3554cfb

File tree

78 files changed

+118178
-117727
lines changed

Some content is hidden

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

78 files changed

+118178
-117727
lines changed

builds/azure-pipelines-release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ jobs:
156156
ContainerName: 'files'
157157
BlobPrefix: '${{parameters.releaseBranch}}'
158158

159+
- task: tfx-cloudflare-purge@1
160+
inputs:
161+
username: '$(cloudflare.username)'
162+
apikey: '$(cloudflare.apikey)'
163+
zonename: '$(cloudflare.zoneid)'
164+
159165
### Store release ###
160166
- job: StoreRelease
161167
timeoutInMinutes: 120

builds/azure-pipelines.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ steps:
4646
TargetFolder: '$(Build.SourcesDirectory)\src\Files.App\Resources'
4747
overWrite: true
4848

49-
- task: DownloadSecureFile@1
50-
name: appCenterDevKey
51-
displayName: 'Download AppCenter Dev Key'
52-
inputs:
53-
secureFile: 'AppCenterKey.txt'
54-
55-
- task: CopyFiles@2
56-
inputs:
57-
SourceFolder: '$(Agent.TempDirectory)'
58-
Contents: '$(appCenterDevKey.secureFilePath)'
59-
TargetFolder: '$(Build.SourcesDirectory)\src\Files.App\Resources'
60-
overWrite: true
61-
6249
- task: UseDotNet@2
6350
inputs:
6451
packageType: sdk

src/Files.App/BaseLayout.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ private void AddNewFileTagsToMenu(CommandBarFlyout contextMenu)
694694
index = index >= 0 ? index : contextMenu.SecondaryCommands.Count;
695695

696696
// Only show the edit tags flyout if settings is enabled
697-
if (!UserSettingsService.AppearanceSettingsService.DisplayEditTagsMenu)
697+
if (!UserSettingsService.PreferencesSettingsService.ShowEditTagsMenu)
698698
return;
699699

700700
contextMenu.SecondaryCommands.Insert(index, new AppBarSeparator());
@@ -709,7 +709,7 @@ private void AddNewFileTagsToMenu(CommandBarFlyout contextMenu)
709709
private void AddShellItemsToMenu(List<ContextMenuFlyoutItemViewModel> shellMenuItems, CommandBarFlyout contextMenuFlyout, bool shiftPressed)
710710
{
711711
var openWithSubItems = ItemModelListToContextFlyoutHelper.GetMenuFlyoutItemsFromModel(ShellContextmenuHelper.GetOpenWithItems(shellMenuItems));
712-
var mainShellMenuItems = shellMenuItems.RemoveFrom(!UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu ? int.MaxValue : shiftPressed ? 6 : 0);
712+
var mainShellMenuItems = shellMenuItems.RemoveFrom(!UserSettingsService.PreferencesSettingsService.MoveShellExtensionsToSubMenu ? int.MaxValue : shiftPressed ? 6 : 0);
713713
var overflowShellMenuItemsUnfiltered = shellMenuItems.Except(mainShellMenuItems).ToList();
714714
var overflowShellMenuItems = overflowShellMenuItemsUnfiltered.Where(
715715
(x, i) => (x.ItemType == ItemType.Separator &&
@@ -764,12 +764,12 @@ private void AddShellItemsToMenu(List<ContextMenuFlyoutItemViewModel> shellMenuI
764764
index++;
765765
}
766766

767-
if (overflowItemFlyout.Items.Count > 0 && UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu)
767+
if (overflowItemFlyout.Items.Count > 0 && UserSettingsService.PreferencesSettingsService.MoveShellExtensionsToSubMenu)
768768
{
769769
overflowItem.Label = "ShowMoreOptions".GetLocalizedResource();
770770
overflowItem.IsEnabled = true;
771771
}
772-
else if (!UserSettingsService.AppearanceSettingsService.MoveShellExtensionsToSubMenu)
772+
else if (!UserSettingsService.PreferencesSettingsService.MoveShellExtensionsToSubMenu)
773773
overflowItem.Visibility = Visibility.Collapsed;
774774
}
775775
}

src/Files.App/Dialogs/SettingsDialog.xaml

Lines changed: 105 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -16,112 +16,114 @@
1616
</ResourceDictionary>
1717
</ContentDialog.Resources>
1818

19-
<Grid
20-
x:Name="ContainerGrid"
21-
MaxHeight="790"
22-
HorizontalAlignment="Stretch"
23-
VerticalAlignment="Stretch"
24-
Background="{ThemeResource SolidBackgroundFillColorBase}">
25-
<Grid.RowDefinitions>
26-
<RowDefinition Height="44" />
27-
<RowDefinition Height="*" />
28-
</Grid.RowDefinitions>
29-
19+
<Border Background="{ThemeResource App.Theme.BackgroundBrush}">
3020
<Grid
31-
Grid.Row="0"
32-
Padding="8,0"
33-
HorizontalAlignment="Stretch">
34-
<TextBlock
35-
Padding="8,0,0,0"
36-
HorizontalAlignment="Left"
37-
VerticalAlignment="Center"
38-
FontWeight="SemiBold"
39-
Text="{helpers:ResourceString Name=Settings}" />
21+
x:Name="ContainerGrid"
22+
MaxHeight="790"
23+
HorizontalAlignment="Stretch"
24+
VerticalAlignment="Stretch"
25+
Background="{ThemeResource CardBackgroundFillColorSecondary}">
26+
<Grid.RowDefinitions>
27+
<RowDefinition Height="44" />
28+
<RowDefinition Height="*" />
29+
</Grid.RowDefinitions>
4030

41-
<Button
42-
x:Name="ButtonClose"
43-
Width="36"
44-
Height="36"
45-
HorizontalAlignment="Right"
46-
VerticalAlignment="Center"
47-
AutomationProperties.Name="{helpers:ResourceString Name=Close}"
48-
Background="Transparent"
49-
BorderBrush="Transparent"
50-
Click="ButtonClose_Click"
51-
ToolTipService.ToolTip="{helpers:ResourceString Name=Close}">
52-
<FontIcon FontSize="12" Glyph="&#xE8BB;" />
53-
</Button>
54-
</Grid>
31+
<Grid
32+
Grid.Row="0"
33+
Padding="8,0"
34+
HorizontalAlignment="Stretch">
35+
<TextBlock
36+
Padding="8,0,0,0"
37+
HorizontalAlignment="Left"
38+
VerticalAlignment="Center"
39+
FontWeight="SemiBold"
40+
Text="{helpers:ResourceString Name=Settings}" />
5541

56-
<NavigationView
57-
x:Name="SettingsPane"
58-
Grid.Row="1"
59-
IsBackButtonVisible="Collapsed"
60-
IsBackEnabled="False"
61-
IsPaneToggleButtonVisible="False"
62-
IsSettingsVisible="False"
63-
IsTitleBarAutoPaddingEnabled="False"
64-
OpenPaneLength="260"
65-
PaneDisplayMode="Left"
66-
SelectionChanged="SettingsPane_SelectionChanged">
42+
<Button
43+
x:Name="ButtonClose"
44+
Width="36"
45+
Height="36"
46+
HorizontalAlignment="Right"
47+
VerticalAlignment="Center"
48+
AutomationProperties.Name="{helpers:ResourceString Name=Close}"
49+
Background="Transparent"
50+
BorderBrush="Transparent"
51+
Click="ButtonClose_Click"
52+
ToolTipService.ToolTip="{helpers:ResourceString Name=Close}">
53+
<FontIcon FontSize="12" Glyph="&#xE8BB;" />
54+
</Button>
55+
</Grid>
6756

68-
<NavigationView.MenuItems>
69-
<NavigationViewItem
70-
AccessKey="A"
71-
AutomationProperties.AutomationId="SettingsItemAppearance"
72-
Content="{helpers:ResourceString Name=Appearance}"
73-
IsSelected="True"
74-
Tag="0">
75-
<NavigationViewItem.Icon>
76-
<FontIcon HorizontalAlignment="Left" Glyph="&#xE790;" />
77-
</NavigationViewItem.Icon>
78-
</NavigationViewItem>
79-
<NavigationViewItem
80-
AccessKey="P"
81-
AutomationProperties.AutomationId="SettingsItemPreferences"
82-
Content="{helpers:ResourceString Name=SettingsNavPreferences/Content}"
83-
Tag="1">
84-
<NavigationViewItem.Icon>
85-
<FontIcon FontFamily="{StaticResource CustomGlyph}" Glyph="&#xF116;" />
86-
</NavigationViewItem.Icon>
87-
</NavigationViewItem>
88-
<NavigationViewItem
89-
AccessKey="F"
90-
AutomationProperties.AutomationId="SettingsItemFolders"
91-
Content="{helpers:ResourceString Name=Folders}"
92-
Tag="2">
93-
<NavigationViewItem.Icon>
94-
<FontIcon Glyph="&#xE8B7;" />
95-
</NavigationViewItem.Icon>
96-
</NavigationViewItem>
97-
<NavigationViewItem
98-
AccessKey="E"
99-
AutomationProperties.AutomationId="SettingsItemAdvanced"
100-
Content="{helpers:ResourceString Name=Advanced}"
101-
CornerRadius="0"
102-
Tag="3">
103-
<NavigationViewItem.Icon>
104-
<FontIcon Glyph="&#xF1AD;" />
105-
</NavigationViewItem.Icon>
106-
</NavigationViewItem>
107-
<NavigationViewItem
108-
AccessKey="B"
109-
AutomationProperties.AutomationId="SettingsItemAbout"
110-
Content="{helpers:ResourceString Name=About}"
111-
Tag="4">
112-
<NavigationViewItem.Icon>
113-
<FontIcon FontSize="16" Glyph="&#xE946;" />
114-
</NavigationViewItem.Icon>
115-
</NavigationViewItem>
116-
</NavigationView.MenuItems>
57+
<NavigationView
58+
x:Name="SettingsPane"
59+
Grid.Row="1"
60+
IsBackButtonVisible="Collapsed"
61+
IsBackEnabled="False"
62+
IsPaneToggleButtonVisible="False"
63+
IsSettingsVisible="False"
64+
IsTitleBarAutoPaddingEnabled="False"
65+
OpenPaneLength="260"
66+
PaneDisplayMode="Left"
67+
SelectionChanged="SettingsPane_SelectionChanged">
11768

118-
<ScrollViewer
119-
x:Name="SettingsScrollViewer"
120-
VerticalAlignment="Stretch"
121-
VerticalScrollBarVisibility="Visible"
122-
VerticalScrollMode="Enabled">
123-
<Frame x:Name="SettingsContentFrame" Padding="12" />
124-
</ScrollViewer>
125-
</NavigationView>
126-
</Grid>
69+
<NavigationView.MenuItems>
70+
<NavigationViewItem
71+
AccessKey="A"
72+
AutomationProperties.AutomationId="SettingsItemAppearance"
73+
Content="{helpers:ResourceString Name=Appearance}"
74+
IsSelected="True"
75+
Tag="0">
76+
<NavigationViewItem.Icon>
77+
<FontIcon HorizontalAlignment="Left" Glyph="&#xE790;" />
78+
</NavigationViewItem.Icon>
79+
</NavigationViewItem>
80+
<NavigationViewItem
81+
AccessKey="P"
82+
AutomationProperties.AutomationId="SettingsItemPreferences"
83+
Content="{helpers:ResourceString Name=SettingsNavPreferences/Content}"
84+
Tag="1">
85+
<NavigationViewItem.Icon>
86+
<FontIcon FontFamily="{StaticResource CustomGlyph}" Glyph="&#xF116;" />
87+
</NavigationViewItem.Icon>
88+
</NavigationViewItem>
89+
<NavigationViewItem
90+
AccessKey="F"
91+
AutomationProperties.AutomationId="SettingsItemFolders"
92+
Content="{helpers:ResourceString Name=Folders}"
93+
Tag="2">
94+
<NavigationViewItem.Icon>
95+
<FontIcon Glyph="&#xE8B7;" />
96+
</NavigationViewItem.Icon>
97+
</NavigationViewItem>
98+
<NavigationViewItem
99+
AccessKey="E"
100+
AutomationProperties.AutomationId="SettingsItemAdvanced"
101+
Content="{helpers:ResourceString Name=Advanced}"
102+
CornerRadius="0"
103+
Tag="3">
104+
<NavigationViewItem.Icon>
105+
<FontIcon Glyph="&#xF1AD;" />
106+
</NavigationViewItem.Icon>
107+
</NavigationViewItem>
108+
<NavigationViewItem
109+
AccessKey="B"
110+
AutomationProperties.AutomationId="SettingsItemAbout"
111+
Content="{helpers:ResourceString Name=About}"
112+
Tag="4">
113+
<NavigationViewItem.Icon>
114+
<FontIcon FontSize="16" Glyph="&#xE946;" />
115+
</NavigationViewItem.Icon>
116+
</NavigationViewItem>
117+
</NavigationView.MenuItems>
118+
119+
<ScrollViewer
120+
x:Name="SettingsScrollViewer"
121+
VerticalAlignment="Stretch"
122+
VerticalScrollBarVisibility="Visible"
123+
VerticalScrollMode="Enabled">
124+
<Frame x:Name="SettingsContentFrame" Padding="12" />
125+
</ScrollViewer>
126+
</NavigationView>
127+
</Grid>
128+
</Border>
127129
</ContentDialog>

src/Files.App/Files.App.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<PackageReference Include="ini-parser-netstandard" Version="2.5.2" />
7171
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="5.0.1" />
7272
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="5.0.1" />
73-
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.2" />
73+
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="7.0.3" />
7474
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
7575
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
7676
<PackageReference Include="SevenZipSharp" Version="1.0.0" />

src/Files.App/Filesystem/FileTagsManager.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using CommunityToolkit.Mvvm.DependencyInjection;
2+
using CommunityToolkit.Mvvm.Input;
23
using Files.App.DataModels.NavigationControlItems;
34
using Files.Backend.Services.Settings;
45
using Files.Shared;
@@ -29,6 +30,20 @@ public IReadOnlyList<FileTagItem> FileTags
2930
}
3031
}
3132

33+
public FileTagsManager()
34+
{
35+
fileTagsSettingsService.OnTagsUpdated += TagsUpdated;
36+
}
37+
38+
private async void TagsUpdated(object? _, EventArgs e)
39+
{
40+
lock (fileTags)
41+
fileTags.Clear();
42+
DataChanged?.Invoke(SectionType.FileTag, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
43+
44+
await UpdateFileTagsAsync();
45+
}
46+
3247
public Task UpdateFileTagsAsync()
3348
{
3449
try

src/Files.App/Helpers/ColorHelpers.cs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using CommunityToolkit.WinUI.Helpers;
12
using System;
23
using Windows.UI;
34

@@ -11,11 +12,15 @@ internal static class ColorHelpers
1112
public static Color FromHex(string colorHex)
1213
{
1314
colorHex = colorHex.Replace("#", string.Empty);
14-
var r = (byte)Convert.ToUInt32(colorHex.Substring(0, 2), 16);
15-
var g = (byte)Convert.ToUInt32(colorHex.Substring(2, 2), 16);
16-
var b = (byte)Convert.ToUInt32(colorHex.Substring(4, 2), 16);
1715

18-
return Color.FromArgb(255, r, g, b);
16+
var alphaOffset = colorHex.Length == 8 ? 2 : 0;
17+
18+
var a = alphaOffset == 2 ? (byte)Convert.ToUInt32(colorHex.Substring(0, 2), 16) : (byte)255;
19+
var r = (byte)Convert.ToUInt32(colorHex.Substring(alphaOffset, 2), 16);
20+
var g = (byte)Convert.ToUInt32(colorHex.Substring(alphaOffset + 2, 2), 16);
21+
var b = (byte)Convert.ToUInt32(colorHex.Substring(alphaOffset + 4, 2), 16);
22+
23+
return Color.FromArgb(a, r, g, b);
1924
}
2025

2126
/// <summary>
@@ -36,5 +41,20 @@ public static uint ToUint(this Color c)
3641
{
3742
return (uint)(((c.A << 24) | (c.R << 16) | (c.G << 8) | c.B) & 0xffffffffL);
3843
}
44+
45+
/// <summary>
46+
/// Generates a random color and returns its Hex
47+
/// </summary>
48+
/// <returns></returns>
49+
public static string RandomColor()
50+
{
51+
var color = Color.FromArgb(
52+
255,
53+
(byte)Random.Shared.Next(0, 256),
54+
(byte)Random.Shared.Next(0, 256),
55+
(byte)Random.Shared.Next(0, 256));
56+
57+
return color.ToHex();
58+
}
3959
}
4060
}

0 commit comments

Comments
 (0)