dummzeuch 1707 Posted Saturday at 04:54 PM I am trying to fix the remaining glitches in GExperts to follow the IDE's dark/light mode setting (which was implemented by @Achim Kalwa, Thanks a lot Achim!). One thing that does not work is dark mode for a TMainMenu. The menu bar itself is not themed, but its sub menus are themed as expected. Is that a bug in the VCL? A problem that only happens in IDE plugins? Or PEBKAC ? Share this post Link to post
Dave Nottage 632 Posted Saturday at 08:58 PM 4 hours ago, dummzeuch said: Is that a bug in the VCL? It's probably because TMainMenu is not themed in the IDE. As you probably know, the IDE itself uses TActionMainMenuBar, which is themed. Curious that submenu items are themed, though. Share this post Link to post
Uwe Raabe 2197 Posted Saturday at 10:38 PM Even a TMainMenu is drawn according to the current VCL style. A simple test confirms that. So, what class type has the form and is that class registered to the ThemingServices? Share this post Link to post
dummzeuch 1707 Posted yesterday at 09:09 AM (edited) 10 hours ago, Uwe Raabe said: Even a TMainMenu is drawn according to the current VCL style. A simple test confirms that. So, what class type has the form and is that class registered to the ThemingServices? The form is a TfmClassBrowser, which descends from TfmBaseForm which in turn descends from TForm. It calls this function passing Self as parameter: function GxOtaInitTheming(AForm: TCustomForm): Boolean; var LService : IOTAIDEThemingServices; begin Result := False; LService := GxOtaGetIDEThemingServices; if Assigned(AForm) and Assigned(LService) and (LService.IDEThemingEnabled) then begin LService.RegisterFormClass(TCustomFormClass(AForm.ClassType)); LService.ApplyTheme(AForm); Result := True; end; end; Which is what I think you mean by "registered to the ThemingService". I also tried explicitly calling IOTAIDEThemingServices.ApplyTheme for the TMainMenu, but it didn't have any effect. Edited yesterday at 09:13 AM by dummzeuch Share this post Link to post