[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Font dialog
From:       pierre.stirnweiss_koffice () gadz ! org
Date:       2005-06-06 19:06:49
Message-ID: 200506062106.14143.pierre.stirnweiss_koffice () gadz ! org
[Download RAW message or body]

Ok, here it is. What is included:

- ui files for the tabs of the Font dialog
- corresponding implementation files (subclassing the ui generated classes)
- a local copy (modified) of kfontdialog (.h .cc). Needed to add a possibility 
to hide the font preview in the KFontChooser.
- a new class: KoFontDialogPreview. This provides the preview frame for all 
visual properties of the dialog: font family, style, size. font and 
background color, shadow, underlining and strikethrough, capitalisation, 
sub/superscript. The draw function might need some optimisation, hints 
welcome.

The following files are touched by the patch:
- koFontDia (.h, .cc, _p.h). This one is actually completelly changed. The 
KoFontChooser is gone and the tabs are in separate files.
- kotextformat (.h, .cc). Added AlignCustom, changed the order of the 
QStringList for underlining and strikethrough type to match the enum order. 
save() and load() have been modified to accomodate for the AlignCustom.
- kotextparag (.cc) When AlignNormal, offset is not taken into account 
anymore. AlignCustom is there for this.
- koStylist (.h .cc), KoFontChooser is gone so there was some changes needed 
for this.

Everything goes into lib/kotext. patch applies to kotext folder.

I think that's about it. The stuff compiles and there doesn't seem to be a bug 
in KWord's behaviour.

I am enabling the relative text spinbox even when subscript or superscript is 
enabled to be consistant with OASIS. Offset from baseline is now only enabled 
when Custom alignment is selected.

Please let me know your remarks, this is the biggest piece of C++ (actually 
apart from two 1 liner patches, this is my only C++ piece).

Pierre

On Monday 06 June 2005 10:38, pierre.stirnweiss_koffice@gadz.org wrote:
> On Monday 06 June 2005 08:13, Thomas Zander wrote:
> > On Monday 6 June 2005 00:29, pierre.stirnweiss_koffice@gadz.org wrote:
> > > Ok, I think I have not made myself clear enough. On using KWord I was a
> > > bit puzzled by the fact one could set sub/super and an offset from
> > > baseline and that they were additive (the exact offset of a text with
> > > subscript plus offset of 4 is unknown to the user). I think it would be
> > > more logical that sub/super would set a preset default value, and that
> > > "manual" offset and relative size would be for a "custom" text
> > > position.
> >
> > I don't follow; are you saying that as soon as I enable sub/super script
> > the offset-spinbox should be altered?
> > The whole idea of sub/superscript is to do that automatically, otherwise
> > we could just have left them out and enabled the "relative size" spinbox
> > by default.
> >
> > No, the checkbox of sub/superscript should imply an offset unknown to the
> > user.
>
> No the problem is that when you click on subscript or superscript, you are
> still able to add an offset from that spin box. To my mind that spin box
> should be only enabled in a "custom" setting. What I meant is that the
> current GUI is IMHO not coherent: you have a "subscript" button to set a
> default value if you want a quick (or simple) action and you have a spinbox
> to set a "manual" offset for advanced precise placement. The problem is
> that they are additive and linked together.
>
> > > > Hmm, strange. We can definitely draw text with an offset even if it's
> > > > not subscript/superscript, the painting code handles it; so why not
> > > > allow it... Ah, save() is for OASIS, not for old XML. I think this is
> > > > simply a bug in KoTextFormat::save(). OK if I fix it to save the
> > > > offset there?
> > >
> > > Yes but if I read the OASIS spec right, the offset can be either
> > > sub/super or a % value. So setting sub/super and an offset value will
> > > not be able to be saved in an OASIS file format (one has to drop either
> > > the sub/super or the value).
> >
> > That actually makes sense from a user perspective; a user chooses from
> > sub,- superscript or manual offset. Not any combination at the same time.
> > I suggest to alter the GUI to reflect that.
>
> This is exactly what I am doing. My problem is not with position itself but
> with relative size. To my mind, it should follow the same logic. ie:
> sub/super will set a default value that you cannot change and "custom" will
> allow you to tweak it with the spinbox.
> But then you have the problem of OASIS which allows "super 58%". If the
> default value for superscript is 66%. You either have to change 58% size to
> 66% (to respect the superscript default) or modify super to a actual %
> figure (as in a "custom text position"), but then you modify the original
> intention of the user.
>
> > > sub/super button would set a predefined value (without the
> > > possibility of changing them) and that "manually" set values would
> > > belong to a "custom" text position.
> >
> > Sounds good; just make sure the spinbox is disabled and filled with 0
> > when you click on the sub or superscript options (which should naturally
> > be radiobuttons, not checkboxes acting like radiobuttons)
>
> Yes this is what I have: Normal, Subscript, Superscript, Custom radio
> buttons.
>
> > If in doubt; I can create a designer UI to show what I mean, if you are
> > willing to work on that.
>
> I already have all ui files for the entire font dialog plus the coding
> behind. I even have a font dialog preview that preview every visual
> settings (font, size, color, shadow, underline...).
> I just want to tweak this particular behavior to an acceptable standard
> before submitting the whole thing for approbation.
>
> Pierre
>
> _______________________________________________
> koffice-devel mailing list
> koffice-devel@kde.org
> https://mail.kde.org/mailman/listinfo/koffice-devel

["font_dia.tar.bz2" (application/x-tbz)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic