2
2
// Copyright (C) 2009 Jason Smith
3
// Copyright (C) 2010 Robert Dyer
4
5
// This program is free software: you can redistribute it and/or modify
5
6
// it under the terms of the GNU General Public License as published by
68
67
int xMiddle = x + width / 2;
69
68
double yMiddle = Allocation.Y + Allocation.Height / 2.0;
71
if (!string.IsNullOrEmpty (title)) {
72
Pango.Layout layout = DockServices.Drawing.ThemedPangoLayout ();
73
layout.SetText (title);
74
layout.Width = Pango.Units.FromPixels (Allocation.Width - Allocation.Height);
75
layout.FontDescription = Style.FontDescription;
76
layout.Ellipsize = Pango.EllipsizeMode.End;
77
layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels (8);
78
layout.FontDescription.Weight = Pango.Weight.Bold;
80
Pango.Rectangle logical, ink;
81
layout.GetPixelExtents (out ink, out logical);
83
cr.MoveTo (Allocation.X + 2, Allocation.Y + (Allocation.Height - logical.Height) / 2);
84
Pango.CairoHelper.LayoutPath (cr, layout);
85
cr.Color = TextColor.SetAlpha (.6);
88
x += logical.Width + 5;
70
if (!string.IsNullOrEmpty (title))
71
using (Pango.Layout layout = DockServices.Drawing.ThemedPangoLayout ()) {
72
layout.SetText (title);
73
layout.Width = Pango.Units.FromPixels (Allocation.Width - Allocation.Height);
74
layout.FontDescription = Style.FontDescription;
75
layout.Ellipsize = Pango.EllipsizeMode.End;
76
layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels (8);
77
layout.FontDescription.Weight = Pango.Weight.Bold;
79
Pango.Rectangle logical, ink;
80
layout.GetPixelExtents (out ink, out logical);
82
cr.MoveTo (Allocation.X + 2, Allocation.Y + (Allocation.Height - logical.Height) / 2);
83
Pango.CairoHelper.LayoutPath (cr, layout);
84
cr.Color = TextColor.SetAlpha (.6);
87
x += logical.Width + 5;
89
layout.Context.Dispose ();
92
93
cr.MoveTo (x, yMiddle);