[Settings]Change text color for disabled controls (#4837)

* change text color for disabled controls

* added custom textblock controls and updated FZ Xaml

* updated Image Resizer Page

* updated Shotcut Guid

* updated KBM Settings

* reverted unrealted changes

* reverted unrealted changes

* reverted unrealted changes

* reverted unrealted changes

* updated power launcher

* reverted unrealted changes

* Image Resizer: renoved spaces in file format hint text

* Image Resizer: restored file format header

Co-authored-by: Lavius Motileng <laviusntk>
This commit is contained in:
Nkateko
2020-07-17 11:01:46 -07:00
committed by GitHub
parent 13c2ce3f31
commit e8de6f0ace
20 changed files with 1204 additions and 707 deletions

View File

@@ -0,0 +1,28 @@
<UserControl
x:Class="Microsoft.PowerToys.Settings.UI.Controls.BodyTextBlock"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Grid>
<TextBlock x:Name="CustomTextBlock"
Style="{StaticResource BodyTextBlockStyle}"
Margin="{StaticResource SmallTopMargin}" >
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{Binding Tag, ElementName=CustomTextBlock}" Value="False">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=CustomTextBlock}" PropertyName="Foreground" Value="{ThemeResource SystemColorGrayTextBrush}" />
</Core:DataTriggerBehavior>
<Core:DataTriggerBehavior Binding="{Binding Tag, ElementName=CustomTextBlock}" Value="True">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=CustomTextBlock}" PropertyName="Foreground" Value="{ThemeResource SystemBaseHighColor}" />
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</TextBlock>
</Grid>
</UserControl>

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
namespace Microsoft.PowerToys.Settings.UI.Controls
{
public sealed partial class BodyTextBlock : UserControl
{
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register(
"Text",
typeof(string),
typeof(GroupTitleTextBlock),
null);
public string _text;
public string Text
{
get
{
return _text;
}
set
{
_text = value;
CustomTextBlock.Text = value;
SetValue(TextProperty, value);
}
}
public static readonly DependencyProperty IsActiveProperty =
DependencyProperty.Register(
"IsActive",
typeof(string),
typeof(GroupTitleTextBlock),
null);
private string _isActive = "False";
public string IsActive
{
get
{
return _isActive;
}
set
{
SetValue(IsActiveProperty, value);
_isActive = value;
CustomTextBlock.Tag = value;
}
}
private Windows.UI.Text.FontWeight _fontWeight;
public Windows.UI.Text.FontWeight FontWeight
{
get
{
return _fontWeight;
}
set
{
_fontWeight = value;
CustomTextBlock.FontWeight = value;
}
}
public BodyTextBlock()
{
this.InitializeComponent();
CustomTextBlock.Tag = "False";
}
}
}

View File

@@ -0,0 +1,29 @@
<UserControl
x:Class="Microsoft.PowerToys.Settings.UI.Controls.GroupTitleTextBlock"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Grid>
<TextBlock
x:Name="CustomTextBlock"
Style="{StaticResource SettingsGroupTitleStyle}"
Margin="{StaticResource MediumTopMargin}">
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{Binding Tag, ElementName=CustomTextBlock}" Value="False">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=CustomTextBlock}" PropertyName="Foreground" Value="{ThemeResource SystemColorGrayTextBrush}" />
</Core:DataTriggerBehavior>
<Core:DataTriggerBehavior Binding="{Binding Tag, ElementName=CustomTextBlock}" Value="True">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=CustomTextBlock}" PropertyName="Foreground" Value="{ThemeResource SystemBaseHighColor}" />
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</TextBlock>
</Grid>
</UserControl>

View File

@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
namespace Microsoft.PowerToys.Settings.UI.Controls
{
public sealed partial class GroupTitleTextBlock : UserControl
{
public string _text;
public string Text
{
get
{
return _text;
}
set
{
_text = value;
CustomTextBlock.Text = value;
}
}
public static readonly DependencyProperty IsActiveProperty =
DependencyProperty.Register(
"IsActive",
typeof(string),
typeof(GroupTitleTextBlock),
null);
private string _isActive = "False";
public string IsActive
{
get
{
return _isActive;
}
set
{
SetValue(IsActiveProperty, value.ToString());
_isActive = value.ToString();
CustomTextBlock.Tag = value.ToString();
}
}
public GroupTitleTextBlock()
{
this.InitializeComponent();
DataContext = this;
CustomTextBlock.Tag = "False";
}
}
}

View File

@@ -17,6 +17,38 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
{
public string Header { get; set; }
public static readonly DependencyProperty IsActiveProperty =
DependencyProperty.Register(
"Enabled",
typeof(string),
typeof(HotkeySettingsControl),
null);
private string _enabled = "False";
public string Enabled
{
get
{
return _enabled;
}
set
{
SetValue(IsActiveProperty, value);
_enabled = value;
if (value.ToString().ToLower() == "true")
{
HotkeyTextBox.IsEnabled = true;
}
else
{
HotkeyTextBox.IsEnabled = false;
}
}
}
public static readonly DependencyProperty HotkeySettingsProperty =
DependencyProperty.Register(
"HotkeySettings",