11 #include "geometrytip.h"
13 namespace KWinInternal
16 GeometryTip::GeometryTip(
const XSizeHints* xSizeHints,
bool save_under ):
17 TQLabel(NULL,
"twingeometry" )
22 setFrameStyle( TQFrame::Raised | TQFrame::StyledPanel );
23 setAlignment( AlignCenter | AlignTop );
24 sizeHints = xSizeHints;
27 XSetWindowAttributes attr;
28 attr.save_under = True;
29 XChangeWindowAttributes( tqt_xdisplay(), winId(), CWSaveUnder, &attr );
33 GeometryTip::~GeometryTip()
37 void GeometryTip::setGeometry(
const TQRect& geom )
40 int h = geom.height();
44 if (sizeHints->flags & PResizeInc)
46 w = ( w - sizeHints->base_width ) / sizeHints->width_inc;
47 h = ( h - sizeHints->base_height ) / sizeHints->height_inc;
53 pos.sprintf(
"%+d,%+d<br>(<b>%d x %d</b>)",
54 geom.x(), geom.y(), w, h );
57 move( geom.x() + ((geom.width() - width()) / 2),
58 geom.y() + ((geom.height() - height()) / 2) );
63 #include "geometrytip.moc"