diff options
author | Michael Hutchinson <mhutch@xamarin.com> | 2011-09-26 15:20:34 +0400 |
---|---|---|
committer | Michael Hutchinson <mhutch@xamarin.com> | 2011-09-26 15:52:25 +0400 |
commit | 1ae08be3824069ee95ca34cce963eb943a27b3be (patch) | |
tree | 33a5ae2c9cfe8ef5bbfd9abd2870da21da38f149 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts | |
parent | c0aafcd6b26c074b47c63656f1892a859b492ff2 (diff) |
[Ide] Fix some issues with the font editing dialog
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs index 61540688c7..d9371449b9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Fonts/FontChooserPanelWidget.cs @@ -30,7 +30,6 @@ using Gtk; namespace MonoDevelop.Ide.Fonts { - [System.ComponentModel.ToolboxItem(true)] public partial class FontChooserPanelWidget : Gtk.Bin { TreeStore fontStore; @@ -74,18 +73,25 @@ namespace MonoDevelop.Ide.Fonts fontStore.SetValue (iter, colValue, GettextCatalog.GetString ("Default")); return; } - var selectionDialog = new FontSelectionDialog (GettextCatalog.GetString ("Select Font")); - string fontValue = FontService.FilterFontName (GetFont (fontName)); - selectionDialog.SetFontName (fontValue); - selectionDialog.OkButton.Clicked += delegate { + var selectionDialog = new FontSelectionDialog (GettextCatalog.GetString ("Select Font")) { + Modal = true, + DestroyWithParent = true, + TransientFor = this.Toplevel as Gtk.Window + }; + try { + string fontValue = FontService.FilterFontName (GetFont (fontName)); + selectionDialog.SetFontName (fontValue); + if (MessageService.RunCustomDialog (selectionDialog) != (int) Gtk.ResponseType.Ok) { + return; + } fontValue = selectionDialog.FontName; if (fontValue == FontService.FilterFontName (FontService.GetFont (fontName).FontDescription)) fontValue = FontService.GetFont (fontName).FontDescription; SetFont (fontName, fontValue); fontStore.SetValue (iter, colValue, selectionDialog.FontName); - }; - MessageService.ShowCustomDialog (selectionDialog); - selectionDialog.Destroy (); + } finally { + selectionDialog.Destroy (); + } }; comboRenderer.EditingStarted += delegate(object o, EditingStartedArgs args) { |