From a28d45f3a9979011d6a02546ac0619fab0a13b82 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 24 Aug 2010 15:16:45 +0200 Subject: splitter: When double-clicking splitter, it now snaps closed if AutoSnap is set. --- src/gui/fpg_splitter.pas | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/gui/fpg_splitter.pas b/src/gui/fpg_splitter.pas index 6094656b..8a5aa3d3 100644 --- a/src/gui/fpg_splitter.pas +++ b/src/gui/fpg_splitter.pas @@ -61,6 +61,7 @@ type procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override; procedure HandleMouseEnter; override; procedure HandleMouseExit; override; + procedure HandleDoubleClick(x, y: integer; button: word; shiftstate: TShiftState); override; procedure HandlePaint; override; procedure StopSizing; dynamic; Procedure DrawGrabBar(ARect: TfpgRect); virtual; @@ -304,6 +305,25 @@ begin Repaint; end; +procedure TfpgSplitter.HandleDoubleClick(x, y: integer; button: word; + shiftstate: TShiftState); +begin + inherited HandleDoubleClick(x, y, button, shiftstate); + if FAutoSnap then + begin + if FNewSize = 0 then + begin + FNewSize := FMinSize+1; + DoCanResize(FNewSize); + end + else + begin + FNewSize := 0; + DoCanResize(FNewSize); + end; + end; +end; + procedure TfpgSplitter.HandlePaint; var lRect: TfpgRect; -- cgit v1.2.3-70-g09d2