Opened 5 years ago

Closed 5 years ago

#12047 closed defect (fixed)

header button can draw it's text out of the rect of the button

Reported by: marosig Owned by:
Priority: normal Milestone:
Component: GUI-generic Version: stable-latest
Keywords: wxRendererGeneric Cc: robind
Blocked By: Blocking:
Patch: yes

Description

DrawHeaderButtonContents function can draw the header column's title out of it's rect and it did not take care of right margin.

Attachments (1)

renderergeneric_headerbuttoncontent.patch download (1.2 KB) - added by marosig 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by marosig

comment:1 Changed 5 years ago by VZ

(In [64307]) Add more tests for wxRendererNative::DrawHeaderButton().

Test using icons and bitmaps in it. Also show the native/default
implementation of this method and not only our overridden version.

See #12047.

comment:2 Changed 5 years ago by vadz

  • Cc robind added

I've tried to fix all of the problems I could find in this code as there were a lot of them: not only text could be drawn outside the rectangle, but the bitmap and icon as well and the computations of the bitmap alignment were wrong too.

Robin, it would be nice if you could review my changes (as the original author of it, I believe).

comment:3 Changed 5 years ago by VZ

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

(In [64309]) Clip drawing in wxRendererGeneric::DrawHeaderButtonContents().

Clip drawing of the icon and bitmap to the header rectangle.

Don't clip the text because we already ellipsize it to avoid overflowing but
do the ellipsization correctly, using wxControl::Ellipsize() instead of the
simple (and wrong) duplicated version here.

Also correct and simplify the alignment calculations.

Closes #12047.

Note: See TracTickets for help on using tickets.