gewentao
6 年前
当前提交
079a76fa
共有 8 个文件被更改,包括 247 次插入 和 27 次删除
-
7Assets/UIWidgets/ui/window.cs
-
145Assets/UIWidgets/widgets/binding.cs
-
33Assets/UIWidgets/widgets/framework.cs
-
8Assets/UIWidgets/widgets/image.cs
-
45Assets/UIWidgets/rendering/error.cs
-
3Assets/UIWidgets/rendering/error.cs.meta
-
30Assets/UIWidgets/widgets/ticker_provider.cs
-
3Assets/UIWidgets/widgets/ticker_provider.cs.meta
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UIWidgets.foundation; |
|||
using UIWidgets.gestures; |
|||
using UIWidgets.painting; |
|||
using UIWidgets.ui; |
|||
using UnityEngine; |
|||
using Rect = UIWidgets.ui.Rect; |
|||
|
|||
namespace UIWidgets.rendering { |
|||
public class RenderErrorBox : RenderBox { |
|||
const double _kMaxWidth = 100000.0; |
|||
const double _kMaxHeight = 100000.0; |
|||
const string _kLine = "\n\n────────────────────\n\n"; |
|||
|
|||
public RenderErrorBox(string message = "") { |
|||
this.message = message; |
|||
if (message == "") return; |
|||
ui.ParagraphBuilder builder = new ui.ParagraphBuilder(paragraphStyle); |
|||
builder.pushStyle(textStyle); |
|||
builder.addText( |
|||
string.Format( |
|||
"{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}{16}{17}{18}{19}{20}{21}{22}{23}", |
|||
message, _kLine, message, _kLine, message, _kLine, message, _kLine, message, _kLine, message, |
|||
_kLine, message, _kLine, message, _kLine, message, _kLine, message, _kLine, message, _kLine, |
|||
message, _kLine) |
|||
); |
|||
_paragraph = builder.build(); |
|||
} |
|||
|
|||
private string message; |
|||
ui.Paragraph _paragraph; |
|||
|
|||
static ui.TextStyle textStyle = new ui.TextStyle( |
|||
color: new ui.Color(0xFFFFFF66), |
|||
fontFamily: "monospace", |
|||
fontSize: 14.0, |
|||
fontWeight: FontWeight.w700 |
|||
); |
|||
|
|||
static ui.ParagraphStyle paragraphStyle = new ui.ParagraphStyle( |
|||
lineHeight: 1.0 |
|||
); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 64dfb38ea47d49c7b9f3d0debeee4409 |
|||
timeCreated: 1536819405 |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using UIWidgets.foundation; |
|||
using UIWidgets.rendering; |
|||
using UIWidgets.ui; |
|||
using UnityEngine.Assertions; |
|||
|
|||
namespace UIWidgets.widgets { |
|||
public class TickerMode : InheritedWidget { |
|||
public TickerMode(string key, bool enabled, Widget child) : base(key, child) { |
|||
this.enabled = enabled; |
|||
} |
|||
|
|||
public readonly bool enabled; |
|||
|
|||
public static bool of(BuildContext context) { |
|||
var widget = context.inheritFromWidgetOfExactType(typeof(TickerMode)); |
|||
return widget is TickerMode ? (widget as TickerMode).enabled : true; |
|||
} |
|||
|
|||
public override bool updateShouldNotify(InheritedWidget oldWidget) { |
|||
return this.enabled != ((TickerMode)oldWidget).enabled; |
|||
} |
|||
|
|||
public override Element createElement() { |
|||
throw new NotImplementedException(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: aa6922a60d7945ffb3b92dede5941836 |
|||
timeCreated: 1536807803 |
撰写
预览
正在加载...
取消
保存
Reference in new issue