Browse Source

* GUI improvement by Martin Friebe

michael 4 years ago
parent
commit
3fbcdefcc6
2 changed files with 78 additions and 1 deletions
  1. 46 1
      demo/webwidget/nativedesign/frmmain.lfm
  2. 32 0
      demo/webwidget/nativedesign/frmmain.pp

+ 46 - 1
demo/webwidget/nativedesign/frmmain.lfm

@@ -79,7 +79,7 @@ object MainForm: TMainForm
     Left = 0
     Height = 461
     Top = 36
-    Width = 698
+    Width = 643
     ActivePage = TSBrowser
     Align = alClient
     TabIndex = 0
@@ -135,6 +135,51 @@ object MainForm: TMainForm
       Caption = 'Inspector'
     end
   end
+  object Panel1: TPanel
+    Left = 648
+    Height = 461
+    Top = 36
+    Width = 50
+    Align = alRight
+    ClientHeight = 461
+    ClientWidth = 50
+    TabOrder = 3
+    OnResize = Panel1Resize
+    object Splitter2: TSplitter
+      Cursor = crVSplit
+      Left = 1
+      Height = 5
+      Top = 219
+      Width = 48
+      Align = alTop
+      ResizeAnchor = akTop
+    end
+    object PnlLog: TPanel
+      Left = 1
+      Height = 218
+      Top = 1
+      Width = 48
+      Align = alTop
+      TabOrder = 1
+    end
+    object PnlBLog: TPanel
+      Left = 1
+      Height = 236
+      Top = 224
+      Width = 48
+      Align = alClient
+      TabOrder = 2
+    end
+  end
+  object Splitter1: TSplitter
+    Left = 643
+    Height = 461
+    Top = 36
+    Width = 5
+    Align = alRight
+    MinSize = 50
+    ResizeAnchor = akRight
+  end
   object ILWidgets: TImageList
     Height = 32
     Width = 32

+ 32 - 0
demo/webwidget/nativedesign/frmmain.pp

@@ -27,10 +27,15 @@ type
     ILWidgets: TImageList;
     BLog: TMemo;
     MLog: TMemo;
+    Panel1: TPanel;
+    PnlLog: TPanel;
+    PnlBLog: TPanel;
     PCDesigner: TPageControl;
     Project: TLabel;
     PBottom: TPanel;
     BrowserLog: TTabSheet;
+    Splitter1: TSplitter;
+    Splitter2: TSplitter;
     TBExternalGo: TToolButton;
     TSInspector: TTabSheet;
     TSBrowser: TTabSheet;
@@ -58,6 +63,7 @@ type
     procedure DEProjectEditingDone(Sender: TObject);
     procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
     procedure FormCreate(Sender: TObject);
+    procedure Panel1Resize(Sender: TObject);
   private
     FChromiumLogMsg: String;
     FClientID : Int64; // Just one for now
@@ -192,6 +198,32 @@ begin
   RegisterWidgets;
 end;
 
+procedure TMainForm.Panel1Resize(Sender: TObject);
+begin
+  //if not Visible then
+  //  exit;
+  if Width = 0 then begin
+    if MLog.Parent = PnlLog then begin
+      MLog.Parent := TSLog;
+      TSLog.TabVisible := True;
+    end;
+    if BLog.Parent = PnlBLog then begin
+      BLog.Parent := BrowserLog;
+      BrowserLog.TabVisible := True;
+    end;
+  end
+  else begin
+    if MLog.Parent = TSLog then begin
+      MLog.Parent := PnlLog;
+      TSLog.TabVisible := False;
+    end;
+    if BLog.Parent = BrowserLog then begin
+      BLog.Parent := PnlBLog;
+      BrowserLog.TabVisible := False;
+    end;
+  end;
+end;
+
 {$IFDEF WINDOWS}
 procedure TMainForm.WMEnterMenuLoop(var aMessage: TMessage);