Krypton-Suite / Standard-Toolkit

An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET 8 - 9
BSD 3-Clause "New" or "Revised" License
408 stars 62 forks source link

[Bug]: `OverrideFocus` Designer settings do not work or Prevent Ribbon MouseOver Highlighting #227

Closed sdreb3421 closed 3 years ago

sdreb3421 commented 3 years ago

There is currently no way to prevent ribbon groups from drawing a rounded white highlight when the mouse is over. This is barely noticeable in a light theme, but looks harsh in a dark theme, and interferes with button tracking/checked colors.

ribbongrouphighlight

PWagner1 commented 3 years ago

@sdreb3421

I'll have a look at it.

Smurf-IV commented 3 years ago

These are supposed to be overridden with the following image

But even setting them to the orange does not work (I was expecting Transparent to solve the issue!) The bug is in the usage of these colours (And the fact that they description to make them clear as to what they are supposed to be used for !)

Smurf-IV commented 3 years ago

So: Not an Enhancement, but a bug on OverrideFocus colour usage !

PWagner1 commented 3 years ago

So: Not an Enhancement, but a bug on OverrideFocus colour usage !

@Smurf-IV

Maybe a new bug report? Still, I need to fix the tab background colours for dark modes

PWagner1 commented 3 years ago

These are supposed to be overridden with the following image

But even setting them to the orange does not work (I was expecting Transparent to solve the issue!) The bug is in the usage of these colours (And the fact that they description to make them clear as to what they are supposed to be used for !)

@Smurf-IV

Is this the issue:

Color.Empty,                      // RibbonTabTracking3
                                                                      Color.Empty,                      // RibbonTabTracking4
                                                                      Color.Empty,                      // RibbonGroupBorder3
                                                                      Color.Empty,                      // RibbonGroupBorder4
Smurf-IV commented 3 years ago

Those are defaults, What I am showing above is an override, that is supposed to be applied, but they are not, so empty is being used, and then that reads the theme values only.

sdreb3421 commented 3 years ago

Do you think this will make it into the next release? Anything I can do to help?

PWagner1 commented 3 years ago

Found the possible colours, but are these supposed to be theme colours?

image

Smurf-IV commented 3 years ago

Yes many colours to perform the "Rounded feel" of the track highlight, But they are not being overridden when selected in the designer, so cannot be disabled in that way either !

PWagner1 commented 3 years ago

Yes many colours to perform the "Rounded feel" of the track highlight, But they are not being overridden when selected in the designer, so cannot be disabled in that way either !

Somewhere in the code, the SetStyle(ControlStyles.SupportsTransparentColor) is not being used

sdreb3421 commented 3 years ago

I could try to investigate. Any tips for where to start?

PWagner1 commented 3 years ago

I could try to investigate. Any tips for where to start?

The bug would likely be within the ribbon controls portion of the toolkit i.e. anything to do with the tab & palettes

sdreb3421 commented 3 years ago

I'll look into it. Do you know which of the listed colors above apply to the highlight? RibbonTabHighlight?

PWagner1 commented 3 years ago

I'll look into it. Do you know which of the listed colors above apply to the highlight? RibbonTabHighlight?

These are taken from the O2k7 Black theme

image

image

Hope they help

sdreb3421 commented 3 years ago

I've been digging around all day without success. I assumed there would be a MouseEnter event that could be tracked from method to method until the palette colors were applied, but it's a bit more complicated than that.

PWagner1 commented 3 years ago

I've been digging around all day without success. I assumed there would be a MouseEnter event that could be tracked from method to method until the palette colors were applied, but it's a bit more complicated than that.

Might be in the palette 'base' code

sdreb3421 commented 3 years ago

Found it! There is a PathGradientBrush named highlightBrush in the RenderMementos.cs file. The comments explain it is for drawing the rounded highlight at bottom center. The colors used look to be fixed.

It is referenced in a few classes such as RenderOffice365, but the code that modifies it is grayed out.

It would be nice to set these colors, but would be fine if there was just an option to turn it off, which might be less work.

PWagner1 commented 3 years ago

Can you give me the path? Maybe a user defined colour is needed?

sdreb3421 commented 3 years ago

Source/Krypton Components/Krypton.Toolkit/Rendering/RenderMementos.cs

PWagner1 commented 3 years ago

I'll check it out tomorrow

sdreb3421 commented 3 years ago

Nice, let me know if I can do anything else

PWagner1 commented 3 years ago

Do you know which lines they are?

sdreb3421 commented 3 years ago

487 in rendermementos

PWagner1 commented 3 years ago

@Smurf-IV Might need assistance prizing this apart

Smurf-IV commented 3 years ago

Sure.. Thanks for the research 👍 I'll have a bash this week at it

Smurf-IV commented 3 years ago

Getting there: Showing Lime override: ShowLimeOverride

Smurf-IV commented 3 years ago

New Designer area image

Smurf-IV commented 3 years ago

The Fix works in All Themes apart from Office2k7 and Sparkle, where it is diminished but still highlights with white!

Smurf-IV commented 3 years ago

To disable highlighting - Just change the Above designer elements to Transparent

sdreb3421 commented 3 years ago

Nice work!