示例#1
0
    public void Inherit_FontSize()
    {
        MockApplication      app    = MockApplication.Setup <StyleSetTestThing>();
        StyleSetTestThing    root   = (StyleSetTestThing)app.RootElement;
        UIStyleSetStateProxy normal = root.style.Normal;

        normal.TextFontSize = 8;
        app.Update();
        Assert.AreEqual(new UIFixedLength(8), root.FindById("group1").style.TextFontSize);
        Assert.AreEqual(new UIFixedLength(8), root.FindById("group2").style.TextFontSize);
        root.FindById("group1").style.SetTextFontSize(12, StyleState.Normal);
        app.Update();
        Assert.AreEqual(new UIFixedLength(12), root.FindById("group1").style.TextFontSize);
        Assert.AreEqual(new UIFixedLength(12), root.FindById("group2").style.TextFontSize);
        root.FindById("group1").style.SetTextFontSize(null, StyleState.Normal);
        app.Update();
        Assert.AreEqual(new UIFixedLength(8), root.FindById("group1").style.TextFontSize);
        Assert.AreEqual(new UIFixedLength(8), root.FindById("group2").style.TextFontSize);
    }
示例#2
0
    public void Inherit_TextColor()
    {
        MockApplication      app    = MockApplication.Setup <StyleSetTestThing>();
        StyleSetTestThing    root   = (StyleSetTestThing)app.RootElement;
        UIStyleSetStateProxy normal = root.style.Normal;

        normal.TextColor = Color.red;
        app.Update();
        Assert.AreEqual(Color.red, root.FindById("group1").style.TextColor);
        Assert.AreEqual(Color.red, root.FindById("group2").style.TextColor);
        root.FindById("group1").style.SetTextColor(Color.blue, StyleState.Normal);
        app.Update();
        Assert.AreEqual(Color.blue, root.FindById("group1").style.TextColor);
        Assert.AreEqual(Color.blue, root.FindById("group2").style.TextColor);
        root.FindById("group1").style.SetTextColor(null, StyleState.Normal);
        app.Update();
        Assert.AreEqual(Color.red, root.FindById("group1").style.TextColor);
        Assert.AreEqual(Color.red, root.FindById("group2").style.TextColor);
    }
示例#3
0
 public void Inherit_FontAsset()
 {
     MockApplication      app    = MockApplication.Setup <StyleSetTestThing>();
     StyleSetTestThing    root   = (StyleSetTestThing)app.RootElement;
     UIStyleSetStateProxy normal = root.style.Normal;
     // var font0 = new FontAsset(TMP_FontAsset.defaultFontAsset);
     // var font1 = new FontAsset(TMP_FontAsset.defaultFontAsset);
     // normal.TextFontAsset = font0;
     // app.Update();
     // Assert.AreEqual(font0, root.FindById("group1").style.TextFontAsset);
     // Assert.AreEqual(font0, root.FindById("group2").style.TextFontAsset);
     // root.FindById("group1").style.SetTextFontAsset(font1, StyleState.Normal);
     // app.Update();
     // Assert.AreEqual(font1, root.FindById("group1").style.TextFontAsset);
     // Assert.AreEqual(font1, root.FindById("group2").style.TextFontAsset);
     // root.FindById("group1").style.SetTextFontAsset(null, StyleState.Normal);
     // app.Update();
     // Assert.AreEqual(font0, root.FindById("group1").style.TextFontAsset);
     // Assert.AreEqual(font0, root.FindById("group2").style.TextFontAsset);
 }