Jump to content
Mark Williams

Ribbon Framework For Delphi UseDarkMode

Recommended Posts

After two long days of updating a huge project to incorporate the latest version of the Windows Ribbon Framework (for some reason it is no longer possible to link ribbon commands with TActions), I am left with one issue I cannot resolve. Previous versions of the framework had a UseDarkMode property which put the ribbon into/out of dark mode. THis has been removed from the latest version of the ribbon. Now it just remains dull grey even if you have dark mode enabled on your PC.

 

I have added the relevant procedure back in to UIRibbon.Pas:

procedure TUIRibbon.SetDarkMode(const Value: Boolean);
var
  PropertyStore: IPropertyStore;
  PropValue: TPropVariant;

begin
  if Assigned(FRibbon) and Supports(FRibbon, IPropertyStore, PropertyStore) then
  begin
    UIInitPropertyFromBoolean(UI_PKEY_DarkModeRibbon, Value, PropValue);
    PropertyStore.SetValue(TPropertyKey(UI_PKEY_DarkModeRibbon), PropValue);
    PropertyStore.Commit;
    FDarkMode := True;
  end;
end;

But calling this makes no difference.  All the other colouring functions have been retained and work, but not this one. Anyone have any idea how to get the ribbon into dark mode please?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×