コード例 #1
0
ファイル: GroupChatView.cs プロジェクト: jamesaxl/smuxi
        public virtual void RenderPersonIdentityName(Gtk.TreeViewColumn column,
                                                     Gtk.CellRenderer cellr,
                                                     Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            PersonModel person   = (PersonModel)model.GetValue(iter, 0);
            var         renderer = (Gtk.CellRendererText)cellr;

            if (NickColors)
            {
                // TODO: do we need to optimize this? it's called very often...
                Gdk.Color bgColor = _PersonTreeView.Style.Base(Gtk.StateType.Normal);
                var       builder = new MessageBuilder();
                builder.Settings.NickColors = true;
                builder.AppendNick(person);
                renderer.Markup = PangoTools.ToMarkup(builder.ToMessage(),
                                                      bgColor);
            }
            else
            {
                renderer.Text = person.IdentityName;
            }
        }