Skip to content

Feature: Added InfoBar to the bundles widget #11122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -2880,4 +2880,10 @@
<data name="ToolTipDescriptionSize" xml:space="preserve">
<value>Size:</value>
</data>
</root>
<data name="BundlesBeingRemovedMessage" xml:space="preserve">
<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>
</data>
<data name="BundlesBeingRemovedTitle" xml:space="preserve">
<value>Bundles will be retiring in a future update 📎</value>
</data>
</root>
17 changes: 15 additions & 2 deletions src/Files.App/UserControls/Widgets/BundlesWidget.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
</UserControl.Resources>

<Grid>
<Grid Canvas.ZIndex="10">
<Grid RowSpacing="12">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<InfoBar
Title="{helpers:ResourceString Name=BundlesBeingRemovedTitle}"
Grid.Row="0"
IsOpen="true"
Message="{helpers:ResourceString Name=BundlesBeingRemovedMessage}" />

<Grid Grid.Row="1" Canvas.ZIndex="10">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
Expand Down Expand Up @@ -72,6 +83,7 @@
<!-- Collection of bundles -->
<GridView
x:Name="BundlesGridView"
Grid.Row="1"
HorizontalAlignment="Stretch"
x:Load="{x:Bind ViewModel.NoBundlesAddItemLoad, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
AllowDrop="True"
Expand Down Expand Up @@ -365,6 +377,7 @@
<!-- No Bundles Info -->
<Grid
x:Name="NoBundlesInfoGrid"
Grid.Row="1"
Width="280"
Height="256"
HorizontalAlignment="Left"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,25 @@ public bool ShowBundlesWidget
{
if (value != UserSettingsService.PreferencesSettingsService.ShowBundlesWidget)
UserSettingsService.PreferencesSettingsService.ShowBundlesWidget = value;

if (value & ShowFileTagsWidget)
ShowFileTagsWidget = false;

OnPropertyChanged();
}
}
public bool ShowFileTagsWidget
{
get => UserSettingsService.PreferencesSettingsService.ShowFileTagsWidget;
set
{
if (value != UserSettingsService.PreferencesSettingsService.ShowFileTagsWidget)
UserSettingsService.PreferencesSettingsService.ShowFileTagsWidget = value;

if (value & ShowBundlesWidget)
ShowBundlesWidget = false;

OnPropertyChanged();
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/Files.App/Views/SettingsPages/Preferences.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@
IsOn="{x:Bind ViewModel.ShowBundlesWidget, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>

<local:SettingsBlockControl Title="{helpers:ResourceString Name=FileTags}" HorizontalAlignment="Stretch">
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=FileTags}"
IsOn="{x:Bind ViewModel.ShowFileTagsWidget, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>

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