Skip to content

Refresh tool window theme when the IDE theme changes - #114

Open
Bazooper-blip wants to merge 1 commit into
integrated-application-development:masterfrom
Bazooper-blip:theme-change-refresh
Open

Refresh tool window theme when the IDE theme changes#114
Bazooper-blip wants to merge 1 commit into
integrated-application-development:masterfrom
Bazooper-blip:theme-change-refresh

Conversation

@Bazooper-blip

Copy link
Copy Markdown

Fixes #4.

DelphiLint applied the IDE theme to its windows only when they were created, and nothing listened for theme changes — so after switching the IDE theme, the DelphiLint tool window kept the old theme.

Changes, following the existing editor-notifier pattern:

  • DelphiLint.Context.pas: new IIDEThemeChangeHandler interface, plus AddThemeChangeNotifier/RemoveThemeChangeNotifier on IIDEServices under the theming services section.
  • DelphiLint.Handlers.pas: TThemeChangeHandler, a THandler that invokes a callback on theme change.
  • DelphiLint.IDEContext.pas: TToolsApiThemeNotifier bridges INTAIDEThemingServicesNotifier.ChangedTheme to the handler, registered via IOTAIDEThemingServices.AddNotifier.
  • DelphiLint.Plugin.pas: registers the notifier on plugin registration, removes it on deregistration, and re-applies the theme to the tool window when the theme changes.
  • DelphiLintTest.MockContext.pas: mock support for the new IIDEServices methods.

Testing: compiles on Delphi 13 and the DUnitX suite passes at the same rate as master. I'd appreciate a manual double-check of theme switching with the DelphiLint window open (docked and floating).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DelphiLint theme is not fully updated after changing theme

1 participant