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
Add new setting for theme selection #637
Conversation
Hey @Basewq, you might want to check how was implemented the theme into this project below, maybe we can do the same in stride3d. https://github.com/MahApps/MahApps.Metro/tree/develop/src/MahApps.Metro |
Thanks for looking into it.
|
Ping @0xAryan since you worked on the previous theme. If your time allows, it would be super helpful if you could have a quick look/evaluation of this. It doesn't have to be the final solution as a first step. Thanks! |
1 & 2. Well, I tried I believe things like corner radius, font sizes can potentially be part of the theme settings, it just means pushing more keys into the |
This does the job for the most part if I remember correctly, but there are some hardcoded colors for some borders and stuff that are in different places in the code (unfortunately I don't remember where). |
@Basewq OK perfect for 1/2, my point was actually to stick with About 3. I was mostly curious about which kind of changes were more complex than color, such as the round corners or the icons thing @0xAryan mentionned. Thanks for giving actual exemples. |
Thanks for the info @0xAryan. Yes, light themes will bring in some extra work which is why I'm trying to avoid it for now. Off the top of my head, maybe binding with a converter? |
@xen2 Yeah Now, it has been a while since I had a closer look to that, but that's what I remember. It is totally fine in my opinion to have to restart the GameStudio when changing the theme. |
First off, I'm going to 'fix' the settings background color from This is 'option 0' of the new color scheme. This is 'option 1' of the new color scheme, as given by @Tonedus Also, be aware I'm not overly fussed over the new color scheme, so it can be edited/adjusted/fixed over time. This screenshot is merely a helpful reference to see which brush key is affecting the most common items. |
i like the one that looks like it's using the same colors as visual studio. since people would use both side-by-side often, it makes sense to use the same colors. |
+1 for option 0 |
Thanks, I'll look into it. |
@tebjan Ok, as far as I'm aware the tooltip can't be changed here. |
@Basewq I wanted to quickly check with you about the Stride renaming. It might be good to freeze everything for a couple of days while I do the final changes and merge them. During that time, PR/new branch are better avoided to avoid unnecessary rebase work (automatic rebase don't work so well with so many file renaming & content change). If an existing branch (not ready to be merged yet) needs to be ported after the renaming, please rest assured it's possible (either by careful cherry-picking/merging, otherwise by applying the same renaming logic on the Thanks again and sorry for the trouble/inconvenience! |
@xen2 Thanks for the heads up. No, I don't have any other branches. I am happy to wait until you do the renaming, as I am still doing some touch ups, and I'm ok with handling the rebase on my own side. |
DarkSteel, | ||
|
||
// Light themes | ||
[Display("Light Steel Blue")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the light theme is not perfect/complete, maybe we could change display name to Light Steel Blue (Experimental)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I'm ok with that. Done and rebased on top of the latest (this was the only change, apologies if you didn't want me to rebase again).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for rebasing, it's helpful!
Looking good @Basewq |
…o be consistent with the Component properties panel
Perfect, right on time for the recording of new tutorials. |
I liked it! It's a nice color scheme @Basewq |
nice one! |
PR Details
Add ability to choose a new (hardcoded) theme (color scheme).
Current options are 'Expression Dark' (the current color scheme), and 'Dark Steel' (the color scheme that's work in progress for this draft).
NOTE: This does not remove the existing color scheme, and that will remain the default option for new users.
Description
Unfortunately with how the xaml code is architectured, it doesn't seem like we can change the (color) brush bindings from
StaticResource
toDynamicResource
.I believe this is a limitation in WPF with the usage of templates, where WPF must 'freeze' the brush/bindings inside a template, so they can't be changed (and the majority of Xenko's xaml code is placed inside templates).
Due to my lack of expertise in WPF, the only solution I've found is to inherit
ResourceDictionary
and get this newThemeResourceDictionary
to intercept and immediately change the xaml source path of the "dynamic" theme colors so that the app can be forced to read the correct theme file.And yes, there's a couple of static fields that are (seemingly) unavoidable due to how the resource source must be intercepted.
Second problem is because we're stuck with
StaticResource
bindings, the editor must be restarted for the new theme to appear.This pull request is specifically for color scheme changes. Things like rounded corners, larger icons, etc are out of scope of this pull request.
The new dark theme will probably be closer to Unity/Unreal/Blender, or even the old Xenko version (which is currently still featured in the github readme file!).
Note: I am not currently looking at implementing a light theme, mainly due to the possibility of this pull not being accepted because of crappy coding (and there's a possibility additional minor changes may be required to fix it in light mode). If the pull is accepted, it should be "easy" (famous last words) for someone to add a new theme.
Also if not accepted, someone can still view this commit and apply to their own fork and make their own changes, or find a much better way to achieve this.
Where the settings appear in the Editor:
The 'Dark Steel' theme will look like the following:
While the default theme is largely unchanged, a 'fix' has been made to change the brush used in the Settings sub-window in the properties section. The following is how the change will look (left = current, right = new)
The main "switch" for swapping the themes lies in the ThemeSelector.xaml (Note there are two files, one for the main color overrides, and the other for a third party control's theme).
The main color scheme data resides in the Overrides folder (eg. Overrides/DarkSteelTheme.xaml)
Motivation and Context
The current dark theme has a much stronger 'dark contrast' compared to other applications' dark themes, and the strong contrast can unpleasant to look at for extended periods of time (in my opinion). This version more subdued and should be easier on the eyes.
See Unreal, Unity, Blender, etc for examples as less harsher dark themes.
Types of changes
Checklist