mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
FileLocksmith UI (#27263)
* FileLocksmith * Titlebar updates * titlebar text color * titlebar text color * Titlebar updates center * titlebar code * fix ContentDialog * Adress feedback
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
<Setter Property="Width" Value="36" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Height" Value="36" />
|
||||
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
|
||||
|
||||
@@ -16,24 +16,35 @@
|
||||
<Window.SystemBackdrop>
|
||||
<MicaBackdrop />
|
||||
</Window.SystemBackdrop>
|
||||
<Grid>
|
||||
|
||||
<Grid RowSpacing="16">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="32" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="titleBar">
|
||||
<StackPanel
|
||||
Margin="16,8,8,8"
|
||||
VerticalAlignment="Top"
|
||||
Orientation="Horizontal">
|
||||
<Image Source="Assets/AppList.png" />
|
||||
<TextBlock
|
||||
x:Uid="AppTitleText"
|
||||
Margin="12,0,0,0"
|
||||
Style="{StaticResource CaptionTextBlockStyle}" />
|
||||
</StackPanel>
|
||||
<Grid x:Name="AppTitleBar"
|
||||
Height="32"
|
||||
ColumnSpacing="16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="LeftPaddingColumn" Width="0"/>
|
||||
<ColumnDefinition x:Name="IconColumn" Width="Auto"/>
|
||||
<ColumnDefinition x:Name="TitleColumn" Width="Auto"/>
|
||||
<ColumnDefinition x:Name="RightDragColumn" Width="*"/>
|
||||
<ColumnDefinition x:Name="RightPaddingColumn" Width="0"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image
|
||||
Grid.Column="1"
|
||||
Source="Assets/Icon.ico"
|
||||
VerticalAlignment="Center"
|
||||
Width="16"
|
||||
Height="16"/>
|
||||
<TextBlock
|
||||
x:Name="AppTitleTextBlock"
|
||||
x:Uid="AppTitleText"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource CaptionTextBlockStyle}" />
|
||||
</Grid>
|
||||
|
||||
<views:MainPage x:Name="mainPage" Grid.Row="1" />
|
||||
</Grid>
|
||||
</winuiex:WindowEx>
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
using System;
|
||||
using Microsoft.UI.Windowing;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using WinUIEx;
|
||||
|
||||
namespace FileLocksmithUI
|
||||
@@ -14,13 +17,24 @@ namespace FileLocksmithUI
|
||||
{
|
||||
InitializeComponent();
|
||||
mainPage.ViewModel.IsElevated = isElevated;
|
||||
SetTitleBar();
|
||||
ExtendsContentIntoTitleBar = true;
|
||||
SetTitleBar(AppTitleBar);
|
||||
Activated += MainWindow_Activated;
|
||||
AppWindow.SetIcon("Assets/Icon.ico");
|
||||
}
|
||||
|
||||
private void SetTitleBar()
|
||||
private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
|
||||
{
|
||||
ExtendsContentIntoTitleBar = true;
|
||||
SetTitleBar(titleBar);
|
||||
if (args.WindowActivationState == WindowActivationState.Deactivated)
|
||||
{
|
||||
AppTitleTextBlock.Foreground =
|
||||
(SolidColorBrush)App.Current.Resources["WindowCaptionForegroundDisabled"];
|
||||
}
|
||||
else
|
||||
{
|
||||
AppTitleTextBlock.Foreground =
|
||||
(SolidColorBrush)App.Current.Resources["WindowCaptionForeground"];
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -34,22 +34,19 @@
|
||||
</core:EventTriggerBehavior>
|
||||
</interactivity:Interaction.Behaviors>
|
||||
|
||||
<Grid>
|
||||
<Grid RowSpacing="8">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="48" />
|
||||
<RowDefinition Height="Auto" x:Name="ButtonsRow" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid
|
||||
Padding="18,0,18,4"
|
||||
VerticalAlignment="Bottom">
|
||||
<Grid Margin="16,0">
|
||||
<Button
|
||||
Click="ShowSelectedPathsButton_Click"
|
||||
Content="{x:Bind ViewModel.Paths, Converter={StaticResource fileListToDescriptionConverter}}">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<TextBlock
|
||||
Margin="0,8,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{ThemeResource BodyStrongTextBlockStyle}"
|
||||
Text="{TemplateBinding Content}" />
|
||||
@@ -57,23 +54,19 @@
|
||||
</Button.Template>
|
||||
<ToolTipService.ToolTip>
|
||||
<TextBlock
|
||||
x:Uid="PathsTooltipDescription"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
x:Uid="PathsTooltipDescription"
|
||||
TextWrapping="WrapWholeWords" />
|
||||
</ToolTipService.ToolTip>
|
||||
</Button>
|
||||
|
||||
<StackPanel
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Orientation="Horizontal"
|
||||
Spacing="6">
|
||||
Spacing="8">
|
||||
<Button
|
||||
Padding="0"
|
||||
HorizontalAlignment="Right"
|
||||
Command="{Binding LoadProcessesCommand}"
|
||||
Style="{StaticResource SubtleButtonStyle}">
|
||||
<FontIcon
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Glyph="" />
|
||||
<ToolTipService.ToolTip>
|
||||
@@ -82,12 +75,10 @@
|
||||
</Button>
|
||||
<Button
|
||||
x:Name="RestartAsAdminBtn"
|
||||
Padding="0"
|
||||
Command="{Binding RestartElevatedCommand}"
|
||||
Style="{StaticResource SubtleButtonStyle}"
|
||||
Visibility="{x:Bind ViewModel.IsElevated, Converter={StaticResource boolToVisibilityConverter}}">
|
||||
<FontIcon
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Glyph="" />
|
||||
<ToolTipService.ToolTip>
|
||||
@@ -101,23 +92,22 @@
|
||||
<Grid Visibility="{x:Bind ViewModel.IsLoading, Converter={StaticResource boolToVisibilityConverter}, Mode=OneWay}">
|
||||
<ListView
|
||||
x:Name="ProcessesListView"
|
||||
Grid.Row="1"
|
||||
IncrementalLoadingThreshold="10"
|
||||
ItemsSource="{x:Bind ViewModel.Processes}"
|
||||
SelectionMode="None">
|
||||
SelectionMode="None"
|
||||
Padding="0,0,0,12">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="interop:ProcessResult">
|
||||
<labs:SettingsExpander Margin="0,3,0,0">
|
||||
<labs:SettingsExpander Margin="0,0,0,4">
|
||||
<labs:SettingsExpander.Resources>
|
||||
<x:Double x:Key="SettingsCardWrapThreshold">0</x:Double>
|
||||
</labs:SettingsExpander.Resources>
|
||||
<labs:SettingsExpander.Header>
|
||||
<!-- We can't use the HeaderIcon because it only support a BitmapIcon, which only supports UriSource - not a direct BitmapImage -->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="2,0,24,0"
|
||||
Source="{x:Bind pid, Converter={StaticResource pidToIconConverter}}" />
|
||||
<TextBlock
|
||||
IsTextSelectionEnabled="True"
|
||||
@@ -139,19 +129,17 @@
|
||||
</ToolTipService.ToolTip>
|
||||
</FontIcon>
|
||||
<Button
|
||||
MinWidth="132"
|
||||
MinWidth="128"
|
||||
Command="{Binding Path=DataContext.EndTaskCommand, ElementName=ProcessesListView}"
|
||||
CommandParameter="{Binding}">
|
||||
<StackPanel
|
||||
Orientation="Horizontal"
|
||||
Spacing="6">
|
||||
Spacing="8">
|
||||
<FontIcon
|
||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="14"
|
||||
FontSize="16"
|
||||
Glyph="" />
|
||||
<TextBlock
|
||||
x:Uid="EndTask"
|
||||
FontSize="14" />
|
||||
x:Uid="EndTask"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
@@ -177,13 +165,10 @@
|
||||
</TextBlock>
|
||||
</labs:SettingsCard.Header>
|
||||
<ItemsRepeater
|
||||
Margin="-16,0,0,0"
|
||||
ItemsSource="{x:Bind files}">
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate x:DataType="x:String">
|
||||
<TextBlock
|
||||
Margin="16,0,0,4"
|
||||
FontSize="12"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
IsTextSelectionEnabled="True"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
@@ -200,6 +185,7 @@
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
@@ -230,14 +216,12 @@
|
||||
Height="48"
|
||||
IsActive="{x:Bind ViewModel.IsLoading, Mode=OneWay}" />
|
||||
</Grid>
|
||||
|
||||
<ContentDialog
|
||||
x:Name="SelectedFilesListDialog"
|
||||
x:Uid="SelectedFilesListDialog">
|
||||
<ScrollViewer
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
HorizontalScrollMode="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
VerticalScrollMode="Auto">
|
||||
Padding="0,0,16,0">
|
||||
<TextBlock
|
||||
IsTextSelectionEnabled="True"
|
||||
Text="{x:Bind ViewModel.PathsToString, Mode=OneWay}" />
|
||||
|
||||
Reference in New Issue
Block a user