ghost1372 / HandyControls

Contains some simple and commonly used WPF controls based on HandyControl
https://ghost1372.github.io/
MIT License
1.07k stars 102 forks source link

The color of TabControlInLine is unexpected #193

Closed moomiji closed 6 months ago

moomiji commented 1 year ago

Describe the bug

It's correct color when using syncWithSystem in Official version 3.4.0 as shown in the figure below: image

But the PrimaryBrush is not correct in HandyControls from 3.4.1 to 3.4.5 when setting UsingSystemTheme: image

Steps to reproduce the bug

setup:

ThemeManager.Current.UsingSystemTheme = true;

Also reproduce in HandyControlDemo image

Expected behavior

No response

Screenshots

No response

NuGet package version

HandyControls (Custom version) 3.4.5

IDE

Visual Studio 2022

Framework type

.Net Framework 4.8

Windows version

Windows 11 (22621)

Additional context

No response

ghost1372 commented 1 year ago

When you are using UsingSystemTheme, i think we are using os accent color! (I cant remember exactly) so check your os accent color if true, this is by design

moomiji commented 1 year ago

When you are using UsingSystemTheme, i think we are using os accent color! (I cant remember exactly) so check your os accent color if true, this is by design

Thank you for such a quick reply!

Yeah, the os accent color and the PrimaryBrush is right. This only happens on TabControlInLine, and other controls using PrimaryBrush don't use preset colors. image

I tried to go back to version 3.3.11, everything is ok. image

Is that reproduced in your HandyControlDemo?

ghost1372 commented 1 year ago

I am no longer use wpf i moved to winui 3, i think you can overwrite primarybrush (probably there is a accentcolor property if nox you can overwrite by key)

moomiji commented 1 year ago

Oh, I know what happan!

In TabControlBaseStyle.xaml, the BorderBrush switched from PrimaryBrush to TitleBrush. The commit is https://github.com/HandyOrg/HandyControl/commit/eb2779fa2a4d83c1425b60a92c50b3a10eecee69

And different from https://github.com/HandyOrg/HandyControl/blob/624545376fbadcf6f7a36f1ab863706359808fa6/src/Shared/HandyControl_Shared/Themes/Theme.cs#L236 .

HandyControls didn't deal with TitleBrush when using UsingSystemTheme in https://github.com/ghost1372/HandyControls/commit/cb9fc91982d62691bdbb6cbf417627ec6e64d598

ghost1372 commented 5 months ago

@moomiji sorry for so long delay. i fixed it in https://github.com/ghost1372/HandyControls/commit/f8bd3452cd4b357858d882b1d9d4d34d0765cd14 image