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

Theme selection in option menu #2088

Merged
merged 6 commits into from
May 8, 2024
Merged

Theme selection in option menu #2088

merged 6 commits into from
May 8, 2024

Conversation

Tsht
Copy link
Contributor

@Tsht Tsht commented May 5, 2024

  • Add a translatable menu in Option / Interface called Interface Theme
  • Themes containing unparsable lines are now considered invalid (see Fail KeyValueTreeLoader loading if a line is not parsed correctly SeriousProton#244)
  • Only valid theme are listed
  • Use default.theme.txt as fallback in case of issue with a theme
  • Use first found font as fallback font (not to crash)
  • If no (valid) theme found, then EmptyEpsilon exits with an explicit error message.

Every theme found in gui, *.theme.txt, are loaded when entering option screen. This is primarily to test validation.

src/gui/gui2_canvas.cpp Outdated Show resolved Hide resolved
src/main.cpp Show resolved Hide resolved
@daid daid merged commit 99e66ce into daid:master May 8, 2024
7 checks passed
@muerteFR
Copy link
Contributor

@Tsht By theme, do you mean just changing the font in the future ?

@muerteFR
Copy link
Contributor

And, the translation tag was not added to be able to translate the word "Default". Can you add it?

@Tsht
Copy link
Contributor Author

Tsht commented May 12, 2024

@muerteFR Hello. Theme is a mechanism to modify some elements for the UI, look for instance in : https://github.com/daid/EmptyEpsilon/blob/master/resources/gui/default.theme.txt
You can copy this file to another file and edit, or edit it directly.

I don't know if it makes sense to translate "default" as it's just the file name... If you create "other.theme.txt", then you will have the choice to also select "other".
Themes really don't have specific names, so I showed them in UI by this convention.
Translating this would be confusing I think ?

@muerteFR
Copy link
Contributor

muerteFR commented May 12, 2024

Thank you for these explanations. :-)
For the translation, I was just talking about translating the word. “Default” is "Défaut" in French or even “Par défaut”. Not necessarily to translate the others who will arrive later and whose names will surely be proper nouns. This is weird, it's the only untranslated word in the options.
default

@Tsht
Copy link
Contributor Author

Tsht commented May 13, 2024

Maybe someting like "default (Default theme)" translated : "default (thème par défaut)" ?
It's the default provided theme, but also a "fallback" theme, and should always be named : default.theme.txt

@muerteFR
Copy link
Contributor

Yes it would be good like that.

@daid
Copy link
Owner

daid commented May 13, 2024

problem is, this name comes directly from the filename, so that isn't translation aware. Not sure how to fix that yet.

@muerteFR
Copy link
Contributor

ok

@daid
Copy link
Owner

daid commented May 13, 2024

But, if there is only 1 theme, I made this selector hidden, so per default you won't see it right now. Gives us some time to test this and think about how to translate it before it's default exposed.

@aBlueShadow
Copy link
Contributor

aBlueShadow commented May 13, 2024

This is weird, it's the only untranslated word in the options.

Actually, not quite. The language indicator is not translated either. Basically the same thing, in that it is just part of the filename(s). I think that works because many people are used to those indicator, so they serve as some kind of proper name. Also it makes it easier to change the language back, if you don't know what a language is called in another one.
One easy fix for the default theme, later when more themes are added, might be to make make it proper-name-ish, like "EE-default". That works for desktop themes, so I think it can work for EE as well.

Tsht added a commit to Tsht/EmptyEpsilon that referenced this pull request Oct 12, 2024
* Theme selection

* Remove dependency from canvas to preference manager, tradoff by static member

* Forgotten occurrence in main

* Change font when changing theme
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

Successfully merging this pull request may close these issues.

4 participants