Exemple #1
0
        nfloat AddGuideCard(string name, string comment, nfloat orgy, nfloat fontSize)
        {
            nfloat pointy = orgy;

            if (!string.IsNullOrEmpty(name))
            {
                nfloat cellHeight = Utility.HeightWrappedToWidth(name, fontSize, UpdateInfoLabel.Frame.Width);
                pointy = orgy - cellHeight;

                var rect   = new CGRect(6, pointy, UpdateInfoLabel.Frame.Width, cellHeight);
                var nameTF = new NSTextField(rect);
                nameTF.Cell.Bordered        = false;
                nameTF.Cell.Font            = NSFont.SystemFontOfSize(fontSize);
                nameTF.Cell.TextColor       = Utility.ColorWithHexColorValue("#666666", 0.85f);
                nameTF.Cell.BackgroundColor = NSColor.Clear;
                nameTF.Cell.Wraps           = true;
                nameTF.StringValue          = name;
                nameTF.AutoresizingMask     = NSViewResizingMask.MaxYMargin | NSViewResizingMask.MinXMargin;
                nameTF.Cell.Editable        = false;

                WhatNewInfoView.AddSubview(nameTF);
                pointy -= CELL_VERTICAL_SPACEING;
            }

            if (!string.IsNullOrEmpty(comment))
            {
                nfloat height = Utility.HeightWrappedToWidth(comment, fontSize, UpdateInfoLabel.Frame.Width);
                pointy -= height;

                var rect      = new CGRect(6, pointy, UpdateInfoLabel.Frame.Width, height);
                var commentTF = new NSTextField(rect);
                commentTF.Cell.Bordered        = false;
                commentTF.Cell.BackgroundColor = NSColor.Clear;
                commentTF.Cell.Font            = NSFont.SystemFontOfSize(fontSize);
                commentTF.Cell.TextColor       = Utility.ColorWithRGB(102, 102, 102);
                commentTF.StringValue          = comment;
                commentTF.AutoresizingMask     = NSViewResizingMask.MaxYMargin | NSViewResizingMask.MinXMargin;
                commentTF.Cell.Editable        = false;
                WhatNewInfoView.AddSubview(commentTF);

                pointy -= CELL_VERTICAL_SPACEING;
            }

            return(pointy);
        }