void AddPackage(PackageLicenseViewModel package) { var titleBox = new VBox(); titleBox.Spacing = 0; titleBox.MarginBottom = 4; titleBox.PackStart(new Label { Markup = string.Format("<span weight='bold'>{0}</span> – {1}", package.Id, package.Author), }); var licenseLabel = new LinkLabel(GettextCatalog.GetString("View License")); licenseLabel.Uri = package.LicenseUrl; licenseLabel.LinkClicked += (sender, e) => IdeServices.DesktopService.ShowUrl(e.Target.AbsoluteUri); titleBox.PackStart(licenseLabel); var rowBox = new HBox(); rowBox.Margin = rowMargin; var icon = new ImageView(ImageService.GetIcon("md-package", Gtk.IconSize.Dnd)); if (package.IconUrl != null && !string.IsNullOrEmpty(package.IconUrl.AbsoluteUri)) { imageLoader.LoadFrom(package.IconUrl, icon); } rowBox.PackStart(icon); rowBox.PackStart(titleBox, true); packagesList.PackStart(rowBox); }
string CreatePackageMarkup(PackageLicenseViewModel package) { return(String.Format( "<span weight='bold'>{0}</span>\t{1}\n<a href='{2}'>{3}</a>", package.Id, package.GetAuthors(), package.LicenseUrl, GettextCatalog.GetString("View License") )); }
void AddPackage(PackageLicenseViewModel package) { var label = new Label() { Xalign = 0, Yalign = 0, Xpad = 5, Ypad = 5, Wrap = true, Markup = CreatePackageMarkup(package) }; GtkWorkarounds.SetLinkHandler(label, DesktopService.ShowUrl); this.packagesVBox.PackStart(label, false, false, 0); }
void DisplayPackage(PackageLicenseViewModel viewModel) { this.packageIdLabel.Markup = GetPackageIdMarkup(viewModel.Id); this.packageSummaryTextView.Buffer.Text = viewModel.Summary; this.licenseHyperlinkWidget.Uri = viewModel.LicenseUrl.ToString(); }
public PackageLicenseWidget(PackageLicenseViewModel viewModel) { this.Build(); this.DisplayPackage(viewModel); }
void AddPackageWidget(PackageLicenseViewModel package) { var widget = new PackageLicenseWidget2(package); this.packagesVBox.Add(widget); }