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

Bring back theme.HyperlinkColor #3867

Closed
2 tasks done
dweymouth opened this issue May 5, 2023 · 7 comments
Closed
2 tasks done

Bring back theme.HyperlinkColor #3867

dweymouth opened this issue May 5, 2023 · 7 comments

Comments

@dweymouth
Copy link
Contributor

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

Currently hyperlinks get their color from theme.PrimaryColor, but there used to be a theme.HyperlinkColor. I propose bringing back HyperlinkColor, to allow more customization while keeping in line with Fyne's theme API design philosophy.

In my app's case, since I have a lot of hyperlinks (most text in my app is links), I needed to darken the color of hyperlinks in the app's light theme to have appropriate text contrast. However, this makes the color of other PrimaryColor themed things, especially HighImportance buttons, a little jarringly dark.

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

Bring back theme.HyperlinkColor as a standard color name in the theme API

@dweymouth
Copy link
Contributor Author

Screen Shot 2023-05-12 at 10 54 51 AM

Here's a screenshot from Supersonic in the light mode to better illustrate. The hyperlink text and the HighImportance button (used as a segmented control) are the same color. Note that the button looks darker, almost jarringly dark, compared to the text color which looks appropriate.

@andydotxyz
Copy link
Member

This was deprecated back in 1.4.0 around 3 years ago.
We could indeed do as described above but I would be keen to get others thoughts on this topic...

@andydotxyz
Copy link
Member

Curious about thoughts from @Jacalz @Bluebugs or @changkun

@Jacalz
Copy link
Member

Jacalz commented Jun 13, 2023

I don't really have anything against adding it back. The explanation above about text being smaller and needing different contrast makes sense to me.

@changkun
Copy link
Member

I am actually interested in why hyperlink color not being customizable but have to define a separate const. Did I miss anything?

@andydotxyz
Copy link
Member

With the old theme API adding a new item was a breaking change and when we moved to the new API we removed some for consistency.

Which means that now it is always primary and to add the customisation back in we need to introduce a new colour name that mirrors the old theme function. (Probably with the same helper at the package level but this time it won't be a breaking change to add it as v2 theme api is extensible).

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jul 19, 2023
@andydotxyz
Copy link
Member

Fixed on develop for 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants