Skip to content

Commit

Permalink
Feature: Indicate "Always keep on device" status (files-community#14012)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 authored Nov 22, 2023
1 parent 92c5231 commit 00543d8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
29 changes: 29 additions & 0 deletions src/Files.App/ResourceDictionaries/PathIcons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2628,6 +2628,35 @@
</Setter>
</Style>

<Style x:Key="ColorIconCloudKeepOffline" TargetType="local:OpacityIcon">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Viewbox Stretch="Fill">
<Grid Width="16" Height="16">
<Path
x:Name="Path1"
Data="M2.66782 6.1263C2.87421 5.94284 3.19025 5.96143 3.37371 6.16782L6.02141 9.27148L13.1465 2.14645C13.3417 1.95118 13.6583 1.95118 13.8536 2.14645C14.0488 2.34171 14.0488 2.65829 13.8536 2.85355L6.35356 10.3536C6.15013 10.557 5.81743 10.5472 5.6263 10.3322L2.6263 6.83218C2.44284 6.62579 2.46143 6.30975 2.66782 6.1263Z"
Fill="{ThemeResource SystemFillColorSuccessBrush}" />
<Path
x:Name="Path2"
Data="M2.5 11C2.22386 11 2 11.2239 2 11.5V13.5C2 13.7761 2.22386 14 2.5 14H13.5C13.7761 14 14 13.7761 14 13.5V11.5C14 11.2239 13.7761 11 13.5 11C13.2239 11 13 11.2239 13 11.5V13H3V11.5C3 11.2239 2.77614 11 2.5 11Z"
Fill="{ThemeResource SystemFillColorSuccessBrush}" />
</Grid>

<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled" />
<VisualState x:Name="Selected" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Viewbox>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="ColorIconGitAdded" TargetType="local:OpacityIcon">
<Setter Property="Template">
<Setter.Value>
Expand Down
8 changes: 6 additions & 2 deletions src/Files.App/Utils/Cloud/CloudDriveSyncStatusUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,20 @@ private CloudDriveSyncStatusUI(string glyph, Style opacityIcon, CloudDriveSyncSt
// File
CloudDriveSyncStatus.FileOnline
=> new CloudDriveSyncStatusUI("\uE753", (Style)Application.Current.Resources["ColorIconCloud"], syncStatus, "CloudDriveSyncStatus_Online"),
CloudDriveSyncStatus.FileOffline or CloudDriveSyncStatus.FileOfflinePinned
CloudDriveSyncStatus.FileOffline
=> new CloudDriveSyncStatusUI("\uE73E", (Style)Application.Current.Resources["ColorIconCloudSynced"], syncStatus, "CloudDriveSyncStatus_Offline"),
CloudDriveSyncStatus.FileOfflinePinned
=> new CloudDriveSyncStatusUI("\uE73E", (Style)Application.Current.Resources["ColorIconCloudKeepOffline"], syncStatus, "CloudDriveSyncStatus_Offline"),
CloudDriveSyncStatus.FileSync
=> new CloudDriveSyncStatusUI("\uE895", (Style)Application.Current.Resources["ColorIconCloudSyncing"], syncStatus, "CloudDriveSyncStatus_Sync"),

// Folder
CloudDriveSyncStatus.FolderOnline or CloudDriveSyncStatus.FolderOfflinePartial
=> new CloudDriveSyncStatusUI("\uE753", (Style)Application.Current.Resources["ColorIconCloud"], syncStatus, "CloudDriveSyncStatus_PartialOffline"),
CloudDriveSyncStatus.FolderOfflineFull or CloudDriveSyncStatus.FolderOfflinePinned or CloudDriveSyncStatus.FolderEmpty
CloudDriveSyncStatus.FolderOfflineFull or CloudDriveSyncStatus.FolderEmpty
=> new CloudDriveSyncStatusUI("\uE73E", (Style)Application.Current.Resources["ColorIconCloudSynced"], syncStatus, "CloudDriveSyncStatus_Offline"),
CloudDriveSyncStatus.FolderOfflinePinned
=> new CloudDriveSyncStatusUI("\uE73E", (Style)Application.Current.Resources["ColorIconCloudKeepOffline"], syncStatus, "CloudDriveSyncStatus_Offline"),
CloudDriveSyncStatus.FolderExcluded
=> new CloudDriveSyncStatusUI("\uF140", (Style)Application.Current.Resources["ColorIconCloudUnavailable"], syncStatus, "CloudDriveSyncStatus_Excluded"),

Expand Down

0 comments on commit 00543d8

Please sign in to comment.