Layouted Checkboxes, redesigned Toggles & renamed RDCMan

- Removed text inside toggle as it can be confusing because it sais "enable" while enabled and "disable" if disabled. The coloring should be enough to know in what state that setting is.
- without the text i could make it a little bit smaller while still letting it look good.
- Renamed "Remote Desktop Connection Manager (RDCMan)" to "RDCMan" because that name is shorter and also mostly used by the linked site.
- layouted checkboxes so they are not more left than the title and look tidy.

- tested
This commit is contained in:
MyDrift 2024-05-04 12:30:14 +02:00
parent ff1ecbd1e3
commit b6ca69d93f
2 changed files with 8 additions and 30 deletions

View File

@ -114,7 +114,7 @@
"WPFInstallrdcman": { "WPFInstallrdcman": {
"category": "Microsoft Tools", "category": "Microsoft Tools",
"choco": "rdcman", "choco": "rdcman",
"content": "Remote Desktop Connection Manager (RDCMan)", "content": "RDCMan",
"description": "RDCMan manages multiple remote desktop connections. It is useful for managing server labs where you need regular access to each machine such as automated checkin systems and data centers.", "description": "RDCMan manages multiple remote desktop connections. It is useful for managing server labs where you need regular access to each machine such as automated checkin systems and data centers.",
"link": "https://learn.microsoft.com/en-us/sysinternals/downloads/rdcman", "link": "https://learn.microsoft.com/en-us/sysinternals/downloads/rdcman",
"winget": "Microsoft.Sysinternals.RDCMan" "winget": "Microsoft.Sysinternals.RDCMan"

View File

@ -295,7 +295,7 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="CheckBox"> <ControlTemplate TargetType="CheckBox">
<Grid Background="{TemplateBinding Background}"> <Grid Background="{TemplateBinding Background}" Margin="6,0,0,0">
<BulletDecorator Background="Transparent"> <BulletDecorator Background="Transparent">
<BulletDecorator.Bullet> <BulletDecorator.Bullet>
<Grid Width="16" Height="16"> <Grid Width="16" Height="16">
@ -403,14 +403,15 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style x:Key="ColorfulToggleSwitchStyle" TargetType="{x:Type CheckBox}"> <Style x:Key="ColorfulToggleSwitchStyle" TargetType="{x:Type CheckBox}">
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}"> <ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid x:Name="toggleSwitch"> <Grid x:Name="toggleSwitch" Margin="10,0,0,0">
<Border x:Name="Border" CornerRadius="10" <Border x:Name="Border" CornerRadius="11"
Background="#FFFFFFFF" Background="#FFFFFFFF"
Width="70" Height="25"> Width="50" Height="25">
<Border.Effect> <Border.Effect>
<DropShadowEffect ShadowDepth="0.5" Direction="0" Opacity="0.3" /> <DropShadowEffect ShadowDepth="0.5" Direction="0" Opacity="0.3" />
</Border.Effect> </Border.Effect>
@ -423,17 +424,12 @@
</Ellipse.Effect> </Ellipse.Effect>
</Ellipse> </Ellipse>
</Border> </Border>
<TextBlock x:Name="txtDisable" Text="Disable " VerticalAlignment="Center" FontWeight="DemiBold" HorizontalAlignment="Right" Foreground="White" FontSize="12" />
<TextBlock x:Name="txtEnable" Text=" Enable" VerticalAlignment="Center" FontWeight="DemiBold" Foreground="White" HorizontalAlignment="Left" FontSize="12" />
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="ToggleButton.IsChecked" Value="False"> <Trigger Property="ToggleButton.IsChecked" Value="False">
<Setter TargetName="Border" Property="Background" Value="#C2283B" /> <Setter TargetName="Border" Property="Background" Value="#C2283B" />
<Setter TargetName="Ellipse" Property="Margin" Value="2 2 2 1" /> <Setter TargetName="Ellipse" Property="Margin" Value="2 2 2 1" />
<Setter TargetName="txtDisable" Property="Opacity" Value="1.0" />
<Setter TargetName="txtEnable" Property="Opacity" Value="0.0" />
</Trigger> </Trigger>
<Trigger Property="ToggleButton.IsChecked" Value="True"> <Trigger Property="ToggleButton.IsChecked" Value="True">
@ -446,20 +442,10 @@
<ThicknessAnimation Storyboard.TargetName="Ellipse" <ThicknessAnimation Storyboard.TargetName="Ellipse"
Storyboard.TargetProperty="Margin" Storyboard.TargetProperty="Margin"
To="46 2 2 1" Duration="0:0:0.1" /> To="26 2 2 1" Duration="0:0:0.1" />
<DoubleAnimation Storyboard.TargetName="txtDisable"
Storyboard.TargetProperty="(TextBlock.Opacity)"
To="0.0" Duration="0:0:0:0.1" />
<DoubleAnimation Storyboard.TargetName="txtEnable"
Storyboard.TargetProperty="(TextBlock.Opacity)"
To="1.0" Duration="0:0:0:0.1" />
</Storyboard> </Storyboard>
</BeginStoryboard> </BeginStoryboard>
</Trigger.EnterActions> </Trigger.EnterActions>
<!-- Some out fading -->
<Trigger.ExitActions> <Trigger.ExitActions>
<BeginStoryboard> <BeginStoryboard>
<Storyboard> <Storyboard>
@ -470,18 +456,9 @@
<ThicknessAnimation Storyboard.TargetName="Ellipse" <ThicknessAnimation Storyboard.TargetName="Ellipse"
Storyboard.TargetProperty="Margin" Storyboard.TargetProperty="Margin"
To="2 2 2 1" Duration="0:0:0.1" /> To="2 2 2 1" Duration="0:0:0.1" />
<DoubleAnimation Storyboard.TargetName="txtDisable"
Storyboard.TargetProperty="(TextBlock.Opacity)"
To="1.0" Duration="0:0:0:0.1" />
<DoubleAnimation Storyboard.TargetName="txtEnable"
Storyboard.TargetProperty="(TextBlock.Opacity)"
To="0.0" Duration="0:0:0:0.1" />
</Storyboard> </Storyboard>
</BeginStoryboard> </BeginStoryboard>
</Trigger.ExitActions> </Trigger.ExitActions>
<Setter Property="Foreground" Value="{DynamicResource IdealForegroundColorBrush}" /> <Setter Property="Foreground" Value="{DynamicResource IdealForegroundColorBrush}" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
@ -490,6 +467,7 @@
</Setter> </Setter>
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
</Style> </Style>
<Style x:Key="labelfortweaks" TargetType="{x:Type Label}"> <Style x:Key="labelfortweaks" TargetType="{x:Type Label}">
<Setter Property="Foreground" Value="{MainForegroundColor}" /> <Setter Property="Foreground" Value="{MainForegroundColor}" />
<Setter Property="Background" Value="{MainBackgroundColor}" /> <Setter Property="Background" Value="{MainBackgroundColor}" />