Skip to content

Commit

Permalink
feat: #3209 #3328 add win10 and fluent TextBox styles
Browse files Browse the repository at this point in the history
- Add new attached property ControlsHelper.DisabledBorderBrush
- Add new TextBox style values
  - TextControlBorderThemeThickness
  - TextControlThemePadding
  - TextControlBorderThemeThicknessFocused
  - TextControlPlaceholderMargin
- Add new Win10 style: MahApps.Styles.TextBox.Win10
- Add new Fluent style: MahApps.Styles.TextBox.Fluent
- Add new brushes:
  - MahApps.Brushes.TextControl.Background
  - MahApps.Brushes.TextControl.BackgroundPointerOver
  - MahApps.Brushes.TextControl.BackgroundFocused
  - MahApps.Brushes.TextControl.BackgroundDisabled
  - MahApps.Brushes.TextControl.BorderBrush
  - MahApps.Brushes.TextControl.BorderBrushPointerOver
  - MahApps.Brushes.TextControl.BorderBrushFocused
  - MahApps.Brushes.TextControl.BorderBrushDisabled
  - MahApps.Brushes.TextControl.Foreground
  - MahApps.Brushes.TextControl.ForegroundPointerOver
  - MahApps.Brushes.TextControl.ForegroundFocused
  - MahApps.Brushes.TextControl.ForegroundDisabled
  - MahApps.Brushes.TextControl.PlaceholderForeground
  - MahApps.Brushes.TextControl.PlaceholderForegroundPointerOver
  - MahApps.Brushes.TextControl.PlaceholderForegroundFocused
  - MahApps.Brushes.TextControl.PlaceholderForegroundDisabled
  - MahApps.Brushes.TextControl.HeaderForeground
  - MahApps.Brushes.TextControl.HeaderForegroundDisabled
  - MahApps.Brushes.TextControl.SelectionHighlightColor
  - MahApps.Brushes.TextControl.ButtonBackground
  - MahApps.Brushes.TextControl.ButtonBackgroundPointerOver
  - MahApps.Brushes.TextControl.ButtonBackgroundPressed
  - MahApps.Brushes.TextControl.ButtonBorderBrush
  - MahApps.Brushes.TextControl.ButtonBorderBrushPointerOver
  - MahApps.Brushes.TextControl.ButtonBorderBrushPressed
  - MahApps.Brushes.TextControl.ButtonForeground
  - MahApps.Brushes.TextControl.ButtonForegroundPointerOver
  - MahApps.Brushes.TextControl.ButtonForegroundPressed

BREAKING CHANGE: change background for dark theme

Change the dark theme background from #FF252525 to #FF141414.
  • Loading branch information
punker76 committed Jan 13, 2023
1 parent aabfdab commit 3c95b68
Show file tree
Hide file tree
Showing 4 changed files with 370 additions and 15 deletions.
37 changes: 37 additions & 0 deletions src/MahApps.Metro/Controls/Helper/ControlsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,43 @@ public static void SetMouseOverBorderBrush(DependencyObject obj, Brush value)
obj.SetValue(MouseOverBorderBrushProperty, value);
}

public static readonly DependencyProperty DisabledBorderBrushProperty
= DependencyProperty.RegisterAttached(
"DisabledBorderBrush",
typeof(Brush),
typeof(ControlsHelper),
new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits));

/// <summary>
/// Gets the brush used to draw the disabled border brush.
/// </summary>
[Category(AppName.MahApps)]
[AttachedPropertyBrowsableForType(typeof(TextBox))]
[AttachedPropertyBrowsableForType(typeof(CheckBox))]
[AttachedPropertyBrowsableForType(typeof(RadioButton))]
[AttachedPropertyBrowsableForType(typeof(DatePicker))]
[AttachedPropertyBrowsableForType(typeof(ComboBox))]
[AttachedPropertyBrowsableForType(typeof(Tile))]
public static Brush GetDisabledBorderBrush(DependencyObject obj)
{
return (Brush)obj.GetValue(DisabledBorderBrushProperty);
}

/// <summary>
/// Sets the brush used to draw the disabled border brush.
/// </summary>
[Category(AppName.MahApps)]
[AttachedPropertyBrowsableForType(typeof(TextBox))]
[AttachedPropertyBrowsableForType(typeof(CheckBox))]
[AttachedPropertyBrowsableForType(typeof(RadioButton))]
[AttachedPropertyBrowsableForType(typeof(DatePicker))]
[AttachedPropertyBrowsableForType(typeof(ComboBox))]
[AttachedPropertyBrowsableForType(typeof(Tile))]
public static void SetDisabledBorderBrush(DependencyObject obj, Brush value)
{
obj.SetValue(DisabledBorderBrushProperty, value);
}

/// <summary>
/// DependencyProperty for <see cref="CornerRadius" /> property.
/// </summary>
Expand Down
Loading

0 comments on commit 3c95b68

Please sign in to comment.