Ejemplo n.º 1
0
        private void CreateAbout()
        {
            Label version = new Label () {
                Markup = string.Format ("<span font_size='small' fgcolor='white'>version {0}</span>",
                    Controller.RunningVersion),
                Xalign = 0,
                Xpad = 300
            };

            this.updates = new Label () {
                Markup = "<span font_size='small' fgcolor='#729fcf'>Checking for updates...</span>",
                Xalign = 0,
                Xpad = 300
            };

            Label copyright = new Label () {
                Markup = "<span font_size='small' fgcolor='white'>" +
                         "SparkleShare Copyright © 2010–" + DateTime.Now.Year + " " +
                         "Hylke Bons and others.\n" +
                         "PryanetShare Copyright © 2013–" + DateTime.Now.Year + " " +
                         "Pryanet Ltd." +
                         "</span>",
                Xalign = 0,
                Xpad   = 300
            };

            Label license = new Label () {
                LineWrap     = true,
                LineWrapMode = Pango.WrapMode.Word,
                Markup       = "<span font_size='small' fgcolor='white'>" +
                               "PryanetShare is Open Source software powered by SparkleShare. You are free to use, modify, " +
                               "and redistribute it under the GNU General Public License version 3 or later." +
                               "</span>",
                WidthRequest = 330,
                Wrap         = true,
                Xalign       = 0,
                Xpad         = 300,
            };

            VBox layout_vertical = new VBox (false, 0) {
                BorderWidth   = 0,
                HeightRequest = 260,
                WidthRequest  = 640
            };

            HBox links_layout = new HBox (false, 6);

            PryanetLink website_link        = new PryanetLink ("Website", Controller.WebsiteLinkAddress);
            PryanetLink credits_link        = new PryanetLink ("Credits", Controller.CreditsLinkAddress);
            PryanetLink report_problem_link = new PryanetLink ("Report a problem", Controller.ReportProblemLinkAddress);
            PryanetLink debug_log_link = new PryanetLink ("Debug log", Controller.DebugLogLinkAddress);

            links_layout.PackStart (new Label (""), false, false, 143);
            links_layout.PackStart (website_link, false, false, 9);
            links_layout.PackStart (credits_link, false, false, 9);
            links_layout.PackStart (report_problem_link, false, false, 9);
            links_layout.PackStart (debug_log_link, false, false, 9);

            layout_vertical.PackStart (new Label (""), false, false, 42);
            layout_vertical.PackStart (version, false, false, 0);
            layout_vertical.PackStart (this.updates, false, false, 0);
            layout_vertical.PackStart (copyright, false, false, 9);
            layout_vertical.PackStart (license, false, false, 0);
            layout_vertical.PackStart (links_layout, false, false, 12);

            Add (layout_vertical);
        }
Ejemplo n.º 2
0
        private void CreateAbout()
        {
            this.about_image = NSImage.ImageNamed ("about");
            this.about_image.Size = new SizeF (640, 260);

            this.about_image_view = new NSImageView () {
                Image = this.about_image,
                Frame = new RectangleF (0, 0, 640, 260)
            };

            this.version_text_field = new PryanetLabel ("version " + Controller.RunningVersion, NSTextAlignment.Left) {
                DrawsBackground = false,
                Frame           = new RectangleF (295, 140, 318, 22),
                TextColor       = NSColor.White,
                Font            = NSFontManager.SharedFontManager.FontWithFamily (
                    "Lucida Grande", NSFontTraitMask.Unbold, 0, 11)
            };

            this.updates_text_field = new PryanetLabel ("Checking for updates...", NSTextAlignment.Left) {
                DrawsBackground = false,
                Frame           = new RectangleF (295, Frame.Height - 232, 318, 98),
                TextColor       = NSColor.FromCalibratedRgba (1.0f, 1.0f, 1.0f, 0.5f),
                Font            = NSFontManager.SharedFontManager.FontWithFamily (
                    "Lucida Grande", NSFontTraitMask.Unbold, 0, 11)
            };

            this.credits_text_field = new PryanetLabel (
                @"SparkleShare Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others.\n" +
                "PryanetShare Copyright © 2013–" + DateTime.Now.Year + " Pryanet Ltd." +
                "\n" +
                "\n" +
                "PryanetShare is Open Source software. You are free to use, modify, and redistribute it " +
                "under the GNU General Public License version 3 or later.", NSTextAlignment.Left) {

                DrawsBackground = false,
                Frame           = new RectangleF (295, Frame.Height - 260, 318, 98),
                TextColor       = NSColor.White,
                Font            = NSFontManager.SharedFontManager.FontWithFamily (
                    "Lucida Grande", NSFontTraitMask.Unbold, 0, 11),
            };

            this.website_link       = new PryanetLink ("Website", Controller.WebsiteLinkAddress);
            this.website_link.Frame = new RectangleF (new PointF (295, 25), this.website_link.Frame.Size);

            this.credits_link       = new PryanetLink ("Credits", Controller.CreditsLinkAddress);
            this.credits_link.Frame = new RectangleF (
                new PointF (this.website_link.Frame.X + this.website_link.Frame.Width + 10, 25),
                this.credits_link.Frame.Size);

            this.report_problem_link       = new PryanetLink ("Report a problem", Controller.ReportProblemLinkAddress);
            this.report_problem_link.Frame = new RectangleF (
                new PointF (this.credits_link.Frame.X + this.credits_link.Frame.Width + 10, 25),
                this.report_problem_link.Frame.Size);

            this.debug_log_link       = new PryanetLink ("Debug log", Controller.DebugLogLinkAddress);
            this.debug_log_link.Frame = new RectangleF (
                new PointF (this.report_problem_link.Frame.X + this.report_problem_link.Frame.Width + 10, 25),
                this.debug_log_link.Frame.Size);

            ContentView.AddSubview (this.about_image_view);
            ContentView.AddSubview (this.version_text_field);
            ContentView.AddSubview (this.updates_text_field);
            ContentView.AddSubview (this.credits_text_field);
            ContentView.AddSubview (this.website_link);
            ContentView.AddSubview (this.credits_link);
            ContentView.AddSubview (this.report_problem_link);
            ContentView.AddSubview (this.debug_log_link);
        }
Ejemplo n.º 3
0
        private void CreateAbout()
        {
            Image image = new Image () {
                Width  = 640,
                Height = 260
            };

            image.Source = PryanetUIHelpers.GetImageSource ("about");

            Label version = new Label () {
                Content    = "version " + Controller.RunningVersion,
                FontSize   = 11,
                Foreground = new SolidColorBrush (Colors.White)
            };

            this.updates = new Label () {
                Content    = "Checking for updates...",
                FontSize   = 11,
                Foreground = new SolidColorBrush (Color.FromArgb (128, 255, 255, 255))
            };

            TextBlock credits = new TextBlock () {
                FontSize     = 11,
                Foreground   = new SolidColorBrush (Colors.White),
                Text         = "SparkleShare Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others.\n" +
                    "PryanetShare Copyright © 2013–" + DateTime.Now.Year + " Pryanet Ltd.\n"
                    "\n" +
                    "PryanetShare is Open Source software powered by SparkleShare. You are free to use, modify, " +
                    "and redistribute it under the GNU General Public License version 3 or later.",
                TextWrapping = TextWrapping.Wrap,
                Width        = 318
            };

            PryanetLink website_link = new PryanetLink ("Website", Controller.WebsiteLinkAddress);
            PryanetLink credits_link = new PryanetLink ("Credits", Controller.CreditsLinkAddress);
            PryanetLink report_problem_link = new PryanetLink ("Report a problem", Controller.ReportProblemLinkAddress);
            PryanetLink debug_log_link = new PryanetLink ("Debug log", Controller.DebugLogLinkAddress);

            Canvas canvas = new Canvas ();

            canvas.Children.Add (image);
            Canvas.SetLeft (image, 0);
            Canvas.SetTop (image, 0);

            canvas.Children.Add (version);
            Canvas.SetLeft (version, 289);
            Canvas.SetTop (version, 92);

            canvas.Children.Add (this.updates);
            Canvas.SetLeft (this.updates, 289);
            Canvas.SetTop (this.updates, 109);

            canvas.Children.Add (credits);
            Canvas.SetLeft (credits, 294);
            Canvas.SetTop (credits, 142);

            canvas.Children.Add (website_link);
            Canvas.SetLeft (website_link, 289);
            Canvas.SetTop (website_link, 222);

            canvas.Children.Add (credits_link);
            Canvas.SetLeft (credits_link, 289 + website_link.ActualWidth + 60);
            Canvas.SetTop (credits_link, 222);

            canvas.Children.Add (report_problem_link);
            Canvas.SetLeft (report_problem_link, 289 + website_link.ActualWidth + credits_link.ActualWidth + 115);
            Canvas.SetTop (report_problem_link, 222);

            canvas.Children.Add (debug_log_link);
            Canvas.SetLeft (debug_log_link, 289 + website_link.ActualWidth + credits_link.ActualWidth +
                report_problem_link.ActualWidth + 220);
            Canvas.SetTop (debug_log_link, 222);

            Content = canvas;
        }

        #endregion Methods
    }