91287c9860
* Fix startup binding and prep v1.2.0 * Polish v1.2.0 validation UX * Fix final v1.2.0 validation polish * Make Activity Logs a ThreadPilot audit trail * Fix high scheduling registry value * Polish process list and automation settings UX * Fix process context menu separator styling * Theme process context menu visuals * Stabilize process context menu styling * Remove process menu icon gutter * Polish startup and idle process refresh * Finalize PR22 release polish
195 lines
12 KiB
XML
195 lines
12 KiB
XML
<UserControl x:Class="ThreadPilot.Views.PowerPlanView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:ThreadPilot.Views"
|
|
xmlns:helpers="clr-namespace:ThreadPilot.Helpers"
|
|
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="650" d:DesignWidth="1200">
|
|
|
|
<Grid Margin="12">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Grid.Row="0" Margin="0,0,0,16">
|
|
<TextBlock Text="Power Plans" Style="{StaticResource PageTitleTextStyle}" Margin="0,0,0,4"/>
|
|
<TextBlock Text="Manage the active Windows power plan and import custom .pow profiles" Style="{StaticResource PageSubtitleTextStyle}"/>
|
|
</StackPanel>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="2*"/>
|
|
<ColumnDefinition Width="16"/>
|
|
<ColumnDefinition Width="3*"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- System Power Plans -->
|
|
<GroupBox Grid.Column="0"
|
|
Header="Windows Power Plans"
|
|
Margin="0">
|
|
<Grid Margin="8">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid Grid.Row="0" Margin="0,0,0,12">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0"
|
|
Text="Select the Windows plan to make active."
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
|
TextWrapping="Wrap"
|
|
TextTrimming="CharacterEllipsis"
|
|
ToolTip="Select the Windows plan to make active."/>
|
|
<WrapPanel Grid.Row="1" Margin="0,8,0,0">
|
|
<Button Command="{Binding SetActivePlanCommand}"
|
|
Content="Set as Active Windows Plan"
|
|
Padding="10,5"
|
|
Margin="0,0,8,0"
|
|
ToolTip="Change the active Windows power plan to the selected plan"/>
|
|
<Button Command="{Binding LoadPowerPlansCommand}"
|
|
Content="Refresh Plans"
|
|
Padding="10,5"
|
|
ToolTip="Refresh the list of available power plans"/>
|
|
</WrapPanel>
|
|
</Grid>
|
|
|
|
<ui:ListView Grid.Row="1"
|
|
ItemsSource="{Binding PowerPlans}"
|
|
SelectedItem="{Binding SelectedPowerPlan}"
|
|
Background="{DynamicResource QuietRowBackgroundBrush}"
|
|
BorderBrush="{DynamicResource BorderSubtleBrush}"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
|
|
<ui:ListView.ItemContainerStyle>
|
|
<Style TargetType="ListViewItem">
|
|
<Setter Property="Tag" Value="{Binding DataContext, RelativeSource={RelativeSource AncestorType=ListView}}"/>
|
|
<Setter Property="ContextMenu">
|
|
<Setter.Value>
|
|
<ContextMenu DataContext="{Binding PlacementTarget.Tag, RelativeSource={RelativeSource Self}}">
|
|
<MenuItem Header="Delete"
|
|
Command="{Binding DeletePowerPlanCommand}"
|
|
CommandParameter="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
|
|
</ContextMenu>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ui:ListView.ItemContainerStyle>
|
|
<ui:ListView.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Margin="2"
|
|
Padding="8"
|
|
BorderThickness="4,1,1,1"
|
|
CornerRadius="6">
|
|
<Border.Style>
|
|
<Style TargetType="Border">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderSubtleBrush}"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsActive}" Value="True">
|
|
<Setter Property="Background" Value="{DynamicResource SoftSelectionBackgroundBrush}"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource AccentBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="8"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<StackPanel Grid.Column="0">
|
|
<TextBlock Text="{Binding Name}"
|
|
FontWeight="{Binding IsActive, Converter={StaticResource BoolToFontWeightConverter}}"
|
|
TextTrimming="CharacterEllipsis"/>
|
|
<TextBlock Text="{Binding Guid}"
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
|
FontSize="11"
|
|
TextTrimming="CharacterEllipsis"/>
|
|
</StackPanel>
|
|
<Border Grid.Column="2"
|
|
Background="{DynamicResource AccentFillColorDefaultBrush}"
|
|
CornerRadius="4"
|
|
Padding="8,2"
|
|
VerticalAlignment="Top"
|
|
Visibility="{Binding IsActive, Converter={StaticResource BoolToVisibilityConverter}}">
|
|
<TextBlock Text="Active"
|
|
FontSize="11"
|
|
FontWeight="SemiBold"
|
|
Foreground="{DynamicResource TextOnAccentFillColorPrimaryBrush}"/>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ui:ListView.ItemTemplate>
|
|
</ui:ListView>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<!-- Custom Power Plans -->
|
|
<GroupBox Grid.Column="2"
|
|
Header="Custom Power Plans"
|
|
Margin="0">
|
|
<Grid Margin="8">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Grid Grid.Row="0" Margin="0,0,0,12">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0"
|
|
Text="Local .pow files ready to import into Windows."
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
|
TextWrapping="Wrap"
|
|
TextTrimming="CharacterEllipsis"
|
|
ToolTip="Local .pow files ready to import into Windows."/>
|
|
<WrapPanel Grid.Row="1" Margin="0,8,0,0">
|
|
<Button Command="{Binding ImportCustomPlanCommand}"
|
|
Content="Import Selected .pow"
|
|
Padding="10,5"
|
|
Margin="0,0,8,0"
|
|
ToolTip="Import the selected custom .pow file into Windows"/>
|
|
<Button Command="{Binding AddCustomPlanFileCommand}"
|
|
Content="Add .pow File"
|
|
Padding="10,5"
|
|
ToolTip="Add a new custom power plan file to the custom library"/>
|
|
</WrapPanel>
|
|
</Grid>
|
|
|
|
<ui:ListView Grid.Row="1"
|
|
ItemsSource="{Binding CustomPowerPlans}"
|
|
SelectedItem="{Binding SelectedCustomPlan}"
|
|
Background="{DynamicResource QuietRowBackgroundBrush}"
|
|
BorderBrush="{DynamicResource BorderSubtleBrush}"
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
|
|
<ui:ListView.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Margin="5" ToolTip="{Binding FilePath}">
|
|
<TextBlock Text="{Binding Name}"
|
|
FontWeight="SemiBold"
|
|
TextTrimming="CharacterEllipsis"/>
|
|
<TextBlock Text="{Binding FilePath}"
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
|
FontSize="11"
|
|
TextTrimming="CharacterEllipsis"/>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ui:ListView.ItemTemplate>
|
|
</ui:ListView>
|
|
</Grid>
|
|
</GroupBox>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|