Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 0daf6f5

Browse files
committed
[NuGet] Ensure the file license dialog looks the same when displayed
Showing the file license dialog from the License Acceptance dialog was showing the dialog with the native Xamarin.Mac toolkit but the Manage NuGet packages dialog was using the non-native toolkit (GTK#). Now the file license dialog is always launched with the native toolkit. Also removed the horizontal scrollbar since this seems to cause the text to unwrap using the native window.
1 parent c0032c8 commit 0daf6f5

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,11 @@ protected override void Dispose (bool disposing)
237237
static void ShowFileDialog (LinkLabel label)
238238
{
239239
var licenseFileText = (LicenseFileText)label.Tag;
240-
var dialog = new LicenseFileDialog (licenseFileText);
241-
dialog.Run (label.ParentWindow);
240+
Xwt.Toolkit.NativeEngine.Invoke (delegate {
241+
using (var dialog = new LicenseFileDialog (licenseFileText)) {
242+
dialog.Run (label.ParentWindow);
243+
}
244+
});
242245
}
243246
}
244247
}

main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseFileDialog.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void Build ()
5454
Title = licenseFileText.LicenseHeader;
5555

5656
var scrollView = new ScrollView ();
57+
scrollView.HorizontalScrollPolicy = ScrollPolicy.Never;
5758
Content = scrollView;
5859

5960
textView = new RichTextView ();

main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,8 +1306,11 @@ void PackageLicenseNavigateToUrl (object sender, NavigateToUrlEventArgs e)
13061306
var licenseFileText = packageLicenseLink.Tag as LicenseFileText;
13071307
if (licenseFileText != null) {
13081308
e.SetHandled ();
1309-
var dialog = new LicenseFileDialog (licenseFileText);
1310-
dialog.Run (this);
1309+
Toolkit.NativeEngine.Invoke (delegate {
1310+
using (var dialog = new LicenseFileDialog (licenseFileText)) {
1311+
dialog.Run (this);
1312+
}
1313+
});
13111314
}
13121315
}
13131316

0 commit comments

Comments
 (0)