#15619 closed defect (fixed)

gtk3: wxSpinButton has a very wrong best-size

Reported by: dghart Owned by:
Priority: normal Milestone:
Component: wxGTK Version: stable-latest
Keywords: wxSpinButton gtk3 width Cc:
Blocked By: Blocking:
Patch: yes

Description

Testing a gtk3 build of wxGTK-3.0rc, I've been pleasantly surprised at how good it now is. The samples, and my app, 'just work'; except for theme/theme-engine issues in older gtk versions (debian wheezy, ubuntu 13.04 and 10), and these have disappeared in fedora 19's gtk-3.8.6.

The exception is wxSpinButton. As can be seen in the attached screenshots of the 'widgets' sample, this is far too narrow to be used; on some distros it can't even be identified.

The src/gtk/spinbutt.cpp wxSpinButton::DoGetBestSize sets a hard-coded value and has a FIXME. Presumably the correct size can't easily be deduced from the native GtkSpinButton, as this comes with a compulsory text-entry section. Until a real solution is found, the attached patch sets a better guesstimate. This is correct for debian (kde) and, though it's too small for fedora and ubuntu/unity, it's easily usable. Making it any wider means the text-entry section starts appearing on debian; I feel that's a worse fault, but you may disagree.

Attachments (7)

gtk2FC19.png download (12.2 KB) - added by dghart 11 months ago.
gtk3debianPre.png download (7.5 KB) - added by dghart 11 months ago.
gtk3FC19Pre.png download (9.7 KB) - added by dghart 11 months ago.
gtk3debianPost.png download (7.4 KB) - added by dghart 11 months ago.
gtk3FC19Post.png download (10.8 KB) - added by dghart 11 months ago.
gtk3ubuntu13.10Post.png download (13.1 KB) - added by dghart 11 months ago.
spinbutt.diff download (482 bytes) - added by dghart 11 months ago.

Download all attachments as: .zip

Change History (9)

Changed 11 months ago by dghart

Changed 11 months ago by dghart

Changed 11 months ago by dghart

Changed 11 months ago by dghart

Changed 11 months ago by dghart

Changed 11 months ago by dghart

Changed 11 months ago by dghart

comment:1 Changed 11 months ago by vadz

It would, of course, be better to not hardcode it but I don't really know how to do it, so for now I'll apply the patch as it definitely makes things better. Thanks David!

comment:2 Changed 11 months ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [75096]) Fix wxSpinButton default width under GTK+ 3.

The default GTK+2 width is so small as to make the control unusable under
GTK+3, so use larger (but still hardcoded) width there.

Closes #15619.

Note: See TracTickets for help on using tickets.