Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions IDE/src/IDEApp.bf
Original file line number Diff line number Diff line change
Expand Up @@ -6063,7 +6063,13 @@ namespace IDE
{
scope AutoBeefPerf("IDEApp.CreateMenu");

SysMenu root = mMainWindow.mSysMenu;
SysMenu root;
#if BF_PLATFORM_WINDOWS
root = mMainWindow.mSysMenu;
#else
root = mMainFrame.mMenuBar.mSysMenuRoot;
defer mMainFrame.RehupSize();
#endif

String keyStr = scope String();

Expand Down Expand Up @@ -6147,11 +6153,18 @@ namespace IDE

void AddLineEndingKind(String name, LineEndingKind lineEndingKind)
{
bool allowLast;
#if !BF_PLATFORM_WINDOWS
allowLast = true;
#else
allowLast = false;
#endif

lineEndingMenu.AddMenuItem(name, null,
new (menu) =>
{
var sysMenu = (SysMenu)menu;
var sourceViewPanel = GetActiveSourceViewPanel();
var sourceViewPanel = GetActiveSourceViewPanel(allowLast);
if (sourceViewPanel != null)
{
if (sourceViewPanel.mEditData.mLineEndingKind != lineEndingKind)
Expand All @@ -6166,7 +6179,7 @@ namespace IDE
{
var sysMenu = (SysMenu)menu;

var sourceViewPanel = GetActiveSourceViewPanel();
var sourceViewPanel = GetActiveSourceViewPanel(allowLast);
if (sourceViewPanel != null)
{
sysMenu.Modify(null, null, null, true, (sourceViewPanel.mEditData.mLineEndingKind == lineEndingKind) ? 1 : 0, true);
Expand Down
6 changes: 3 additions & 3 deletions IDE/src/ui/MainFrame.bf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace IDE.ui
public StatusBar mStatusBar;
public DarkDockingFrame mDockingFrame;

#if BF_PLATFORM_LINUX
#if !BF_PLATFORM_WINDOWS
public MenuBar mMenuBar;
#endif

Expand All @@ -25,7 +25,7 @@ namespace IDE.ui
AddWidget(mStatusBar);
mDockingFrame = (DarkDockingFrame)ThemeFactory.mDefault.CreateDockingFrame();
AddWidget(mDockingFrame);
#if BF_PLATFORM_LINUX
#if !BF_PLATFORM_WINDOWS
mMenuBar = new MenuBar();
AddWidget(mMenuBar);
#endif
Expand All @@ -50,7 +50,7 @@ namespace IDE.ui
base.Resize(x, y, width, height);

int32 statusHeight = GS!(20);
#if BF_PLATFORM_LINUX
#if !BF_PLATFORM_WINDOWS
int32 menuHeight = GS!(20);
mDockingFrame.Resize(0, menuHeight, width, height - statusHeight - menuHeight);
mMenuBar.Resize(0, 0, width, menuHeight);
Expand Down
Loading