JAM-Software / RibbonFramework

Delphi wrapper and standalone Designer for the Windows Ribbon Framework
Other
202 stars 57 forks source link

Ribbon Minimized Before First Paint #110

Closed richardzarr closed 5 years ago

richardzarr commented 5 years ago

In UIRibbon.pas, the TUIRibbon.SetMinimized always set the ribbon to minimized when called before the first PAINT message is received. Code should have a VALUE qualifier as shown below to prevent this:

procedure TUIRibbon.SetMinimized(const Value: Boolean); var PropertyStore: IPropertyStore; PropValue: TPropVariant; begin if Assigned(FRibbon) and Supports(FRibbon, IPropertyStore, PropertyStore) and (TUIRibbonState.PaintInitialized in fRibbonState) then begin UIInitPropertyFromBoolean(UI_PKEY_Minimized, Value, PropValue); PropertyStore.SetValue(TPropertyKey(UI_PKEY_Minimized), PropValue); PropertyStore.Commit; end else if Value then // <-- add this line to prevent the minimized pending flag to be added to the state when Value is false and the first WMPaint has not been called fRibbonState := fRibbonState + [TUIRibbonState.MinimizePending]; //Ribbon hasn't received a paint message yet -> Postpone until WMPaint is called. end;

SaschaSchaefer commented 5 years ago

Code should have a VALUE qualifier as shown below to prevent this

That's correct.. I must have forgotten to add the check when I added this. Thanks!