[MonoDevelop] patch to make the OptionPanel widgets use TextEditorProperties directly

Jeffrey Stedfast fejj at novell.com
Thu Feb 22 14:33:36 EST 2007


In order for GeneralTextEditorPanel.cs to be able to use
TextEditorProperties for the font name, I had to add some extra property
methods to TextEditorProperties:


the UseDefault*Font props, I think, make higher level code a bit nicer
to read rather than having to compare FontName to __default_monospace
and/or __default_sans ourselves.

As far as setting these bool values... not sure I like what the code
does if you do:

TextEditorProperties.UseDefaultSansFont = false;

for example. Since that doesn't really give us a font choice to set it
to, I just defaulted it to __monospace_font. Likewise, for setting
UseDefaultMonoFont to false.

Settings these props really only makes sense if you set them to true.

So... is there a cleaner way to do this? I see a couple of options:

1. leave it as-is... "it's fine"
2. modify them to do nothing if value != true.
3. maybe something like:

enum EditorFontType {

struct EditorFont {
	EditorFontType type;
	string name;

and we could have getter/setter props that return/take EditorFont

This way might be cleaner...

Any preference?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: text-editor-properties.patch
Type: text/x-patch
Size: 17594 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/monodevelop-list/attachments/20070222/9c790a25/attachment.bin 

More information about the Monodevelop-list mailing list