mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Fix uploaders config form tab navigation
This commit is contained in:
parent
efcca39ae6
commit
a3174356a3
3 changed files with 32 additions and 2 deletions
|
@ -157,7 +157,7 @@ private void tvMain_AfterSelect(object sender, TreeViewEventArgs e)
|
|||
}
|
||||
}
|
||||
|
||||
public void SelectTab(TabPage tabPage)
|
||||
private void SelectTab(TabPage tabPage)
|
||||
{
|
||||
if (tabPage != null)
|
||||
{
|
||||
|
@ -172,6 +172,23 @@ public void SelectTab(TabPage tabPage)
|
|||
}
|
||||
}
|
||||
|
||||
public void NavigateToTabPage(TabPage tabPage)
|
||||
{
|
||||
if (tabPage != null)
|
||||
{
|
||||
foreach (TreeNode node in tvMain.Nodes.All())
|
||||
{
|
||||
TabPage nodeTabPage = node.Tag as TabPage;
|
||||
|
||||
if (nodeTabPage == tabPage)
|
||||
{
|
||||
tvMain.SelectedNode = node;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectChild()
|
||||
{
|
||||
if (tvMain.SelectedNode.Nodes.Count > 0)
|
||||
|
|
|
@ -810,5 +810,18 @@ public static Image CloneSafe(this Image img)
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static IEnumerable<TreeNode> All(this TreeNodeCollection nodes)
|
||||
{
|
||||
foreach (TreeNode node in nodes)
|
||||
{
|
||||
yield return node;
|
||||
|
||||
foreach (TreeNode child in node.Nodes.All())
|
||||
{
|
||||
yield return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -144,7 +144,7 @@ public void NavigateToTabPage(TabPage tp)
|
|||
{
|
||||
if (tp != null)
|
||||
{
|
||||
tttvMain.SelectTab(tp);
|
||||
tttvMain.NavigateToTabPage(tp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue