wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

Add new theme

Open Philigane opened this issue 3 years ago • 6 comments

Is your feature request related to a problem? Please describe

I wanna know how to add new theme. The ThemeType has only light/dark

Describe the solution you'd like

A way to add new theme

Describe alternatives you've considered

No response

Additional context

No response

Philigane avatar Feb 22 '23 23:02 Philigane

There is a dictionary to map colors For example, the background(bursh color) color of window is WindowBackground. When the theme is black, the value of WindowBackground is (ff 000000). When the theme is light, the value of WindowBackground is (ff f5f5f5)

The color of all elements such as controls should be semantic. Then the theme determines what color the corresponding semantic color should be.

You can copy the dictionary of the black or light theme in the source code and change the color of the brush to your favorite color

VleaStwo avatar Mar 02 '23 06:03 VleaStwo

Thank you for your answer

I already copied Black theme and personalized some colors. But how can i apply the theme ? I've tried to replace the URI in the current theme but the app is looking weird after that

Philigane avatar Mar 02 '23 07:03 Philigane

You need to show me the screenshots of your key source code and effects.

I suggest you download Src and view its demo.

VleaStwo avatar Mar 02 '23 08:03 VleaStwo

i've tried something like that. Atm i can't reproduce the exact pattern because i undo it days ago :(

Knwowing that theme is a copy from dark theme but colors in it are changed. With that code nothing happens. image

Philigane avatar Mar 02 '23 08:03 Philigane

I use wpfui to use its color matching style, so I didn't adjust its color module, but I set up a similar function to adjust the color in order to consider the vision problems of some of my users I wrote you a demo This demo controls the color by writing a class (I am not very familiar with xaml. The correct way is to make xaml instead of cs) This demo realizes color matching switching by clicking the button Here I only make a window background color, and the other models are the same There are three things you need to do:

  1. Create a class to manage colors (MyColorStyle. cs here)
  2. Add this resource in the app (if you add it in the window layer, you will not be able to achieve cross-window control)
  3. Create a setting page for users to click the button to switch styles

After you understand this demo, you can create your own color style in wpfui (but I doubt you need to modify the source code of wpfui) image image

WpfApp3.zip

VleaStwo avatar Mar 02 '23 10:03 VleaStwo

There are currently no plans to allow custom themes. I am not in favor of freedom of choice in terms of colors and I believe that applications should be as similar as possible to maintain the consistency of the OS's appearance.

pomianowski avatar Mar 02 '23 15:03 pomianowski