44
45
class AboutMonoDevelopTabPage: VBox
46
ScrollBox aboutPictureScrollBox;
49
49
public AboutMonoDevelopTabPage ()
53
aboutPictureScrollBox = new ScrollBox ();
55
PackStart (aboutPictureScrollBox, false, false, 0);
56
using (var stream = BrandingService.GetStream ("AboutImageSep.png", true))
53
using (var stream = BrandingService.GetStream ("AboutImage.png", true))
57
54
imageSep = new Pixbuf (stream);
58
55
PackStart (new Gtk.Image (imageSep), false, false, 0);
60
var label = new Label ();
61
label.Markup = string.Format (
63
GettextCatalog.GetString ("Version"),
64
BuildVariables.PackageVersion == BuildVariables.PackageVersionLabel ? BuildVariables.PackageVersionLabel : String.Format ("{0} ({1})",
65
BuildVariables.PackageVersionLabel,
66
BuildVariables.PackageVersion));
68
var hBoxVersion = new HBox ();
69
hBoxVersion.PackStart (label, false, false, 5);
70
this.PackStart (hBoxVersion, false, true, 0);
74
label.Markup = GettextCatalog.GetString ("<b>License</b>\n {0}", GettextCatalog.GetString ("Released under the GNU Lesser General Public License."));
75
var hBoxLicense = new HBox ();
76
hBoxLicense.PackStart (label, false, false, 5);
77
this.PackStart (hBoxLicense, false, true, 5);
81
label.Markup = GettextCatalog.GetString ("<b>Copyright</b>\n (c) 2004-{0} by MonoDevelop contributors", DateTime.Now.Year);
82
var hBoxCopyright = new HBox ();
83
hBoxCopyright.PackStart (label, false, false, 5);
84
this.PackStart (hBoxCopyright, false, true, 5);
57
Xwt.VBox infoBox = new Xwt.VBox ();
60
PackStart (infoBox.ToGtkWidget (), false, false, 0);
62
infoBox.PackStart (new Xwt.Label () {
63
Text = GettextCatalog.GetString ("Version"),
64
Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold)
66
infoBox.PackStart (new Xwt.Label () {
67
Text = IdeVersionInfo.MonoDevelopVersion,
71
infoBox.PackStart (new Xwt.Label () {
72
Text = GettextCatalog.GetString ("License"),
73
Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold)
75
infoBox.PackStart (new Xwt.Label () {
76
Text = GettextCatalog.GetString ("Released under the GNU Lesser General Public License."),
80
infoBox.PackStart (new Xwt.Label () {
81
Text = GettextCatalog.GetString ("Copyright"),
82
Font = infoBox.Font.WithWeight (Xwt.Drawing.FontWeight.Bold)
84
var cbox = new Xwt.HBox () {
88
cbox.PackStart (new Xwt.Label ("Ā© 2011-2012 "));
89
cbox.PackStart (new Xwt.LinkLabel () {
90
Text = string.Format ("Xamarin Inc."),
91
Uri = new Uri ("http://www.xamarin.com")
93
infoBox.PackStart (cbox);
94
infoBox.PackStart (new Xwt.Label () {
95
Text = "Ā© 2004-2012 MonoDevelop contributors",
99
cbox = new Xwt.HBox () {
103
cbox.PackStart (new Xwt.Label ("Some icons by "));
104
cbox.PackStart (new Xwt.LinkLabel () {
105
Text = string.Format ("Yusuke Kamiyamane"),
106
Uri = new Uri ("http://p.yusukekamiyamane.com")
108
infoBox.PackStart (cbox);
110
cbox = new Xwt.HBox () {
114
cbox.PackStart (new Xwt.Label ("Some icons from the "));
115
cbox.PackStart (new Xwt.LinkLabel () {
116
Text = string.Format ("Silk icon set"),
117
Uri = new Uri ("http://www.famfamfam.com/")
119
infoBox.PackStart (cbox);
89
internal class ScrollBox : DrawingArea
93
int imageHeight, imageWidth;
96
int monoLogoSpacing = 80;
99
int scrollHeightPx, scrollStartPx, scrolledUpPx;
102
const int pixelsPerFrame = 1;
103
const int pauseSeconds = 5;
105
internal uint TimerHandle;
106
string[] authors = new string[] {
107
"Lluis Sanchez Gual",
108
"Michael Hutchinson",
122
"Luciano N. Callero",
128
string[] oldAuthors = new string[] {
134
"Alfonso Santos Luaces",
135
"Andre Filipe de Assuncao e Brito",
137
"AndrƩs G. Aragoneses",
154
"Jacob IlsĆø Christensen",
158
"Jeroen Zwartepoorte",
162
"Jonathan HernƔndez Velasco",
165
"Lluis Sanchez Gual",
166
"Luciano N. Callero",
168
"Marcos David MarĆn Amador",
169
"Martin Willemoes Hansen",
172
"MaurĆcio de Lemos Rodrigues Collares Neto",
173
"Michael Hutchinson",
184
"Pedro Abelleira Seco",
188
"Rolf Bjarne Kvinge",
202
Gdk.Color bgColor = new Gdk.Color (49, 49, 74);
203
Gdk.Color textColor = new Gdk.Color (0xFF, 0xFF, 0xFF);
208
var textColStr = BrandingService.GetString ("AboutBox", "TextColor");
209
if (textColStr != null)
210
Gdk.Color.Parse (textColStr, ref textColor);
211
var bgColStr = BrandingService.GetString ("AboutBox", "BackgroundColor");
212
if (bgColStr != null)
213
Gdk.Color.Parse (bgColStr, ref bgColor);
215
//branders may provide either fg image or bg image, or both
216
using (var stream = BrandingService.GetStream ("AboutImage.png", false)) {
217
image = (stream != null ? new Gdk.Pixbuf (stream) : null);
219
using (var streamBg = BrandingService.GetStream ("AboutImageBg.png", false)) {
220
imageBg = (streamBg != null ? new Gdk.Pixbuf (streamBg) : null);
223
//if branding did not provide any image, use the built-in one
224
if (imageBg == null && image == null) {
225
image = Gdk.Pixbuf.LoadFromResource ("AboutImage.png");
227
} catch (Exception ex) {
228
LoggingService.LogError ("Error loading about box branding", ex);
235
this.Realized += new EventHandler (OnRealized);
236
this.ModifyBg (Gtk.StateType.Normal, bgColor);
237
this.ModifyText (Gtk.StateType.Normal, textColor);
240
imageHeight = image.Height;
241
imageWidth = image.Width;
243
if (imageBg != null) {
244
imageHeight = Math.Max (imageHeight, imageBg.Height);
245
imageWidth = Math.Max (imageWidth, imageBg.Width);
248
monoPowered = Gdk.Pixbuf.LoadFromResource ("mono-powered.png");
249
this.SetSizeRequest (imageWidth, imageHeight - 1);
251
uint timeout = 1000 / (uint)fps;
252
TimerHandle = GLib.Timeout.Add (timeout, delegate {
253
this.QueueDrawArea (0, 0, Allocation.Width, imageHeight);
257
this.startTicks = DateTime.Now.Ticks;
262
var sb = new StringBuilder ();
263
sb.Append (GettextCatalog.GetString ("<b>Contributors to this Release</b>\n\n"));
265
for (int n = 0; n < authors.Length; n++) {
266
sb.Append (authors [n]);
269
else if (n < authors.Length - 1)
273
sb.Append ("\n\n<b>" + GettextCatalog.GetString ("Previous Contributors") + "</b>\n\n");
274
for (int n = 0; n < oldAuthors.Length; n++) {
275
sb.Append (oldAuthors [n]);
278
else if (n < oldAuthors.Length - 1)
282
string trans = GettextCatalog.GetString ("translator-credits");
283
if (trans != "translator-credits") {
284
sb.Append (GettextCatalog.GetString ("\n\n<b>Translated by:</b>\n\n"));
289
sb.AppendLine (GettextCatalog.GetString ("<b>Using some icons from:</b>"));
291
sb.Append ("http://www.famfamfam.com/lab/icons/silk");
292
return sb.ToString ();
296
void UpdateScrollPosition ()
298
long elapsed = DateTime.Now.Ticks - startTicks;
299
long pauseTicks = pauseSeconds * TimeSpan.TicksPerSecond;
300
long ticksPerPixel = TimeSpan.TicksPerSecond / (pixelsPerFrame * fps);
301
long totalScrollTicks = scrollHeightPx * ticksPerPixel + pauseTicks;
302
long tickPosition = elapsed % totalScrollTicks;
303
scrolledUpPx = (int) Math.Min ((tickPosition / ticksPerPixel), scrollHeightPx);
306
void DrawText (Drawable window)
308
var alloc = Allocation;
309
int pos = scrollStartPx - scrolledUpPx;
310
window.DrawLayout (Style.TextGC (StateType.Normal), 0, pos, layout);
311
int logoPos = pos + scrollHeightPx - monoPowered.Height / 2 - imageHeight / 2;
312
window.DrawPixbuf (backGc, monoPowered, 0, 0, (alloc.Width / 2) - (monoPowered.Width / 2),
313
logoPos, -1, -1, RgbDither.Normal, 0, 0);
316
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
318
UpdateScrollPosition ();
320
var alloc = this.Allocation;
321
if (imageBg != null) {
322
evnt.Window.DrawPixbuf (backGc, imageBg, 0, 0,
323
(alloc.Width - imageBg.Width) / 2, 0,
324
-1, -1, RgbDither.Normal, 0, 0);
326
DrawText (evnt.Window);
327
if (this.image != null) {
328
evnt.Window.DrawPixbuf (backGc, image, 0, 0,
329
(alloc.Width - image.Width) / 2, 0,
330
-1, -1, RgbDither.Normal, 0, 0);
335
protected void OnRealized (object o, EventArgs args)
337
scrollStartPx = imageHeight;
339
layout = new Pango.Layout (this.PangoContext);
340
// FIXME: this seems wrong but works
341
layout.Width = Allocation.Width * (int)Pango.Scale.PangoScale;
342
layout.Wrap = Pango.WrapMode.Word;
343
layout.Alignment = Pango.Alignment.Center;
344
FontDescription fd = FontDescription.FromString ("Tahoma 10");
345
layout.FontDescription = fd;
346
layout.SetMarkup (CreditText);
348
int widthPx, heightPx;
349
layout.GetPixelSize (out widthPx, out heightPx);
351
this.scrollHeightPx = heightPx + monoLogoSpacing + monoPowered.Height + imageHeight / 2;
353
backGc = new Gdk.GC (GdkWindow);
354
backGc.RgbBgColor = bgColor;
357
protected override void OnDestroyed ()
361
GLib.Source.Remove (TimerHandle);
b'\\ No newline at end of file'