wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

ContextMenu style lacks drop shadow

Open chucker opened this issue 1 year ago • 4 comments

Describe the bug

The default style for <ContextMenu> doesn't seem to set a drop shadow (or any other kind of border). However, the style for subseqent submenus does.

To Reproduce

(I think this is clear from the screenshots.)

Expected behavior

The visual style should match other menus

Screenshots

Notice no drop shadow around the menu items:

image

Whereas submenus show one that seems almost too strong?

image

OS version

Windows 11 22H2 23506.1000

.NET version

Framework 4.7.2

WPF-UI NuGet version

2.0.3

Additional context

I skimmed the style files, and notice that

  • Menu.xaml sets a drop shadow
  • ContextMenu.xaml sets a property HasDropShadow to false (not sure why, and it seems to have no effect), and also doesn't set one either way

chucker avatar Jul 27 '23 14:07 chucker

With recent updates, a border was added to make sure the contextmenu. @chucker mind testing the latest preview (preview-10) to see if that resolves this issue?

niels9001 avatar Nov 23 '23 10:11 niels9001

to see if that resolves this issue?

Hmmm, as of 8afb0d9 or preview-11, it doesn't seem to. I'm using the Light theme:

    foreach (var uri in new[]
    {
        "pack://application:,,,/Wpf.Ui;component/Resources/Theme/Light.xaml",
        "pack://application:,,,/Wpf.Ui;component/Resources/Wpf.Ui.xaml"
    })
    {
        resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(uri) });
    }

…and applying UiContextMenu:

    Style = (Style)FindResource("UiContextMenu");

…and it looks like this:

image

chucker avatar Nov 28 '23 10:11 chucker

@chucker Yeah, the only change I'm seeing is that there is a very (subtle) border around the context menu. But agree, ideally this would show a dropshadow as well

niels9001 avatar Nov 28 '23 10:11 niels9001

Ah, you're right — the border is new. That is indeed better than before!

chucker avatar Nov 28 '23 10:11 chucker