[bt-devel] Eliminate KFontChooser from Configuration Dialog

Eeli Kaikkonen eekaikko at mail.student.oulu.fi
Mon Nov 10 14:54:12 MST 2008


Gary Holmlund wrote:
> I have changed the Configure dialog under the Language tab. The purpose 
> was to remove the KDE KFontChooser and use only Qt. The part I changed 
> is in the dialog below the "Use Custom Font" checkbox. I have written a 
> new class, CFontChooser.
>
>   

The code looks good. Some words about style: personally I prefer

void Class::method()
{
}

over

void Class::method() {

}

It's not important and currently we have both in our code. I also don't 
like names starting with C, I don't know why, but I have used Bt 
(previously BT which should be changed to Bt). I asked if it's OK but 
nobody answered then.

> In writing the new class I had to render text in a web view. I initially 
> used QWebView to do this, however out of the numerous fonts three of 
> them did not render the same as KHTML in the main windows. These fonts 
> were "It wasn't me", Monospace, and Serif. I then put KHTML classes into 
> the CFontChooser which makes all the fonts preview the same as they will 
> be in the main windows.
>
> I put the following  into  cfontchooser.h
> #define USE_KHTML
> //#define USE_QWEBKIT
>
> This allows choosing KDE or QT for the font rendering in the 
> CFontChooser. This will make it easy do eliminate KDE from this class 
> when we eventually eliminate it in the main window. You can enable both 
> of these at the same time and see exactally what looks different between 
> them. KDE rendered text will show up above the Qt rendered text.
>
>   

That's nice, it's easy to change when we leave KHTML.

I would like to see some improvements with layout. The current one is 
good but sizes are not so good. The font size chooser area should be 
narrow. Actually the whole config dialog should be smaller. Fashionable 
mini-laptops have small displays and all dialogs should fit in 800x600 
or even 800x480 minus desktop panel and window decorations (Asus Eeepc 
701). The BibleTime main window is good but the config dialog is way too 
big, and I think it's because of the Languages page. Restructuring the 
whole dialog may be necessary and it's needed anyways as I wrote earlier 
but all parts should be resizeable anyways.

I don't know if the header "Requested Font" is necessary. The widget is 
self-explaining for anyone who has used programs which handle text. 
"Font", "Font style" and "Size" are nice though. "Font" doesn't sound 
correct, actually it means family+style+size or family+style (see 
wikipedia article for font). Qt API uses "family". OpenOffice uses "Font 
Name" in tooltip. I know the KDE class uses "Font" but it doesn't make 
it correct.

Anyways, good work, and it's at least as good as the original.

If you want to move to a next target it could be 
http://devel.bibletime.info/wiki/BibleTime1Refactoring#Commentary_editor_font_chooser. 
After that the Search analysis view needs work, it's half done. Or do 
you have something else in mind? You are already a bit more familiar 
with the code and the application and can maybe propose something.


--Eeli Kaikkonen



More information about the bt-devel mailing list