| 1025 | } |
| 1026 | |
| 1027 | bool Widget::paintEvent(Graphics* graphics) |
| 1028 | { |
| 1029 | // For transparent widgets we have to draw the parent first. |
| 1030 | if (isTransparent()) { |
| 1031 | #if _DEBUG |
| 1032 | // In debug mode we can fill the area with Red so we know if |
| 1033 | // we are drawing the parent correctly. |
| 1034 | graphics->fillRect(gfx::rgba(255, 0, 0), clientBounds()); |
| 1035 | #endif |
| 1036 | |
| 1037 | enableFlags(HIDDEN); |
| 1038 | |
| 1039 | if (parent()) { |
| 1040 | gfx::Region rgn(parent()->bounds()); |
| 1041 | rgn.createIntersection( |
| 1042 | rgn, |
| 1043 | gfx::Region( |
| 1044 | graphics->getClipBounds().offset( |
| 1045 | graphics->getInternalDeltaX(), |
| 1046 | graphics->getInternalDeltaY()))); |
| 1047 | parent()->paint(graphics, rgn); |
| 1048 | } |
| 1049 | |
| 1050 | disableFlags(HIDDEN); |
| 1051 | } |
| 1052 | |
| 1053 | PaintEvent ev(this, graphics); |
| 1054 | onPaint(ev); // Fire onPaint event |
| 1055 | return ev.isPainted(); |
| 1056 | } |
| 1057 | |
| 1058 | bool Widget::isDoubleBuffered() const |
| 1059 | { |
no test coverage detected