Parker Coates | 6 Oct 08:45
Picon

[PATCH] KDialog::groupSpacingHint()

Hello,

The latest KDE HIG offers using a vertical space of 16 pixels as an
additional method of grouping logically related items in a dialog. [1]
Rather than have this 16 pixel value hardcoded in dozens of different
dialogs, I propose adding a groupSpacingHint() method to the KDialog
class. [2] This is a static method that returns a constant in the same
vein as KDialog::marginHint() and KDialog::spacingHint().

The attached patch adds such a method. Any comments?

Parker

[1] http://techbase.kde.org/Projects/Usability/HIG/Form_Label_Alignment#Grouping_related_options_within_a_GroupBox

[2] I realise that KDialog isn't necessarily the most logical place
for these functions to live, but spacingHint() and marginHint() are
already there and placing groupSpacingHint() anywhere else would be
even less logical.
Attachment (kdialog.diff): text/x-diff, 2771 bytes
Luciano Montanaro | 6 Oct 09:17
Picon

Re: [PATCH] KDialog::groupSpacingHint()

On Mon, Oct 6, 2008 at 8:48 AM, Parker Coates <parker.coates <at> gmail.com> wrote:
> Hello,
>
> The latest KDE HIG offers using a vertical space of 16 pixels as an
> additional method of grouping logically related items in a dialog. [1]
> Rather than have this 16 pixel value hardcoded in dozens of different
> dialogs, I propose adding a groupSpacingHint() method to the KDialog
> class. [2] This is a static method that returns a constant in the same
> vein as KDialog::marginHint() and KDialog::spacingHint().
>
> The attached patch adds such a method. Any comments?
>
> Parker

Having a method to get the spacing is good, since it is something that
should not be hardcoded
(think higher resolution displays or small devices). But wouldn't it
be better to be a property of the style?

In this way it would be possible to use smaller spaces on small
screen/small resolution displays, with a customized style.

Other than that, why is this size specified in pixels? I think the
font size should be involved in its calculation.

Can it be expressed in function of the x height of the "normal" font,
or the linespacing of the "normal" font?

--

-- 
Luciano Montanaro
(Continue reading)

Parker Coates | 6 Oct 15:36
Picon

Re: [PATCH] KDialog::groupSpacingHint()

On Mon, Oct 6, 2008 at 03:17, Luciano Montanaro  wrote:
> Having a method to get the spacing is good, since it is something that
> should not be hardcoded
> (think higher resolution displays or small devices). But wouldn't it
> be better to be a property of the style?
>
> In this way it would be possible to use smaller spaces on small
> screen/small resolution displays, with a customized style.
>
> Other than that, why is this size specified in pixels? I think the
> font size should be involved in its calculation.
>
> Can it be expressed in function of the x height of the "normal" font,
> or the linespacing of the "normal" font?

Those suggestions are all well and good, but they're also way out of
my league. I'm just a selfish app developer proposing to add this
method so that I can call it in my own code. I don't care where the
number comes from, as long as I don't have to hardcode it. ;)

Making all three of these methods theme and/or font size dependent
seems like a good idea to me, and if someone with the time and
know-how wanted to do so, that'd be great. But it seems unlikely to
happen before 4.2, so I'm proposing we use a constant 16 pixels for
the moment, so code can start using it. If a more advance solution
happens in the future, everyone will get the benefits automatically.

Parker

(Continue reading)

Parker Coates | 15 Oct 16:54
Picon

Re: [PATCH] KDialog::groupSpacingHint()

On Mon, Oct 6, 2008 at 02:48, Parker Coates <parker.coates <at> gmail.com> wrote:
> Hello,
>
> The latest KDE HIG offers using a vertical space of 16 pixels as an
> additional method of grouping logically related items in a dialog. [1]
> Rather than have this 16 pixel value hardcoded in dozens of different
> dialogs, I propose adding a groupSpacingHint() method to the KDialog
> class. [2] This is a static method that returns a constant in the same
> vein as KDialog::marginHint() and KDialog::spacingHint().
>
> The attached patch adds such a method. Any comments?
>
> Parker

It's been a week.

I was really hoping to get some concrete approval. Should I take the
lack of disapproval as a sign of approval? I'd really rather not push
my change if no one agrees that it's a good idea.

Parker

Picon
Favicon

Re: [PATCH] KDialog::groupSpacingHint()

Hi Parker,

Am Mittwoch, 15. Oktober 2008, um 16:54 Uhr, schrieb Parker Coates:
> On Mon, Oct 6, 2008 at 02:48, Parker Coates <parker.coates <at> gmail.com> wrote:
> > Hello,
> >
> > The latest KDE HIG offers using a vertical space of 16 pixels as an
> > additional method of grouping logically related items in a dialog. [1]
> > Rather than have this 16 pixel value hardcoded in dozens of different
> > dialogs, I propose adding a groupSpacingHint() method to the KDialog
> > class. [2] This is a static method that returns a constant in the same
> > vein as KDialog::marginHint() and KDialog::spacingHint().
> >
> > The attached patch adds such a method. Any comments?
> >
> > Parker
>
> It's been a week.
>
> I was really hoping to get some concrete approval. Should I take the
> lack of disapproval as a sign of approval? I'd really rather not push
> my change if no one agrees that it's a good idea.

You could help if you list a number of places where it would be used, that is 
often good reasoning :)

I agree with Luciano, that layout sizes should be rather given by points or mm 
than pixel sizes, because the other layout dominating size comes from the 
fonts (perhaps a KDE5 idea). But as KDialog::marginHint(), 
KDialog::spacingHint() and (almost) everything with QStyle are also only 
(Continue reading)

Parker Coates | 18 Oct 19:47
Picon

Re: [PATCH] KDialog::groupSpacingHint()

On Wed, Oct 15, 2008 at 10:54, Parker Coates <parker.coates <at> gmail.com> wrote:
> On Mon, Oct 6, 2008 at 02:48, Parker Coates <parker.coates <at> gmail.com> wrote:
>> Hello,
>>
>> The latest KDE HIG offers using a vertical space of 16 pixels as an
>> additional method of grouping logically related items in a dialog. [1]
>> Rather than have this 16 pixel value hardcoded in dozens of different
>> dialogs, I propose adding a groupSpacingHint() method to the KDialog
>> class. [2] This is a static method that returns a constant in the same
>> vein as KDialog::marginHint() and KDialog::spacingHint().
>>
>> The attached patch adds such a method. Any comments?
>>
>> Parker
>
> It's been a week.
>
> I was really hoping to get some concrete approval. Should I take the
> lack of disapproval as a sign of approval? I'd really rather not push
> my change if no one agrees that it's a good idea.

Committed.


Gmane