X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c9cb79cbd693223d9079b91ad814bac39fa3a986..2a7367398e5f0378986522bc5686fb05a90dccda:/src/msw/menuitem.cpp diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index e2063200cd..f60a9e14d7 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -162,17 +162,21 @@ void wxMenuItem::Init() m_isRadioGroupStart = false; #if wxUSE_OWNER_DRAWN - // set default menu colors - #define SYS_COLOR(c) (wxSystemSettings::GetColour(wxSYS_COLOUR_##c)) - SetTextColour(SYS_COLOR(MENUTEXT)); - SetBackgroundColour(SYS_COLOR(MENU)); + // when the color is not valid, wxOwnerDraw takes the default ones. + // If we set the colors here and they are changed by the user during + // the execution, then the colors are not updated until the application + // is restarted and our menus look bad + SetTextColour(wxNullColour); + SetBackgroundColour(wxNullColour); - #undef SYS_COLOR - - // we don't want normal items be owner-drawn + // setting default colors switched ownerdraw on: switch it off again ResetOwnerDrawn(); + // switch ownerdraw back on if using a non default margin + if ( GetId() != wxID_SEPARATOR ) + SetMarginWidth(GetMarginWidth()); + // tell the owner drawing code to to show the accel string as well SetAccelString(m_text.AfterFirst(_T('\t'))); #endif // wxUSE_OWNER_DRAWN