Skip to content

Commit 52f14b0

Browse files
authored
Feature: Added InfoBar to the bundles widget (#11122)
1 parent da317c8 commit 52f14b0

File tree

4 files changed

+48
-3
lines changed

4 files changed

+48
-3
lines changed

src/Files.App/Strings/en-US/Resources.resw

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2880,4 +2880,10 @@
28802880
<data name="ToolTipDescriptionSize" xml:space="preserve">
28812881
<value>Size:</value>
28822882
</data>
2883-
</root>
2883+
<data name="BundlesBeingRemovedMessage" xml:space="preserve">
2884+
<value>But don't worry, we built a fantistic replacement that's more reliable and has more features. You can enable the File Tags widget from Settings &gt; Preferences &gt; Widgets. Enabling the tags widget will automatically turn off the bundles widget.</value>
2885+
</data>
2886+
<data name="BundlesBeingRemovedTitle" xml:space="preserve">
2887+
<value>Bundles will be retiring in a future update 📎</value>
2888+
</data>
2889+
</root>

src/Files.App/UserControls/Widgets/BundlesWidget.xaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@
1818
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
1919
</UserControl.Resources>
2020

21-
<Grid>
22-
<Grid Canvas.ZIndex="10">
21+
<Grid RowSpacing="12">
22+
<Grid.RowDefinitions>
23+
<RowDefinition />
24+
<RowDefinition Height="*" />
25+
</Grid.RowDefinitions>
26+
27+
<InfoBar
28+
Title="{helpers:ResourceString Name=BundlesBeingRemovedTitle}"
29+
Grid.Row="0"
30+
IsOpen="true"
31+
Message="{helpers:ResourceString Name=BundlesBeingRemovedMessage}" />
32+
33+
<Grid Grid.Row="1" Canvas.ZIndex="10">
2334
<Grid.ColumnDefinitions>
2435
<ColumnDefinition />
2536
<ColumnDefinition />
@@ -72,6 +83,7 @@
7283
<!-- Collection of bundles -->
7384
<GridView
7485
x:Name="BundlesGridView"
86+
Grid.Row="1"
7587
HorizontalAlignment="Stretch"
7688
x:Load="{x:Bind ViewModel.NoBundlesAddItemLoad, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
7789
AllowDrop="True"
@@ -365,6 +377,7 @@
365377
<!-- No Bundles Info -->
366378
<Grid
367379
x:Name="NoBundlesInfoGrid"
380+
Grid.Row="1"
368381
Width="280"
369382
Height="256"
370383
HorizontalAlignment="Left"

src/Files.App/ViewModels/SettingsViewModels/PreferencesViewModel.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,25 @@ public bool ShowBundlesWidget
487487
{
488488
if (value != UserSettingsService.PreferencesSettingsService.ShowBundlesWidget)
489489
UserSettingsService.PreferencesSettingsService.ShowBundlesWidget = value;
490+
491+
if (value & ShowFileTagsWidget)
492+
ShowFileTagsWidget = false;
493+
494+
OnPropertyChanged();
495+
}
496+
}
497+
public bool ShowFileTagsWidget
498+
{
499+
get => UserSettingsService.PreferencesSettingsService.ShowFileTagsWidget;
500+
set
501+
{
502+
if (value != UserSettingsService.PreferencesSettingsService.ShowFileTagsWidget)
503+
UserSettingsService.PreferencesSettingsService.ShowFileTagsWidget = value;
504+
505+
if (value & ShowBundlesWidget)
506+
ShowBundlesWidget = false;
507+
508+
OnPropertyChanged();
490509
}
491510
}
492511

src/Files.App/Views/SettingsPages/Preferences.xaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@
245245
IsOn="{x:Bind ViewModel.ShowBundlesWidget, Mode=TwoWay}"
246246
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
247247
</local:SettingsBlockControl>
248+
249+
<local:SettingsBlockControl Title="{helpers:ResourceString Name=FileTags}" HorizontalAlignment="Stretch">
250+
<ToggleSwitch
251+
AutomationProperties.Name="{helpers:ResourceString Name=FileTags}"
252+
IsOn="{x:Bind ViewModel.ShowFileTagsWidget, Mode=TwoWay}"
253+
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
254+
</local:SettingsBlockControl>
248255

249256
<local:SettingsBlockControl Title="{helpers:ResourceString Name=RecentFiles}" HorizontalAlignment="Stretch">
250257
<ToggleSwitch

0 commit comments

Comments
 (0)