Skip to content

Commit 0336474

Browse files
committed
fix light popup theme. fix hint opacity on password box
1 parent 42049be commit 0336474

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

MaterialDesignThemes.Wpf/TextFieldAssist.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,7 @@ private static void ApplyTextBoxViewMargin(Control textBox, Thickness margin)
148148
return;
149149
}
150150

151-
var scrollViewer = textBox.Template.FindName("PART_ContentHost", textBox) as ScrollViewer;
152-
if (scrollViewer == null)
153-
{
154-
return;
155-
}
156-
157-
var frameworkElement = scrollViewer.Content as FrameworkElement;
158-
159-
// remove nice new sytax until i get appveyor working
160-
// var frameworkElement = (textBox.Template.FindName("PART_ContentHost", textBox) as ScrollViewer)?.Content as FrameworkElement;
151+
var frameworkElement = (textBox.Template.FindName("PART_ContentHost", textBox) as ScrollViewer)?.Content as FrameworkElement;
161152
if (frameworkElement != null)
162153
{
163154
frameworkElement.Margin = margin;
@@ -200,13 +191,13 @@ private static void HintOpacityPropertyChangedCallback(
200191
DependencyObject dependencyObject,
201192
DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
202193
{
203-
var textBoxBase = dependencyObject as TextBoxBase;
204-
if (textBoxBase == null)
194+
var control = dependencyObject as Control; //could be a text box or password box
195+
if (control == null)
205196
{
206197
return;
207198
}
208199

209-
textBoxBase.Opacity = (double)dependencyPropertyChangedEventArgs.NewValue;
200+
control.Opacity = (double)dependencyPropertyChangedEventArgs.NewValue;
210201
}
211202

212203
private static void TextPropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)

MaterialDesignThemes.Wpf/Themes/Generic.xaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,15 +534,17 @@
534534
<local:Card Margin="22"
535535
Effect="{DynamicResource MaterialDesignShadowDepth5}"
536536
UniformCornerRadius="4"
537+
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
538+
TextElement.FontWeight="Medium"
539+
TextElement.FontSize="14"
540+
TextOptions.TextFormattingMode="Ideal"
541+
TextOptions.TextRenderingMode="Auto"
542+
Foreground="{DynamicResource MaterialDesignBody}"
537543
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
538544
IsTabStop="False"
539545
x:Name="Card"
540546
Opacity="0"
541547
RenderTransformOrigin=".5,.5"
542-
TextElement.FontWeight="Medium"
543-
TextElement.FontSize="14"
544-
TextOptions.TextFormattingMode="Ideal"
545-
TextOptions.TextRenderingMode="Auto"
546548
Content="{TemplateBinding DialogContent}"
547549
ContentTemplate="{TemplateBinding DialogContentTemplate}"
548550
ContentTemplateSelector="{TemplateBinding DialogContentTemplateSelector}"

0 commit comments

Comments
 (0)