1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-29 12:55:59 +02:00

Added Sync with Workspace Panel option

This commit is contained in:
Brian Fiete 2021-02-03 12:48:04 -08:00
parent c3238272d0
commit 3f68473fe1
6 changed files with 54 additions and 0 deletions

View file

@ -124,6 +124,7 @@ namespace IDE.ui
AddPropertiesItem(category, "Free Cursor Movement", "mFreeCursorMovement");
AddPropertiesItem(category, "Enable File Recovery", "mEnableFileRecovery");
AddPropertiesItem(category, "Format on Save", "mFormatOnSave");
AddPropertiesItem(category, "Sync with Workspace Panel", "mSyncWithWorkspacePanel");
category.Open(true, true);
}

View file

@ -2445,6 +2445,22 @@ namespace IDE.ui
return false;
}
public void SyncWithWorkspacePanel()
{
if (gApp.mProjectPanel.[Friend]mProjectToListViewMap.TryGet(mProjectSource, var matchKey, var projectListViewItem))
{
var checkLVItem = projectListViewItem.mParentItem;
while (checkLVItem != null)
{
checkLVItem.Open(true);
checkLVItem = (ProjectListViewItem)checkLVItem.mParentItem;
}
projectListViewItem.mListView.GetRoot().SelectItemExclusively(projectListViewItem);
projectListViewItem.mListView.EnsureItemVisible(projectListViewItem, false);
}
}
public override void EditGotFocus()
{
if (mFilePath != null)
@ -2488,6 +2504,11 @@ namespace IDE.ui
gApp.mLastActiveSourceViewPanel = this;
gApp.mLastActivePanel = this;
if ((gApp.mSettings.mEditorSettings.mSyncWithWorkspacePanel) && (mProjectSource != null))
{
SyncWithWorkspacePanel();
}
}
public override void EditLostFocus()