
On Sun, 2013-02-10 at 18:17 -0800, Jon Cruz wrote:
On Feb 8, 2013, at 9:49 AM, Tavmjong Bah wrote:
Would anybody miss the 'Text and Font' dialog now that we have the style selector in the 'Text' tool toolbar? I started the process of updating the 'Text and Font' dialog to match the Text toolbar but I have discovered that it is going to take quite a bit of work. For example the dialog font selector cannot handle font-family lists, nor does it have an entry box for typing in the name of a font. Both the toolbar and the dialog do mostly the same things but in quite different ways. If we keep the dialog, a helper class should probably be written that encapsulates the common functionality.
I believe that in the abstract we will have need of both the toolbar and a dialog. However, in the short-term we might be able to drop the dialog for a while.
However... we probably want to get some code cleanup in place so that the bulk of the *functional* work is from a few shared data classes and helper classes, and the *ui* work might use a few shared widgets and classes. In the ideal state we could have both the toolbar and the dialog with a very minimal amount of extra code that it not shareable between them.
I have started to work on this. It is going to take awhile. My plan is to move all functionality having to do with manipulating the font-family and font-style (slant, weight, etc) GtkListStore's to the FontLister class (font-lister.h). FontLister will keep track of the selected font-family and style. When font-family changes, it will update the font-style GtkListStore. It will then, when appropriate, update the selected style to the closest previously selected style (e.g. changing "italic" to "oblique").
There is much duplication of code in the text-toolbar, font-selector, text-edit that can be reduced.
Unifying the UI code would be another project.
Tav