Added separator near nav bar

This commit is contained in:
Jaex 2020-11-30 04:21:53 +03:00
parent 55ec155058
commit 4544531ba6
3 changed files with 42 additions and 3 deletions

View file

@ -30,11 +30,14 @@ private void InitializeComponent()
{ {
this.tvMain = new System.Windows.Forms.TreeView(); this.tvMain = new System.Windows.Forms.TreeView();
this.scMain = new System.Windows.Forms.SplitContainer(); this.scMain = new System.Windows.Forms.SplitContainer();
this.pSeparator = new System.Windows.Forms.Panel();
this.tcMain = new ShareX.HelpersLib.TablessControl(); this.tcMain = new ShareX.HelpersLib.TablessControl();
this.pLeft = new System.Windows.Forms.Panel();
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
this.scMain.Panel1.SuspendLayout(); this.scMain.Panel1.SuspendLayout();
this.scMain.Panel2.SuspendLayout(); this.scMain.Panel2.SuspendLayout();
this.scMain.SuspendLayout(); this.scMain.SuspendLayout();
this.pLeft.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// tvMain // tvMain
@ -65,8 +68,8 @@ private void InitializeComponent()
// //
// scMain.Panel1 // scMain.Panel1
// //
this.scMain.Panel1.Controls.Add(this.tvMain); this.scMain.Panel1.Controls.Add(this.pSeparator);
this.scMain.Panel1.Padding = new System.Windows.Forms.Padding(8); this.scMain.Panel1.Controls.Add(this.pLeft);
// //
// scMain.Panel2 // scMain.Panel2
// //
@ -76,6 +79,16 @@ private void InitializeComponent()
this.scMain.SplitterWidth = 3; this.scMain.SplitterWidth = 3;
this.scMain.TabIndex = 0; this.scMain.TabIndex = 0;
// //
// pSeparator
//
this.pSeparator.BackColor = System.Drawing.SystemColors.ControlDark;
this.pSeparator.Dock = System.Windows.Forms.DockStyle.Right;
this.pSeparator.Location = new System.Drawing.Point(236, 0);
this.pSeparator.MaximumSize = new System.Drawing.Size(1, 0);
this.pSeparator.Name = "pSeparator";
this.pSeparator.Size = new System.Drawing.Size(1, 500);
this.pSeparator.TabIndex = 1;
//
// tcMain // tcMain
// //
this.tcMain.Dock = System.Windows.Forms.DockStyle.Fill; this.tcMain.Dock = System.Windows.Forms.DockStyle.Fill;
@ -86,6 +99,16 @@ private void InitializeComponent()
this.tcMain.TabIndex = 0; this.tcMain.TabIndex = 0;
this.tcMain.Visible = false; this.tcMain.Visible = false;
// //
// pLeft
//
this.pLeft.Controls.Add(this.tvMain);
this.pLeft.Dock = System.Windows.Forms.DockStyle.Fill;
this.pLeft.Location = new System.Drawing.Point(0, 0);
this.pLeft.Name = "pLeft";
this.pLeft.Padding = new System.Windows.Forms.Padding(8);
this.pLeft.Size = new System.Drawing.Size(237, 500);
this.pLeft.TabIndex = 2;
//
// TabToTreeView // TabToTreeView
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
@ -98,6 +121,7 @@ private void InitializeComponent()
this.scMain.Panel2.ResumeLayout(false); this.scMain.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit();
this.scMain.ResumeLayout(false); this.scMain.ResumeLayout(false);
this.pLeft.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -107,5 +131,7 @@ private void InitializeComponent()
private System.Windows.Forms.TreeView tvMain; private System.Windows.Forms.TreeView tvMain;
private System.Windows.Forms.SplitContainer scMain; private System.Windows.Forms.SplitContainer scMain;
private TablessControl tcMain; private TablessControl tcMain;
private System.Windows.Forms.Panel pSeparator;
private System.Windows.Forms.Panel pLeft;
} }
} }

View file

@ -102,11 +102,23 @@ public Color LeftPanelBackColor
} }
set set
{ {
scMain.Panel1.BackColor = value; pLeft.BackColor = value;
tvMain.BackColor = value; tvMain.BackColor = value;
} }
} }
public Color SeparatorColor
{
get
{
return pSeparator.BackColor;
}
set
{
pSeparator.BackColor = value;
}
}
[DefaultValue(false)] [DefaultValue(false)]
public bool AutoSelectChild { get; set; } public bool AutoSelectChild { get; set; }

View file

@ -197,6 +197,7 @@ private static void ApplyCustomThemeToControl(Control control)
{ {
case TabToTreeView tttv: case TabToTreeView tttv:
tttv.LeftPanelBackColor = Theme.DarkBackgroundColor; tttv.LeftPanelBackColor = Theme.DarkBackgroundColor;
tttv.SeparatorColor = Theme.SeparatorDarkColor;
break; break;
} }
} }