1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

Added setting to open new tabs on right instead of left

This commit is contained in:
blat-blatnik 2021-11-30 23:37:44 +01:00
parent c2ed0d4afe
commit 318cb6524d
4 changed files with 24 additions and 6 deletions

View file

@ -5840,7 +5840,7 @@ namespace IDE
newTabButton.mWantWidth = newTabButton.GetWantWidth();
newTabButton.mHeight = tabbedView.mTabHeight;
newTabButton.mContent = disassemblyPanel;
tabbedView.AddTab(newTabButton);
tabbedView.AddTab(newTabButton, GetTabInsertIndex(tabbedView));
newTabButton.mCloseClickedEvent.Add(new () => CloseDocument(disassemblyPanel));
newTabButton.Activate();
@ -5850,6 +5850,14 @@ namespace IDE
return disassemblyPanel;
}
int GetTabInsertIndex(TabbedView tabs)
{
if (mSettings.mUISettings.mInsertNewTabs == .RightOfExistingTabs)
return tabs.mTabs.Count;
else
return 0;
}
public class SourceViewTab : DarkTabbedView.DarkTabButton
{
public float GetWantWidth()
@ -6021,7 +6029,7 @@ namespace IDE
tabButton.mIsRightTab = false;
var darkTabbedView = (DarkTabbedView)tabButton.mTabbedView;
darkTabbedView.SetRightTab(null, false);
darkTabbedView.AddTab(tabButton);
darkTabbedView.AddTab(tabButton, GetTabInsertIndex(darkTabbedView));
tabButton.Activate();
}
@ -6397,7 +6405,7 @@ namespace IDE
tabbedView.SetRightTab(newTabButton);
}
else
tabbedView.AddTab(newTabButton);
tabbedView.AddTab(newTabButton, GetTabInsertIndex(tabbedView));
newTabButton.mCloseClickedEvent.Add(new () => DocumentCloseClicked(sourceViewPanel));
newTabButton.Activate(setFocus);
if ((setFocus) && (sourceViewPanel.mWidgetWindow != null))