mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 09:59:09 +02:00
Cocoa: improve compatibility of Overlay Style on earlier macOS versions
This commit is contained in:
parent
daf3b79a08
commit
1246669bfc
@ -617,12 +617,8 @@ begin
|
|||||||
_manager.availScrollBar( self.fhscroll, horzAvailable );
|
_manager.availScrollBar( self.fhscroll, horzAvailable );
|
||||||
_manager.availScrollBar( self.fvscroll, vertAvailabl );
|
_manager.availScrollBar( self.fvscroll, vertAvailabl );
|
||||||
|
|
||||||
if self.lclGetTarget is TWinControl then begin
|
if self.lclGetTarget is TWinControl then
|
||||||
/// TWinControl(self.lclGetTarget).InvalidateClientRectCache(True);
|
|
||||||
/// TWinControl(self.lclGetTarget).InvalidatePreferredSize;
|
|
||||||
TWinControl(self.lclGetTarget).AdjustSize;
|
TWinControl(self.lclGetTarget).AdjustSize;
|
||||||
/// TWinControl(self.lclGetTarget).Invalidate;
|
|
||||||
end;
|
|
||||||
|
|
||||||
_manager.updateLayout;
|
_manager.updateLayout;
|
||||||
|
|
||||||
@ -1303,6 +1299,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
self.currentAlpha:= self.currentAlpha + self.stepAlpha;
|
self.currentAlpha:= self.currentAlpha + self.stepAlpha;
|
||||||
|
if self.currentAlpha < 0.01 then
|
||||||
|
self.currentAlpha:= 0;
|
||||||
|
|
||||||
if self.stepAlpha > 0 then begin
|
if self.stepAlpha > 0 then begin
|
||||||
if self.currentAlpha >= self.maxAlpha then begin
|
if self.currentAlpha >= self.maxAlpha then begin
|
||||||
self.currentAlpha:= self.maxAlpha;
|
self.currentAlpha:= self.maxAlpha;
|
||||||
@ -1616,6 +1615,13 @@ var
|
|||||||
begin
|
begin
|
||||||
effect:= TCocoaScrollBarEffectOverlay(scrollBar.effect);
|
effect:= TCocoaScrollBarEffectOverlay(scrollBar.effect);
|
||||||
|
|
||||||
|
scroller.setAlphaValue( effect.currentAlpha );
|
||||||
|
if effect.currentAlpha = 0 then begin
|
||||||
|
scroller.setHidden( true );
|
||||||
|
effect.expandedSize:= 0;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
radius:= 4;
|
radius:= 4;
|
||||||
rect:= scrollBar.rectForPart(NSScrollerKnob);
|
rect:= scrollBar.rectForPart(NSScrollerKnob);
|
||||||
rect:= NSInsetRect(rect, 1, 1);
|
rect:= NSInsetRect(rect, 1, 1);
|
||||||
@ -1632,14 +1638,8 @@ begin
|
|||||||
NSColor.controlTextColor.set_;
|
NSColor.controlTextColor.set_;
|
||||||
path.fill;
|
path.fill;
|
||||||
|
|
||||||
scroller.setAlphaValue( effect.currentAlpha );
|
if scroller.knobProportion < 1 then
|
||||||
if effect.currentAlpha = 0 then begin
|
scroller.setHidden( false );
|
||||||
scroller.setHidden( true );
|
|
||||||
effect.expandedSize:= 0;
|
|
||||||
end else begin
|
|
||||||
if scroller.knobProportion < 1 then
|
|
||||||
scroller.setHidden( false );
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCocoaScrollStyleManagerOverlay.onDrawKnobSlot(scroller: NSScroller;
|
function TCocoaScrollStyleManagerOverlay.onDrawKnobSlot(scroller: NSScroller;
|
||||||
|
Loading…
Reference in New Issue
Block a user