50 #if !defined(QT_NO_QWS_DECORATION_WINDOWS) || defined(QT_PLUGIN) 52 #ifndef QT_NO_IMAGEFORMAT_XPM 169 #endif // QT_NO_IMAGEFORMAT_XPM 188 #ifdef QT_NO_IMAGEFORMAT_XPM 219 int titleHeight = hasTitle ?
qMax(20, fontMetrics.
height()) : 0;
228 region =
QRect(rect.
left() + 2, rect.
top() - titleHeight,
237 rect.
top() - titleHeight,
251 if (hasContextHelp) {
258 if (r.left() > rect.
left() + titleHeight)
265 if (hasMinimize && !isMinimized) {
270 if (r.left() > rect.
left() + titleHeight)
277 if (hasMaximize && !isMaximized) {
280 if (r.left() > rect.
left() + titleHeight)
287 if (hasMinimize && isMinimized) {
292 if (r.left() > rect.
left() + titleHeight)
294 }
else if (hasMaximize && isMaximized) {
297 if (r.left() > rect.
left() + titleHeight)
306 if (r.left() > rect.
left() + titleHeight)
322 if (decorationRegion ==
None)
329 bool paintAll = (decorationRegion == int(
All));
330 if ((paintAll || decorationRegion &
Title && titleRect.
width() > 0) && state ==
Normal 333 QColor fromBrush, toBrush;
336 if (widget ==
qApp->activeWindow() ||
qApp->activeWindow() ==
qApp->activePopupWidget()) {
343 toBrush = fromBrush.
lighter(300);
349 lg.setColorAt(0, fromBrush);
350 lg.setColorAt(1, toBrush);
353 painter->
setPen(titlePen);
355 decorationRegion ^=
Title;
364 QBrush fromBrush, toBrush;
367 if (widget ==
qApp->activeWindow() ||
qApp->activeWindow() ==
qApp->activePopupWidget()) {
377 if (buttonRegion !=
Close && buttonRegion !=
Menu)
381 buttonRegion ==
Menu ? fromBrush : toBrush);
386 if (buttonRegion !=
Menu) {
402 painter->
drawPixmap(brect.
x() + xoff, brect.
y() + yoff, pm);
405 #endif // QT_NO_QWS_DECORATION_WINDOWS || QT_PLUGIN The QPainter class performs low-level painting on widgets and other paint devices.
The QColor class provides colors based on RGB, HSV or CMYK values.
static const char *const win_help_xpm[]
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
QPointer< QWidget > widget
virtual QRegion region(const QWidget *widget, const QRect &rect, int decorationRegion=All)
Returns the region specified by decorationRegion for the top-level widget.
int left() const
Returns the x-coordinate of the rectangle's left edge.
virtual bool paint(QPainter *painter, const QWidget *widget, int decorationRegion=All, DecorationState state=Normal)
Paints the border and title decoration for the top-level widget using the painter provided and the de...
int width() const
Returns the width of the rectangle.
const char ** xpmForRegion(int reg)
Returns a pointer to the X pixmap for the icon specified by region.
static QPalette palette()
Returns the application palette.
QRect boundingRect() const
Returns the bounding rectangle of this region.
int height() const
Returns the height of the rectangle.
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
QRegion region(const QWidget *widget, const QRect &rect, int decorationRegion=All)
Returns the region specified by decorationRegion for the top-level widget.
virtual QRegion region(const QWidget *w, const QRect &rect, int decorationRegion=All)=0
Implement this function to return the region specified by decorationRegion for the given top level wi...
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
static const QRectF boundingRect(const QPointF *points, int pointCount)
static QFontMetrics fontMetrics()
Returns display (screen) font metrics for the application font.
QRegion clipRegion() const
Returns the currently set clip region.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual const char ** xpmForRegion(int region)
Returns a pointer to the X pixmap for the icon specified by region.
void paintButton(QPainter *painter, const QWidget *widget, int buttonRegion, DecorationState state, const QPalette &pal)
Paints a region of the top-level widget.
void qDrawWinPanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
static const char *const win_normalize_xpm[]
static const char *const win_close_xpm[]
The QRegion class specifies a clip region for a painter.
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
virtual ~QDecorationWindows()
int top() const
Returns the y-coordinate of the rectangle's top edge.
QString windowTitleFor(const QWidget *widget) const
bool paint(QPainter *painter, const QWidget *widget, int decorationRegion=All, DecorationState state=Normal)
Paints the border and title decoration for the top-level widget using the painter provided and the de...
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
int right() const
Returns the x-coordinate of the rectangle's right edge.
The QLinearGradient class is used in combination with QBrush to specify a linear gradient brush...
int y() const
Returns the y-coordinate of the rectangle's top edge.
int x() const
Returns the x-coordinate of the rectangle's left edge.
The QPoint class defines a point in the plane using integer precision.
virtual QPixmap pixmapFor(const QWidget *widget, int decorationRegion, int &xoff, int &yoff)
Returns a pointer to the QPixmap for the widget specified by widget and decorationRegion.
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
The QRect class defines a rectangle in the plane using integer precision.
DecorationState
This enum describes the various states of a decoration region.
static const char *const win_minimize_xpm[]
The QPixmap class is an off-screen image representation that can be used as a paint device...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
The QDecorationDefault class is a base class providing default window decorations.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
QColor lighter(int f=150) const
Returns a lighter (or darker) color, but does not change this object.
int height() const
Returns the height of the font.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static const char *const win_maximize_xpm[]
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
The QPalette class contains color groups for each widget state.