浏览代码

update

/main
fzhangtj 6 年前
当前提交
be0d9066
共有 2 个文件被更改,包括 12 次插入19 次删除
  1. 7
      Runtime/editor/editor_window.cs
  2. 24
      Runtime/widgets/focus_manager.cs

7
Runtime/editor/editor_window.cs


bool hasFocus = this.hasFocus();
using (this.getScope()) {
if (hasFocus) {
WidgetsBinding.instance.focusManager.focusIfNeed();
}
else {
WidgetsBinding.instance.focusManager.unfocusIfNeed();
}
WidgetsBinding.instance.focusManager.focusNone(!hasFocus);
this._updateScrollInput();
TextInput.Update();
this._timerProvider.update(this.flushMicrotasks);

24
Runtime/widgets/focus_manager.cs


this.rootScope._manager = this;
D.assert(this.rootScope._firstChild == null);
D.assert(this.rootScope._lastChild == null);
this.unfocusIfNeed();
}
public readonly FocusScopeNode rootScope = new FocusScopeNode();

if (this._currentFocus != null) {
this._currentFocus._notify();
}
Debug.Log($"updated none={this._noneScope.ToString()}:\n{this.ToString()}");
public void unfocusIfNeed() {
if (this._noneScope._parent != null && this._noneScope.isFirstFocus) {
return;
public void focusNone(bool focus) {
if (focus) {
if (this._noneScope._parent != null && this._noneScope.isFirstFocus) {
return;
}
this.rootScope.setFirstFocus(this._noneScope);
this.rootScope.setFirstFocus(this._noneScope);
}
public void focusIfNeed() {
if (this._noneScope._parent == null) {
return;
else {
if (this._noneScope._parent == null) {
return;
}
this._noneScope.detach();
this._noneScope.detach();
}
public override string ToString() {

正在加载...
取消
保存