Skip to content

Commit ad52bb2

Browse files
authored
Properties improvements (#7416)
1 parent 295bdad commit ad52bb2

File tree

4 files changed

+96
-7
lines changed

4 files changed

+96
-7
lines changed

src/Files/Dialogs/SettingsDialog.xaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
VerticalAlignment="Stretch"
101101
VerticalScrollBarVisibility="Visible"
102102
VerticalScrollMode="Enabled">
103-
<Frame x:Name="SettingsContentFrame" Padding="12,4,12,12" />
103+
<Frame x:Name="SettingsContentFrame" Padding="12,0,12,12" />
104104
</ScrollViewer>
105105
</muxc:NavigationView>
106106

@@ -109,12 +109,13 @@
109109
Grid.Column="1"
110110
Width="36"
111111
Height="36"
112-
Margin="12"
112+
Margin="8,12,12,8"
113113
HorizontalAlignment="Right"
114114
VerticalAlignment="Top"
115115
AutomationProperties.Name="{helpers:ResourceString Name=Close}"
116+
Background="Transparent"
117+
BorderBrush="Transparent"
116118
Click="ButtonClose_Click"
117-
CornerRadius="20"
118119
ToolTipService.ToolTip="{helpers:ResourceString Name=Close}">
119120
<FontIcon FontSize="12" Glyph="&#xE8BB;" />
120121
</Button>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,4 +2701,7 @@ We use App Center to keep track of app usage, find bugs, and fix crashes. All in
27012701
<data name="Type" xml:space="preserve">
27022702
<value>Type:</value>
27032703
</data>
2704+
<data name="Bytes" xml:space="preserve">
2705+
<value>Bytes</value>
2706+
</data>
27042707
</root>

src/Files/ViewModels/SelectedItemsPropertiesViewModel.cs

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ public ulong DriveUsedSpaceValue
285285
set
286286
{
287287
SetProperty(ref driveUsedSpaceValue, value);
288-
DriveUsedSpace = DriveUsedSpaceValue.ToLongSizeString();
288+
DriveUsedSpace = DriveUsedSpaceValue.ToSizeString();
289+
DriveUsedSpaceLongSize = DriveUsedSpaceValue.ToLongSizeString();
289290
OnPropertyChanged(nameof(DrivePercentageValue));
290291
}
291292
}
@@ -301,6 +302,17 @@ public string DriveUsedSpace
301302
SetProperty(ref driveUsedSpace, value);
302303
}
303304
}
305+
306+
private string driveUsedSpaceLongSize;
307+
308+
public string DriveUsedSpaceLongSize
309+
{
310+
get => driveUsedSpaceLongSize;
311+
set
312+
{
313+
SetProperty(ref driveUsedSpaceLongSize, value);
314+
}
315+
}
304316

305317
public bool driveUsedSpaceVisibiity = false;
306318

@@ -318,7 +330,9 @@ public ulong DriveFreeSpaceValue
318330
set
319331
{
320332
SetProperty(ref driveFreeSpaceValue, value);
321-
DriveFreeSpace = DriveFreeSpaceValue.ToLongSizeString();
333+
DriveFreeSpace = DriveFreeSpaceValue.ToSizeString();
334+
DriveFreeSpaceLongSize = DriveFreeSpaceValue.ToLongSizeString();
335+
322336
}
323337
}
324338

@@ -333,6 +347,17 @@ public string DriveFreeSpace
333347
SetProperty(ref driveFreeSpace, value);
334348
}
335349
}
350+
351+
private string driveFreeSpaceLongSize;
352+
353+
public string DriveFreeSpaceLongSize
354+
{
355+
get => driveFreeSpaceLongSize;
356+
set
357+
{
358+
SetProperty(ref driveFreeSpaceLongSize, value);
359+
}
360+
}
336361

337362
public bool driveFreeSpaceVisibiity = false;
338363

@@ -418,7 +443,8 @@ public ulong DriveCapacityValue
418443
set
419444
{
420445
SetProperty(ref driveCapacityValue, value);
421-
DriveCapacity = DriveCapacityValue.ToLongSizeString();
446+
DriveCapacity = DriveCapacityValue.ToSizeString();
447+
DriveCapacityLongSize = DriveCapacityValue.ToLongSizeString();
422448
OnPropertyChanged(nameof(DrivePercentageValue));
423449
}
424450
}
@@ -434,6 +460,17 @@ public string DriveCapacity
434460
SetProperty(ref driveCapacity, value);
435461
}
436462
}
463+
464+
private string driveCapacityLongSize;
465+
466+
public string DriveCapacityLongSize
467+
{
468+
get => driveCapacityLongSize;
469+
set
470+
{
471+
SetProperty(ref driveCapacityLongSize, value);
472+
}
473+
}
437474

438475
public bool driveCapacityVisibiity = false;
439476

src/Files/Views/Pages/PropertiesGeneral.xaml

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@
278278
MinWidth="100"
279279
MaxWidth="140" />
280280
<ColumnDefinition Width="*" />
281+
<ColumnDefinition Width="Auto" />
281282
</Grid.ColumnDefinitions>
282283
<Grid.RowDefinitions>
283284
<RowDefinition Height="Auto" />
@@ -364,6 +365,22 @@
364365
x:Load="{x:Bind ViewModel.DriveUsedSpaceVisibiity, Mode=OneWay}"
365366
Style="{StaticResource PropertyValueTextBlock}"
366367
Text="{x:Bind ViewModel.DriveUsedSpace, Mode=OneWay}" />
368+
<Button
369+
Grid.Row="0"
370+
Grid.Column="3"
371+
Padding="8,6"
372+
AutomationProperties.Name="{helpers:ResourceString Name=Bytes}"
373+
Background="Transparent"
374+
BorderBrush="Transparent"
375+
ToolTipService.ToolTip="{helpers:ResourceString Name=Bytes}">
376+
<FontIcon FontSize="16" Glyph="&#xE946;" />
377+
<Button.Flyout>
378+
<Flyout>
379+
<TextBlock IsTextSelectionEnabled="True" Text="{x:Bind ViewModel.DriveUsedSpaceLongSize, Mode=OneWay}" />
380+
</Flyout>
381+
</Button.Flyout>
382+
</Button>
383+
367384

368385
<!-- Disk free space -->
369386
<StackPanel
@@ -393,6 +410,21 @@
393410
x:Load="{x:Bind ViewModel.DriveFreeSpaceVisibiity, Mode=OneWay}"
394411
Style="{StaticResource PropertyValueTextBlock}"
395412
Text="{x:Bind ViewModel.DriveFreeSpace, Mode=OneWay}" />
413+
<Button
414+
Grid.Row="1"
415+
Grid.Column="3"
416+
Padding="8,6"
417+
AutomationProperties.Name="{helpers:ResourceString Name=Bytes}"
418+
Background="Transparent"
419+
BorderBrush="Transparent"
420+
ToolTipService.ToolTip="{helpers:ResourceString Name=Bytes}">
421+
<FontIcon FontSize="16" Glyph="&#xE946;" />
422+
<Button.Flyout>
423+
<Flyout>
424+
<TextBlock IsTextSelectionEnabled="True" Text="{x:Bind ViewModel.DriveFreeSpaceLongSize, Mode=OneWay}" />
425+
</Flyout>
426+
</Button.Flyout>
427+
</Button>
396428

397429
<!-- Drive capacity -->
398430
<TextBlock
@@ -412,11 +444,26 @@
412444
x:Load="{x:Bind ViewModel.DriveCapacityVisibiity, Mode=OneWay}"
413445
Style="{StaticResource PropertyValueTextBlock}"
414446
Text="{x:Bind ViewModel.DriveCapacity, Mode=OneWay}" />
447+
<Button
448+
Grid.Row="2"
449+
Grid.Column="3"
450+
Padding="8,6"
451+
AutomationProperties.Name="{helpers:ResourceString Name=Bytes}"
452+
Background="Transparent"
453+
BorderBrush="Transparent"
454+
ToolTipService.ToolTip="{helpers:ResourceString Name=Bytes}">
455+
<FontIcon FontSize="16" Glyph="&#xE946;" />
456+
<Button.Flyout>
457+
<Flyout>
458+
<TextBlock IsTextSelectionEnabled="True" Text="{x:Bind ViewModel.DriveCapacityLongSize, Mode=OneWay}" />
459+
</Flyout>
460+
</Button.Flyout>
461+
</Button>
415462

416463
<MenuFlyoutSeparator
417464
Grid.Row="3"
418465
Grid.Column="0"
419-
Grid.ColumnSpan="3"
466+
Grid.ColumnSpan="4"
420467
Margin="-12,0"
421468
Background="{ThemeResource CardStrokeColorDefaultBrush}" />
422469

@@ -431,6 +478,7 @@
431478
x:Name="DiskCleanupButton"
432479
Grid.Row="4"
433480
Grid.Column="2"
481+
Grid.ColumnSpan="2"
434482
HorizontalAlignment="Right"
435483
Click="DiskCleanupButton_Click"
436484
Content="{helpers:ResourceString Name=DiskCleanup}" />

0 commit comments

Comments
 (0)