Button component width

Aleix Pol aleixpol at kde.org
Wed Oct 3 14:02:32 UTC 2012


On Wednesday 03 October 2012 14:35:22 Marco Martin wrote:
> 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
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel

Well, this means that a button can't be <132px without forcing a given width. 
I don't see why we'd force a bigger width just for the sake of having a 
default size.

Aleix


More information about the Plasma-devel mailing list