50
public override Gtk.Widget Widget {
53
widget = BuildWidget ();
58
protected virtual string Description { get; set; }
60
protected virtual string Icon { get; set; }
62
protected virtual bool UseTooltip { get; set; }
51
public override Gtk.Widget Widget {
52
get { return widget; }
55
private Gdk.Pixbuf Pixbuf { get; set; }
57
protected string Description {
67
protected string Icon {
77
protected bool UseTooltip {
64
88
public AbstractMenuButtonArgs ()
69
92
public AbstractMenuButtonArgs (string description, string icon)
71
Description = GLib.Markup.EscapeText (Catalog.GetString (description));
94
this.description = GLib.Markup.EscapeText (Catalog.GetString (description));
77
105
DrawingArea button = new DrawingArea ();
79
107
button.ExposeEvent += HandleExposeEvent;
136
169
int width = area.Width - WidthBuffer * 2 - 25;
138
TextRenderContext renderContext = new TextRenderContext (cr, string.Format (FormatString, Description), width);
140
renderContext.LeftCenteredPoint = new Gdk.Point (area.X + WidthBuffer + 25, area.Y + area.Height / 2);
141
renderContext.Alignment = Pango.Alignment.Left;
142
renderContext.EllipsizeMode = Pango.EllipsizeMode.End;
144
DockServices.DrawingService.TextPathAtPoint (renderContext);
146
cr.Color = new Cairo.Color (1, 1, 1);
149
Gdk.Pixbuf pbuf = GetPixbuf (Height - 8);
150
CairoHelper.SetSourcePixbuf (cr, pbuf, WidthBuffer, (Height - pbuf.Height) / 2);
151
cr.PaintWithAlpha (IconOpacity);
171
if (!string.IsNullOrEmpty (Description)) {
172
TextRenderContext renderContext = new TextRenderContext (cr, string.Format (FormatString, Description), width);
174
renderContext.LeftCenteredPoint = new Gdk.Point (area.X + WidthBuffer + 25, area.Y + area.Height / 2);
175
renderContext.Alignment = Pango.Alignment.Left;
176
renderContext.EllipsizeMode = Pango.EllipsizeMode.End;
178
DockServices.DrawingService.TextPathAtPoint (renderContext);
180
cr.Color = new Cairo.Color (1, 1, 1);
184
if (Pixbuf != null) {
185
CairoHelper.SetSourcePixbuf (cr, Pixbuf, WidthBuffer, (Height - Pixbuf.Height) / 2);
186
cr.PaintWithAlpha (IconOpacity);
156
191
protected virtual Gdk.Pixbuf GetPixbuf (int size)
158
return IconProvider.PixbufFromIconName (Icon, size);
193
if (!string.IsNullOrEmpty (Icon))
194
return IconProvider.PixbufFromIconName (Icon, size);
161
198
public abstract void Action ();