public FixedFlatButton(string title, NSView logo = null) { Alignment = NSTextAlignment.Center; WantsLayer = true; BezelStyle = NSBezelStyle.ShadowlessSquare; ShowsBorderOnlyWhileMouseInside = true; Layer.CornerRadius = 3; BackgroundColor = NSColor.Clear; BorderColor = NSColor.White; BorderWidth = 1.0f; Title = ""; if (logo != null) { this.logo = logo; AddSubview(logo); } label = ViewsHelper.CreateLabel(title); label.StringValue = title; label.Alignment = NSTextAlignment.Center; label.TextColor = NSColor.White; label.Font = NSFont.SystemFontOfSize(15); label.SetFrameSize(label.IntrinsicContentSize); AddSubview(label); //WidthAnchor.ConstraintEqualToConstant(FixedButtonWidth).Active = true; //HeightAnchor.ConstraintEqualToConstant(FixedButtonHeight).Active = true; RecalculateSizes(); }
public override IView ConvertToView(FigmaNode currentNode, ViewNode parent, ViewRenderService rendererService) { var figmaText = ((FigmaText)currentNode); var font = figmaText.style.ToFont(); var textField = ViewsHelper.CreateLabel(figmaText.characters, font); textField.Configure(figmaText); var wrapper = new Views.Forms.View(textField); return(wrapper); }