mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Added AutoSelectChild option to TabToTreeView control
This commit is contained in:
parent
9b02aadf8d
commit
1331822677
4 changed files with 7813 additions and 1354 deletions
|
@ -94,6 +94,9 @@ public ImageList ImageList
|
|||
}
|
||||
}
|
||||
|
||||
[DefaultValue(false)]
|
||||
public bool AutoSelectChild { get; set; }
|
||||
|
||||
public TabToTreeView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
@ -140,8 +143,16 @@ private void tvMain_BeforeCollapse(object sender, TreeViewCancelEventArgs e)
|
|||
private void tvMain_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
TabPage tabPage = e.Node.Tag as TabPage;
|
||||
|
||||
if (AutoSelectChild && tabPage.Controls.Count == 1 && tabPage.Controls[0] is TabControl)
|
||||
{
|
||||
SelectChild();
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectTab(tabPage);
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectTab(TabPage tabPage)
|
||||
{
|
||||
|
|
|
@ -4854,13 +4854,13 @@ private void InitializeComponent()
|
|||
//
|
||||
// tttvMain
|
||||
//
|
||||
this.tttvMain.AutoSelectChild = true;
|
||||
resources.ApplyResources(this.tttvMain, "tttvMain");
|
||||
this.tttvMain.ImageList = null;
|
||||
this.tttvMain.MainTabControl = null;
|
||||
this.tttvMain.Name = "tttvMain";
|
||||
this.tttvMain.TreeViewFont = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||
this.tttvMain.TreeViewSize = 210;
|
||||
this.tttvMain.TabChanged += new ShareX.HelpersLib.TabToTreeView.TabChangedEventHandler(this.tttvMain_TabChanged);
|
||||
//
|
||||
// actRapidShareAccountType
|
||||
//
|
||||
|
|
|
@ -140,14 +140,6 @@ private void AddIconToTabs()
|
|||
}
|
||||
}
|
||||
|
||||
private void tttvMain_TabChanged(TabPage tabPage)
|
||||
{
|
||||
if (tabPage == tpImageUploaders || tabPage == tpTextUploaders || tabPage == tpFileUploaders || tabPage == tpURLShorteners || tabPage == tpOtherUploaders)
|
||||
{
|
||||
tttvMain.SelectChild();
|
||||
}
|
||||
}
|
||||
|
||||
public void NavigateToTabPage(TabPage tp)
|
||||
{
|
||||
if (tp != null)
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue