1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 15:26:00 +02:00

Merge pull request #1252 from blat-blatnik/OpenTabsOnRight

[IDE] Added setting to open new tabs on right instead of left
This commit is contained in:
Brian Fiete 2021-12-06 09:39:49 -08:00 committed by GitHub
commit 9f57be150e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 10 deletions

View file

@ -398,12 +398,12 @@ namespace Beefy.theme.dark
func(mRightTab);
}
public override TabButton AddTab(String label, float width, Widget content, bool ownsContent)
public override TabButton AddTab(String label, float width, Widget content, bool ownsContent, int insertIdx)
{
float useWidth = width;
if (useWidth == 0)
useWidth = DarkTheme.sDarkTheme.mSmallFont.GetWidth(label) + GS!(30);
return base.AddTab(label, useWidth, content, ownsContent);
return base.AddTab(label, useWidth, content, ownsContent, insertIdx);
}
public override void RemoveTab(TabButton tabButton, bool deleteTab = true)

View file

@ -320,7 +320,7 @@ namespace Beefy.widgets
//tabbedView.mSharedData.mOpenNewWindowDelegate = mTabbedView.mSharedData.mOpenNewWindowDelegate;
tabbedView.SetRequestedSize(mTabbedView.mWidth, mTabbedView.mHeight);
mTabbedView.RemoveTab(this, false);
tabbedView.AddTab(this);
tabbedView.AddTab(this, 0);
float rootX;
float rootY;
@ -472,7 +472,7 @@ namespace Beefy.widgets
return activeTab;
}
public virtual TabButton AddTab(String label, float width, Widget content, bool ownsContent)
public virtual TabButton AddTab(String label, float width, Widget content, bool ownsContent, int insertIdx)
{
TabButton aTabButton = CreateTabButton();
aTabButton.mTabbedView = this;
@ -481,7 +481,7 @@ namespace Beefy.widgets
aTabButton.mWantWidth = width;
aTabButton.mHeight = mTabHeight;
aTabButton.mContent = content;
AddTab(aTabButton);
AddTab(aTabButton, insertIdx);
return aTabButton;
}
@ -501,7 +501,7 @@ namespace Beefy.widgets
return bestIdx;
}
public virtual void AddTab(TabButton tabButton, int insertIdx = 0)
public virtual void AddTab(TabButton tabButton, int insertIdx)
{
AddWidget(tabButton);
mTabs.Insert(insertIdx, tabButton);