Skip to content

Commit

Permalink
label editor: if already open, focus it
Browse files Browse the repository at this point in the history
- instead of having to click the window from the start menu
- label editor needs WORRRRRRRKKKKKKKKKKKKKK in general
  • Loading branch information
binary1230 committed Nov 30, 2024
1 parent c9473a0 commit 1d272ef
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Diz.Controllers/Diz.Controllers/src/interfaces/IViewers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public interface IShowable
{
void Show();
}

public interface IFocusable
{
void BringFormToTop(); // not the most elegant thing
}

public interface IStartFormViewer : IProjectOpenRequester, IFormViewer
{
Expand Down Expand Up @@ -115,7 +120,7 @@ public class SelectedOffsetChangedEventArgs : EventArgs
}
#endif

public interface ILabelEditorView : IFormViewer
public interface ILabelEditorView : IFormViewer, IFocusable
{
[CanBeNull] public IProjectController ProjectController { get; set; }

Expand Down
5 changes: 5 additions & 0 deletions DiztinGUIsh/window/AliasList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,9 @@ private void Labels_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
// if needed, catch any changes to label content here
}

public void BringFormToTop()
{
Focus();
}
}
6 changes: 5 additions & 1 deletion DiztinGUIsh/window/MainWindow.Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ private void ShowVisualizerForm()
visualForm.Show();
}

private void ShowCommentList() => aliasList.Show();
private void ShowCommentList()
{
aliasList.Show();
aliasList.BringFormToTop();
}

private void ShowProjectSettings()
{
Expand Down

0 comments on commit 1d272ef

Please sign in to comment.