-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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>
- Loading branch information
Nkateko
committed
Jul 17, 2020
1 parent
13c2ce3
commit e8de6f0
Showing
20 changed files
with
1,207 additions
and
710 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/core/Microsoft.PowerToys.Settings.UI/Controls/BodyTextBlock.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
91 changes: 91 additions & 0 deletions
91
src/core/Microsoft.PowerToys.Settings.UI/Controls/BodyTextBlock.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/core/Microsoft.PowerToys.Settings.UI/Controls/GroupTitleTextBlock.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
70 changes: 70 additions & 0 deletions
70
src/core/Microsoft.PowerToys.Settings.UI/Controls/GroupTitleTextBlock.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.