Button component width

Marco Martin notmart at gmail.com
Wed Oct 3 12:35:22 UTC 2012


On Wednesday 03 October 2012, Aleix Pol wrote:
> Hi Plasma!
> I've been trying to figure out why buttons had a weirdly big size by
> default, forcing me to set a random width that will be rarely appropriate
> when translating.
> 
> I decided to look into the code and that's what I found [1]. There I can

that code is a bit old btw, i changed it today using implicitsize instead of 
paintedwidth to decide text elide when necessary

> see that we are getting the max between the size we want and
> theme.defaultFont.mSize.width*12 which looks totally random to me. Maybe we
> can just remove this part? Or at least leave it to 1 m so that it's never
> 0?
> 

it's a reasonable size espressed in characters (policy i unfortunately still 
didn't make clear enough there is that pixel sizes should be avoided as much 
as possible).
ideally, width and height of buttons or similar elements should never be 
specified by the code that uses them, but alwas stay the default, that is 
implicitWidth/height.

12 characters is a reasonable default width for a button (and the sane length 
a button text should have), what should be done is to gather all those sizes 
in a single private file so they are consistent among different widgets

Cheers,
Marco Martin


More information about the Plasma-devel mailing list