Skip to content

Update font style #5734

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 13 commits into from
Aug 12, 2021
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
21 changes: 17 additions & 4 deletions Files/Resources/PreviewPanePropertiesInformation.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@
"IsReadOnly": false,
"ID": null
},
{
"NameResource": "PropertyPartOfSet",
"SectionResource": "PropertySectionMusic",
"Property": "System.Music.PartOfSet",
"IsReadOnly": false,
"ID": null
},
{
"NameResource": "PropertyGenre",
"SectionResource": "PropertySectionMusic",
Expand Down Expand Up @@ -375,6 +382,13 @@
"IsReadOnly": true,
"ID": null
},
{
"NameResource": "PropertyDateTaken",
"SectionResource": "PropertySectionPhoto",
"Property": "System.Photo.DateTaken",
"IsReadOnly": true,
"ID": null
},
{
"NameResource": "PropertyDateModified",
"SectionResource": "PropertySectionCore",
Expand Down Expand Up @@ -437,10 +451,9 @@
"ID": null
},
{
"NameResource": "PropertyDateTaken",
"SectionResource": "PropertySectionPhoto",
"Property": "System.Photo.DateTaken",
"NameResource": "DetailsViewHeaderFlyout_ShowFileTag/Text",
"SectionResource": "PropertySectionCore",
"IsReadOnly": true,
"ID": null
"ID": "filetag"
}
]
7 changes: 7 additions & 0 deletions Files/Resources/PropertiesInformation.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@
"IsReadOnly": false,
"ID": null
},
{
"NameResource": "PropertyPartOfSet",
"SectionResource": "PropertySectionMusic",
"Property": "System.Music.PartOfSet",
"IsReadOnly": false,
"ID": null
},
{
"NameResource": "PropertyGenre",
"SectionResource": "PropertySectionMusic",
Expand Down
3 changes: 3 additions & 0 deletions Files/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -2740,6 +2740,9 @@ We use App Center to keep track of app usage, find bugs, and fix crashes. All in
<data name="SettingsShowFavoritesSection.Title" xml:space="preserve">
<value>Show Favorites section on the sidebar</value>
</data>
<data name="PropertyPartOfSet" xml:space="preserve">
<value>Part of set</value>
</data>
<data name="InsertDiscDialog.CloseDialogButton" xml:space="preserve">
<value>Close</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
Drop="TabViewItem_Drop"
Header="{x:Bind Header, Mode=OneWay}"
IconSource="{x:Bind IconSource, Mode=OneWay}"
Loaded="TabViewItem_Loaded"
Style="{ThemeResource TabViewItemStyle}"
ToolTipService.ToolTip="{x:Null}" />
</DataTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.Toolkit.Uwp.UI;
using Microsoft.UI.Xaml.Controls;
using System;
using System.Diagnostics;
using System.Linq;
using Windows.ApplicationModel.DataTransfer;
using Windows.Storage;
Expand Down Expand Up @@ -224,6 +225,16 @@ public Visibility TabStripVisibility
public static readonly DependencyProperty TabStripVisibilityProperty =
DependencyProperty.Register("TabStripVisibility", typeof(Visibility), typeof(HorizontalMultitaskingControl), new PropertyMetadata(Visibility.Visible));

private bool firstLoad = true;

private void TabViewItem_Loaded(object sender, RoutedEventArgs e)
{
// fixes issue where tab would not show as selected when opened with path argument
if(firstLoad)
{
firstLoad = false;
(sender as TabViewItem).IsSelected = true;
}
}
}
}
9 changes: 2 additions & 7 deletions Files/UserControls/PreviewPane.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@
Grid.Row="0"
Grid.Column="0"
HorizontalAlignment="Stretch"
FontSize="14"
Style="{StaticResource HeaderTextBlockStyle}"
Style="{StaticResource BodyTextBlockStyle}"
Text="{x:Bind Name, Mode=OneWay}" />

<TextBlock
Expand All @@ -185,16 +184,12 @@
Grid.Column="0"
HorizontalAlignment="Stretch"
IsTextSelectionEnabled="True"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind ValueText, Mode=TwoWay}"
TextWrapping="Wrap" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
<!--<muxc:ItemsRepeater.cont>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</muxc:ItemsRepeater.cont>-->
</ItemsControl>
</StackPanel>
</ScrollViewer>
Expand Down
4 changes: 3 additions & 1 deletion Files/ViewModels/ItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,9 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(async () =>
var matchingStorageFolder = (StorageFolder)matchingStorageItem ?? await GetFolderFromPathAsync(item.ItemPath);
if (matchingStorageFolder != null)
{
using var Thumbnail = await matchingStorageFolder.GetThumbnailAsync(ThumbnailMode.ListView, thumbnailSize, ThumbnailOptions.ReturnOnlyIfCached);
var mode = thumbnailSize < 80 ? ThumbnailMode.ListView : ThumbnailMode.SingleItem;

using var Thumbnail = await matchingStorageFolder.GetThumbnailAsync(mode, thumbnailSize, ThumbnailOptions.UseCurrentScale);
if (!(Thumbnail == null || Thumbnail.Size == 0 || Thumbnail.OriginalHeight == 0 || Thumbnail.OriginalWidth == 0))
{
await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(async () =>
Expand Down
10 changes: 10 additions & 0 deletions Files/ViewModels/Previews/BasePreviewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ private async Task<List<FileProperty>> GetSystemFileProperties()

list.Find(x => x.ID == "address").Value = await FileProperties.GetAddressFromCoordinatesAsync((double?)list.Find(x => x.Property == "System.GPS.LatitudeDecimal").Value,
(double?)list.Find(x => x.Property == "System.GPS.LongitudeDecimal").Value);

// adds the value for the file tag
if(App.AppSettings.AreFileTagsEnabled)
{
list.FirstOrDefault(x => x.ID == "filetag").Value = Item.FileTagUI?.TagName;
} else
{
_ = list.Remove(list.FirstOrDefault(x => x.ID == "filetag"));
}

return list.Where(i => i.ValueText != null).ToList();
}

Expand Down
14 changes: 9 additions & 5 deletions Files/ViewModels/Previews/FolderPreviewViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,20 @@ private async Task LoadPreviewAndDetailsAsync()
Value = Extensions.DateTimeExtensions.GetFriendlyDateFromFormat(info.ItemDate, returnformat, true)
},
new FileProperty()
{
NameResource = "PropertyItemName",
Value = Folder.Name,
},
new FileProperty()
{
NameResource = "PropertyItemPathDisplay",
Value = Folder.Path,
}
};

if(App.AppSettings.AreFileTagsEnabled)
{
Item.FileDetails.Add(new FileProperty()
{
NameResource = "DetailsViewHeaderFlyout_ShowFileTag/Text",
Value = Item.FileTagUI?.TagName
});
}
}
}
}
2 changes: 1 addition & 1 deletion Files/Views/LayoutModes/ColumnViewBase.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private void RenameTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
private void RenameTextBox_LostFocus(object sender, RoutedEventArgs e)
{
// This check allows the user to use the text box context menu without ending the rename
if (!(FocusManager.GetFocusedElement() is AppBarButton))
if (!(FocusManager.GetFocusedElement() is AppBarButton or Popup))
{
TextBox textBox = e.OriginalSource as TextBox;
CommitRename(textBox);
Expand Down
2 changes: 1 addition & 1 deletion Files/Views/LayoutModes/ColumnViewBrowser.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ private void RenameTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
private void RenameTextBox_LostFocus(object sender, RoutedEventArgs e)
{
// This check allows the user to use the text box context menu without ending the rename
if (!(FocusManager.GetFocusedElement() is AppBarButton))
if (!(FocusManager.GetFocusedElement() is AppBarButton or Popup))
{
TextBox textBox = e.OriginalSource as TextBox;
CommitRename(textBox);
Expand Down
62 changes: 29 additions & 33 deletions Files/Views/LayoutModes/DetailsLayoutBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@
<Style TargetType="uc:DataGridHeader">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>

<Style
x:Key="ColumnContentTextBlock"
BasedOn="{StaticResource CaptionTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="TextWrapping" Value="NoWrap" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Opacity" Value="0.6" />
</Style>
</ResourceDictionary>
</local:BaseLayout.Resources>

Expand Down Expand Up @@ -503,6 +514,7 @@
<DataTemplate x:DataType="local2:ListedItem">
<Grid
HorizontalAlignment="Stretch"
AutomationProperties.Name="{x:Bind ItemName, Mode=OneWay}"
IsRightTapEnabled="True"
Loaded="Grid_Loaded"
RightTapped="StackPanel_RightTapped"
Expand Down Expand Up @@ -629,8 +641,7 @@
VerticalAlignment="Center"
Visibility="{Binding ColumnsViewModel.TagColumn.Visibility, ElementName=PageRoot, Mode=OneWay}">
<TextBlock
VerticalAlignment="Center"
FontWeight="Light"
Style="{StaticResource ColumnContentTextBlock}"
Text="{x:Bind FileTagUI.TagName, Mode=OneWay}"
TextTrimming="CharacterEllipsis"
Visibility="{x:Bind FileTagUI, Converter={StaticResource EmptyObjectToObjectConverter}, Mode=OneWay}" />
Expand All @@ -644,11 +655,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
x:Load="{x:Bind IsRecycleBinItem}">
<TextBlock
VerticalAlignment="Center"
FontWeight="Light"
Text="{x:Bind AsRecycleBinItem.ItemOriginalPath, Mode=OneWay}"
TextTrimming="CharacterEllipsis" />
<TextBlock Style="{StaticResource ColumnContentTextBlock}" Text="{x:Bind AsRecycleBinItem.ItemOriginalPath, Mode=OneWay}" />
</Grid>

<Grid
Expand All @@ -659,11 +666,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
x:Load="{x:Bind IsRecycleBinItem}">
<TextBlock
VerticalAlignment="Center"
FontWeight="Light"
Text="{x:Bind AsRecycleBinItem.ItemDateDeleted, Mode=OneWay}"
TextTrimming="CharacterEllipsis" />
<TextBlock Style="{StaticResource ColumnContentTextBlock}" Text="{x:Bind AsRecycleBinItem.ItemDateDeleted, Mode=OneWay}" />
</Grid>

<Grid
Expand Down Expand Up @@ -691,11 +694,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Visibility="{Binding ColumnsViewModel.DateModifiedColumn.Visibility, ElementName=PageRoot, Mode=OneWay}">
<TextBlock
VerticalAlignment="Center"
FontWeight="Light"
Text="{x:Bind ItemDateModified, Mode=OneWay}"
TextTrimming="CharacterEllipsis" />
<TextBlock Style="{StaticResource ColumnContentTextBlock}" Text="{x:Bind ItemDateModified, Mode=OneWay}" />
</Grid>

<Grid
Expand All @@ -706,11 +705,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Visibility="{Binding ColumnsViewModel.DateCreatedColumn.Visibility, ElementName=PageRoot, Mode=OneWay}">
<TextBlock
VerticalAlignment="Center"
FontWeight="Light"
Text="{x:Bind ItemDateCreated, Mode=OneWay}"
TextTrimming="CharacterEllipsis" />
<TextBlock Style="{StaticResource ColumnContentTextBlock}" Text="{x:Bind ItemDateCreated, Mode=OneWay}" />
</Grid>

<Grid
Expand All @@ -721,11 +716,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Visibility="{Binding ColumnsViewModel.ItemTypeColumn.Visibility, ElementName=PageRoot, Mode=OneWay}">
<TextBlock
VerticalAlignment="Center"
FontWeight="Light"
Text="{x:Bind ItemType, Mode=OneWay}"
TextTrimming="CharacterEllipsis" />
<TextBlock Style="{StaticResource ColumnContentTextBlock}" Text="{x:Bind ItemType, Mode=OneWay}" />
</Grid>

<Grid
Expand All @@ -736,11 +727,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Visibility="{Binding ColumnsViewModel.SizeColumn.Visibility, ElementName=PageRoot, Mode=OneWay}">
<TextBlock
VerticalAlignment="Center"
FontWeight="Light"
Text="{x:Bind FileSize, Mode=OneWay}"
TextTrimming="CharacterEllipsis" />
<TextBlock Style="{StaticResource ColumnContentTextBlock}" Text="{x:Bind FileSize, Mode=OneWay}" />
</Grid>
</Grid>
</DataTemplate>
Expand Down Expand Up @@ -815,18 +802,27 @@
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" MinWidth="24" />
</Grid.ColumnDefinitions>
<ItemsPresenter
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
Footer="{TemplateBinding Footer}"
FooterTemplate="{TemplateBinding FooterTemplate}"
FooterTransitions="{TemplateBinding FooterTransitions}"
HeaderTemplate="{TemplateBinding HeaderTemplate}"
HeaderTransitions="{TemplateBinding HeaderTransitions}" />

<ContentPresenter
Grid.Row="1"
Grid.ColumnSpan="2"
Padding="8,0,8,8"
Content="{TemplateBinding Footer}" />
</Grid>
</ScrollViewer>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion Files/Views/LayoutModes/DetailsLayoutBrowser.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ private void RenameTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
private void RenameTextBox_LostFocus(object sender, RoutedEventArgs e)
{
// This check allows the user to use the text box context menu without ending the rename
if (!(FocusManager.GetFocusedElement() is AppBarButton))
if (!(FocusManager.GetFocusedElement() is AppBarButton or Popup))
{
TextBox textBox = e.OriginalSource as TextBox;
CommitRename(textBox);
Expand Down
Loading