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;
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;