Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected tooltip foreground #2128

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/NexusMods.App.UI/LeftMenu/Items/ApplyControlView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
Height="44"
x:Name="ApplyButton">
<ToolTip.Tip>
<TextBlock Text="{x:Static resources:Language.ApplyControlView_Apply_ToolTip}" />
<TextBlock Text="{x:Static resources:Language.ApplyControlView_Apply_ToolTip}" Foreground="White" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using a set of color aliases found in src/Themes/NexusMods.Themes.NexusFluentDark/Resources/Palette/Colors/ElementColors.axaml for the colors.
We want to avoid using hardcorded colors like "White" or "Red" to allow us to change them from the theme all throughout the app easily.

In this case the easiest way to get what we want is to just apply the "ForegroundStrong" style class to the TextBlock, which will in turn apply NeutralStrong as the foreground color.

Suggested change
<TextBlock Text="{x:Static resources:Language.ApplyControlView_Apply_ToolTip}" Foreground="White" />
<TextBlock Text="{x:Static resources:Language.ApplyControlView_Apply_ToolTip}" Classes="ForegroundStrong" />

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I tried this initially to no avail.

I'll have to look in to why that's happening, it's why I ended up settling for forcing it to white

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an alternative you can set it like this:

Suggested change
<TextBlock Text="{x:Static resources:Language.ApplyControlView_Apply_ToolTip}" Foreground="White" />
<TextBlock Text="{x:Static resources:Language.ApplyControlView_Apply_ToolTip}" Foreground="{StaticResource NutralStrong}" />

</ToolTip.Tip>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
Expand Down
Loading