Skip to content

Commit

Permalink
Improve the color picker hint.
Browse files Browse the repository at this point in the history
  • Loading branch information
VladiStep committed May 4, 2023
1 parent 8a21b56 commit c58f51a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion UndertaleModTool/Controls/ColorPicker.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</Border>
</Viewbox>

<local:TextBoxDark x:Name="ColorText" Grid.Column="1" MaxLength="9" ToolTip="A, B, G, R"/>
<local:TextBoxDark x:Name="ColorText" Grid.Column="1" MaxLength="9" ToolTip="#AABBGGRR"/>
<!-- "Text" binding is in the code of "ColorPicker" -->
</Grid>
</UserControl>
5 changes: 3 additions & 2 deletions UndertaleModTool/Controls/ColorPicker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public ColorPicker()
ColorText.SetBinding(TextBox.TextProperty, binding);

ColorText.MaxLength = HasAlpha ? 9 : 7;
ColorText.ToolTip = $"{(HasAlpha ? "A, " : "")}B, G, R";
ColorText.ToolTip = $"#{(HasAlpha ? "AA" : "")}BBGGRR";
ToolTipService.SetInitialShowDelay(ColorText, 250);
}

private static void OnHasAlphaChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
Expand All @@ -77,7 +78,7 @@ private static void OnHasAlphaChanged(DependencyObject dependencyObject, Depende
colorPicker.ColorText.SetBinding(TextBox.TextProperty, binding);

colorPicker.ColorText.MaxLength = hasAlpha ? 9 : 7;
colorPicker.ColorText.ToolTip = $"{(hasAlpha ? "A, " : "")}B, G, R";
colorPicker.ColorText.ToolTip = $"#{(hasAlpha ? "AA" : "")}BBGGRR";
}
}

Expand Down

0 comments on commit c58f51a

Please sign in to comment.