Don't set the focus of the text widget until the first draw.
This commit is contained in:
parent
bc1f45f8b8
commit
9c415ab270
4 changed files with 24 additions and 5 deletions
|
|
@ -102,7 +102,17 @@ namespace MatterHackers.MatterControl
|
|||
topToBottom.AddChild(buttonRow);
|
||||
|
||||
ShowAsSystemWindow();
|
||||
UiThread.RunOnIdle(folderNameWidget.Focus);
|
||||
}
|
||||
|
||||
bool firstDraw = true;
|
||||
public override void OnDraw(Graphics2D graphics2D)
|
||||
{
|
||||
if (firstDraw)
|
||||
{
|
||||
UiThread.RunOnIdle(folderNameWidget.Focus);
|
||||
firstDraw = false;
|
||||
}
|
||||
base.OnDraw(graphics2D);
|
||||
}
|
||||
|
||||
private void ActualTextEditWidget_EnterPressed(object sender, KeyEventArgs keyEvent)
|
||||
|
|
|
|||
|
|
@ -137,8 +137,17 @@ namespace MatterHackers.MatterControl
|
|||
topToBottom.AddChild(buttonRow);
|
||||
|
||||
ShowAsSystemWindow();
|
||||
}
|
||||
|
||||
UiThread.RunOnIdle(textToAddWidget.Focus);
|
||||
bool firstDraw = true;
|
||||
public override void OnDraw(Graphics2D graphics2D)
|
||||
{
|
||||
if (firstDraw)
|
||||
{
|
||||
UiThread.RunOnIdle(textToAddWidget.Focus);
|
||||
firstDraw = false;
|
||||
}
|
||||
base.OnDraw(graphics2D);
|
||||
}
|
||||
|
||||
private void ActualTextEditWidget_EnterPressed(object sender, KeyEventArgs keyEvent)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public TerminalWidget(bool showInWindow)
|
||||
{
|
||||
this.Name = "TerminalWidget";
|
||||
this.BackgroundColor = backgroundColor;
|
||||
this.Padding = new BorderDouble(5, 0);
|
||||
FlowLayoutWidget topLeftToRightLayout = new FlowLayoutWidget();
|
||||
|
|
@ -141,8 +142,6 @@ namespace MatterHackers.MatterControl
|
|||
manualCommandTextEdit.ActualTextEditWidget.EnterPressed += new KeyEventHandler(manualCommandTextEdit_EnterPressed);
|
||||
manualCommandTextEdit.ActualTextEditWidget.KeyDown += new KeyEventHandler(manualCommandTextEdit_KeyDown);
|
||||
manualEntryLayout.AddChild(manualCommandTextEdit);
|
||||
|
||||
UiThread.RunOnIdle(manualCommandTextEdit.Focus);
|
||||
}
|
||||
|
||||
manualEntryTopToBottomLayout.AddChild(manualEntryLayout);
|
||||
|
|
@ -212,6 +211,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
filterOutput.Checked = UserSettings.Instance.Fields.GetBool(TerminalFilterOutputKey, false);
|
||||
firstDraw = false;
|
||||
UiThread.RunOnIdle(manualCommandTextEdit.Focus);
|
||||
}
|
||||
base.OnDraw(graphics2D);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 31f7c3892342e1d28f1ca357ceb65e8fb0cdc49d
|
||||
Subproject commit f52d6ed36c2ef23daa62451bbf9e2b54fb76316e
|
||||
Loading…
Add table
Add a link
Reference in a new issue