mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-12 22:36:59 +00:00
misc: Code cleanups
This commit is contained in:
parent
2facad4be3
commit
b20613661c
9 changed files with 52 additions and 84 deletions
|
|
@ -102,14 +102,8 @@ namespace Ryujinx.Ava.UI.Applet
|
|||
|
||||
public bool TextProcessingEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return Volatile.Read(ref _canProcessInput);
|
||||
}
|
||||
set
|
||||
{
|
||||
Volatile.Write(ref _canProcessInput, value);
|
||||
}
|
||||
get => Volatile.Read(ref _canProcessInput);
|
||||
set => Volatile.Write(ref _canProcessInput, value);
|
||||
}
|
||||
|
||||
public event DynamicTextChangedHandler TextChangedEvent;
|
||||
|
|
@ -135,23 +129,19 @@ namespace Ryujinx.Ava.UI.Applet
|
|||
});
|
||||
}
|
||||
|
||||
public void SetText(string text, int cursorBegin)
|
||||
{
|
||||
public void SetText(string text, int cursorBegin) =>
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
_hiddenTextBox.Text = text;
|
||||
_hiddenTextBox.CaretIndex = cursorBegin;
|
||||
});
|
||||
}
|
||||
|
||||
public void SetText(string text, int cursorBegin, int cursorEnd)
|
||||
{
|
||||
public void SetText(string text, int cursorBegin, int cursorEnd) =>
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
_hiddenTextBox.Text = text;
|
||||
_hiddenTextBox.SelectionStart = cursorBegin;
|
||||
_hiddenTextBox.SelectionEnd = cursorEnd;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue