public StatsWidget(Stat stat, Stat category, SubCategoryStat subcat, int textSize) { /* For subcategories, parent is the parent Category */ this.stat = stat; this.category = category; HomeColor = CairoUtils.ColorFromRGB(0xFF, 0x33, 0); AwayColor = CairoUtils.ColorFromRGB(0, 0x99, 0xFF); layout = new Pango.Layout(PangoContext); layout.Wrap = Pango.WrapMode.Char; layout.Alignment = Pango.Alignment.Center; ModifyText(StateType.Normal, LongoMatch.Gui.Helpers.Misc.ToGdkColor(Config.Style.PaletteText)); this.textSize = textSize; name_tpl = "{0}"; count_tpl = "{0} ({1}%)"; if (category == null) { name_tpl = "<b>" + name_tpl + "</b>"; count_tpl = "<b>" + count_tpl + "</b>"; HeightRequest = 25; } else { if (subcat != null) { name_tpl = GLib.Markup.EscapeText(subcat.Name); name_tpl += name_tpl == "" ? "{0}" : ": {0}"; } HeightRequest = 18; } }
public StatsWidget(Stat stat, Stat category, SubCategoryStat subcat, int textSize) { /* For subcategories, parent is the parent Category */ this.stat = stat; this.category = category; HomeColor = CairoUtils.ColorFromRGB(0xFF, 0x33, 0); AwayColor = CairoUtils.ColorFromRGB(0, 0x99, 0xFF); layout = new Pango.Layout(PangoContext); layout.Wrap = Pango.WrapMode.Char; layout.Alignment = Pango.Alignment.Center; this.textSize = textSize; name_tpl = "{0}"; count_tpl = "{0} ({1}%)"; if (category == null) { name_tpl = "<b>" + name_tpl + "</b>"; count_tpl = "<b>" + count_tpl + "</b>"; HeightRequest = 25; } else { if (subcat != null) { name_tpl = GLib.Markup.EscapeText(subcat.Name) + ": {0}"; } HeightRequest = 18; } }