private void UpdateButton() { if (calendarItem != null && calendarItem.id > 0) { this.Image = null; PangoText.SetText(calendarItem.Text); this.TooltipText = calendarItem.FullText; this.Relief = ReliefStyle.Normal; Drag.DestUnset(this); Drag.SourceSet(this, Gdk.ModifierType.Button1Mask, null, Gdk.DragAction.Move); Gdk.Color col = new Gdk.Color(); Gdk.Color.Parse(calendarItem.Color, ref col); logger.Debug("a={0} - {1} - {2}", col.Red, col.Green, col.Blue); this.ModifyBg(StateType.Normal, col); byte r = (byte)Math.Min(((double)col.Red / ushort.MaxValue) * byte.MaxValue + 30, byte.MaxValue); byte g = (byte)Math.Min(((double)col.Green / ushort.MaxValue) * byte.MaxValue + 30, byte.MaxValue); byte b = (byte)Math.Min(((double)col.Blue / ushort.MaxValue) * byte.MaxValue + 30, byte.MaxValue); col = new Gdk.Color(r, g, b); this.ModifyBg(StateType.Prelight, col); logger.Debug("b={0} - {1} - {2}", col.Red, col.Green, col.Blue); //Tag PangoTag.SetText(calendarItem.Tag); PangoMessages.SetText(calendarItem.MessageCount + "✉"); } else if (calendarItem != null && calendarItem.id == 0) { Pango.FontDescription desc = Pango.FontDescription.FromString("Serif Bold 35"); PangoText.FontDescription = desc; PangoText.SetText(calendarItem.Text); this.Relief = ReliefStyle.Normal; Gdk.Color col = new Gdk.Color(); Gdk.Color.Parse(calendarItem.Color, ref col); this.ModifyBg(StateType.Normal, col); this.ModifyBg(StateType.Prelight, col); } else { this.Image = null; this.TooltipText = null; Drag.SourceUnset(this); this.Relief = ReliefStyle.None; this.ModifyBg(StateType.Normal); } }
private void UnsetDestDnd() { Drag.DestUnset(packTreeView); }