# HG changeset patch # User mwarning # Date 1245278456 0 # Node ID 4bbd9f3d9addaa8864378c2348473dd9ef5790cc # Parent 849b66609571d0ebf0731d5ee5c2b2771711e359 a few fixes diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/arthurstyle.d --- a/demos/shared/arthurstyle.d Wed Jun 17 22:39:42 2009 +0000 +++ b/demos/shared/arthurstyle.d Wed Jun 17 22:40:56 2009 +0000 @@ -38,21 +38,22 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +module arthurstyle; -//import arthurwidgets; import - qt.gui.QLayout, - qt.gui.QWindowsStyle, - qt.gui.QPainter, - qt.gui.QPainterPath, - qt.gui.QPixmapCache, - qt.gui.QRadioButton, - qt.gui.QPushButton, - qt.gui.QGroupBox, - qt.gui.QLinearGradient, - qt.gui.QstyleOptionFrameV2, - qt.gui.QStyleOption; + qt.gui.QLayout, + qt.gui.QWindowsStyle, + qt.gui.QPainter, + qt.gui.QPainterPath, + qt.gui.QPixmapCache, + qt.gui.QRadioButton, + qt.gui.QPushButton, + qt.gui.QGroupBox, + qt.gui.QLinearGradient, + qt.gui.QStyleOption, + qt.gui.QStyleOptionFrameV2; + class ArthurStyle : QWindowsStyle { @@ -74,13 +75,12 @@ { //Q_INIT_RESOURCE(shared); } - - + void drawHoverRect(QPainter painter, QRect r) { qreal h = r.height(); qreal h2 = r.height() / 2.0; - QPainterPath path; + QPainterPath path = new QPainterPath; path.addRect(r.x() + h2, r.y() + 0, r.width() - h2 * 2, r.height()); path.addEllipse(r.x(), r.y(), h, h); path.addEllipse(r.x() + r.width() - h, r.y(), h, h); @@ -91,9 +91,7 @@ painter.drawPath(path); } - - override void drawPrimitive(PrimitiveElement element, QStyleOption option, - QPainter painter, QWidget widget) + override void drawPrimitive(PrimitiveElement element, QStyleOption option, QPainter painter, QWidget widget) { assert(option); switch (element) @@ -153,7 +151,7 @@ mid = cached(":res/images/button_normal_stretch.png"); } painter.drawPixmap(button.rect.topLeft, left); - painter.drawTiledPixmap(new QRect(button.rect.x + left.width, + painter.drawTiledPixmap(QRect(button.rect.x + left.width, button.rect.y, button.rect.width - left.width - right.width, left.height), @@ -168,8 +166,7 @@ break; case PE_FrameGroupBox: - if (QStyleOptionFrameV2 group - = cast(QStyleOptionFrameV2)(option)) { + if (QStyleOptionFrameV2 group = cast(QStyleOptionFrameV2)(option)) { auto r = group.rect; painter.save(); @@ -201,11 +198,9 @@ int topFrameOffset = titleStretch.height()/2 - 2; painter.drawPixmap(r.topLeft() + QPoint(0, topFrameOffset), topLeft); - painter.drawPixmap(r.topRight() - QPoint(topRight.width()-1, 0) - + QPoint(0, topFrameOffset), topRight); + painter.drawPixmap(r.topRight() - QPoint(topRight.width()-1, 0) + QPoint(0, topFrameOffset), topRight); painter.drawPixmap(r.bottomLeft() - QPoint(0, bottomLeft.height()-1), bottomLeft); - painter.drawPixmap(r.bottomRight() - QPoint(bottomRight.width()-1, - bottomRight.height()-1), bottomRight); + painter.drawPixmap(r.bottomRight() - QPoint(bottomRight.width()-1, bottomRight.height()-1), bottomRight); QRect left = r; left.setY(r.y() + topLeft.height() + topFrameOffset); @@ -224,8 +219,7 @@ right.setX(r.right() - rightStretch.width()+1); right.setY(r.y() + topRight.height() + topFrameOffset); right.setWidth(rightStretch.width()); - right.setHeight(r.height() - topRight.height() - - bottomRight.height() - topFrameOffset); + right.setHeight(r.height() - topRight.height() - bottomRight.height() - topFrameOffset); painter.drawTiledPixmap(right, rightStretch); QRect bottom = r; @@ -264,7 +258,7 @@ if ((option.subControls & SC_SliderGroove) && groove.isValid()) { QPixmap grv = cached(":res/images/slider_bar.png"); - painter.drawPixmap(new QRect(groove.x() + 5, groove.y(), + painter.drawPixmap(QRect(groove.x() + 5, groove.y(), groove.width() - 10, grv.height()), grv); } @@ -344,7 +338,7 @@ QPixmap titleRight = cached(":res/images/title_cap_right.png"); QPixmap titleStretch = cached(":res/images/title_stretch.png"); int txt_width = group.fontMetrics.width(group.text) + 20; - rect = new QRect(group.rect.center().x() - txt_width/2 + titleLeft.width(), 0, + rect = QRect(group.rect.center().x() - txt_width/2 + titleLeft.width(), 0, txt_width - titleLeft.width() - titleRight.width(), titleStretch.height()); break; @@ -398,7 +392,7 @@ override void polish(QWidget widget) { if (widget.layout() && cast(QGroupBox)(widget)) { - if (widget.findChildren!(QGroupBox).length == 0) { + if (qFindChildren!(QGroupBox)(widget).length == 0) { widget.layout().setWidgetSpacing(0); // Why setSpacing was renamed to setWidgetSpacing? widget.layout().setMargin(12); } else { @@ -417,7 +411,6 @@ pal.setColor(QPalette.Window, new QColor(241, 241, 241)); widget.setPalette(pal); } - } override void unpolish(QWidget widget) diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/arthurwidgets.d --- a/demos/shared/arthurwidgets.d Wed Jun 17 22:39:42 2009 +0000 +++ b/demos/shared/arthurwidgets.d Wed Jun 17 22:40:56 2009 +0000 @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +module arthurwidgets; import qt.core.QFile, @@ -48,7 +49,6 @@ qt.gui.QTextDocument, qt.gui.QAbstractTextDocumentLayout, qt.gui.QLinearGradient, - qt.gui.QTextBrowser, qt.gui.QBoxLayout, qt.opengl.QGL, diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/hoverpoints.d --- a/demos/shared/hoverpoints.d Wed Jun 17 22:39:42 2009 +0000 +++ b/demos/shared/hoverpoints.d Wed Jun 17 22:40:56 2009 +0000 @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +module hoverpoints; version (QT_OPENGL_SUPPORT) import qt.opengl.QGLWidget; diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/bg_pattern.png Binary file demos/shared/images/bg_pattern.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/button_normal_cap_left.png Binary file demos/shared/images/button_normal_cap_left.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/button_normal_cap_right.png Binary file demos/shared/images/button_normal_cap_right.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/button_normal_stretch.png Binary file demos/shared/images/button_normal_stretch.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/button_pressed_cap_left.png Binary file demos/shared/images/button_pressed_cap_left.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/button_pressed_cap_right.png Binary file demos/shared/images/button_pressed_cap_right.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/button_pressed_stretch.png Binary file demos/shared/images/button_pressed_stretch.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/curve_thing_edit-6.png Binary file demos/shared/images/curve_thing_edit-6.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/frame_bottom.png Binary file demos/shared/images/frame_bottom.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/frame_bottomleft.png Binary file demos/shared/images/frame_bottomleft.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/frame_bottomright.png Binary file demos/shared/images/frame_bottomright.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/frame_left.png Binary file demos/shared/images/frame_left.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/frame_right.png Binary file demos/shared/images/frame_right.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/frame_top.png Binary file demos/shared/images/frame_top.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/frame_topleft.png Binary file demos/shared/images/frame_topleft.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/frame_topright.png Binary file demos/shared/images/frame_topright.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/groupframe_bottom_left.png Binary file demos/shared/images/groupframe_bottom_left.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/groupframe_bottom_right.png Binary file demos/shared/images/groupframe_bottom_right.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/groupframe_bottom_stretch.png Binary file demos/shared/images/groupframe_bottom_stretch.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/groupframe_left_stretch.png Binary file demos/shared/images/groupframe_left_stretch.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/groupframe_right_stretch.png Binary file demos/shared/images/groupframe_right_stretch.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/groupframe_top_stretch.png Binary file demos/shared/images/groupframe_top_stretch.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/groupframe_topleft.png Binary file demos/shared/images/groupframe_topleft.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/groupframe_topright.png Binary file demos/shared/images/groupframe_topright.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/line_dash_dot.png Binary file demos/shared/images/line_dash_dot.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/line_dash_dot_dot.png Binary file demos/shared/images/line_dash_dot_dot.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/line_dashed.png Binary file demos/shared/images/line_dashed.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/line_dotted.png Binary file demos/shared/images/line_dotted.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/line_solid.png Binary file demos/shared/images/line_solid.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/radiobutton-off.png Binary file demos/shared/images/radiobutton-off.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/radiobutton-on.png Binary file demos/shared/images/radiobutton-on.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/radiobutton_off.png Binary file demos/shared/images/radiobutton_off.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/radiobutton_on.png Binary file demos/shared/images/radiobutton_on.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/slider_bar.png Binary file demos/shared/images/slider_bar.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/slider_thumb_off.png Binary file demos/shared/images/slider_thumb_off.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/slider_thumb_on.png Binary file demos/shared/images/slider_thumb_on.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/title_cap_left.png Binary file demos/shared/images/title_cap_left.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/title_cap_right.png Binary file demos/shared/images/title_cap_right.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/images/title_stretch.png Binary file demos/shared/images/title_stretch.png has changed diff -r 849b66609571 -r 4bbd9f3d9add demos/shared/shared.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demos/shared/shared.qrc Wed Jun 17 22:40:56 2009 +0000 @@ -0,0 +1,39 @@ + + + images/button_normal_cap_left.png + images/button_normal_cap_right.png + images/button_normal_stretch.png + images/button_pressed_cap_left.png + images/button_pressed_cap_right.png + images/button_pressed_stretch.png + images/radiobutton-on.png + images/radiobutton_on.png + images/radiobutton_off.png + images/slider_bar.png + images/slider_thumb_on.png + images/groupframe_topleft.png + images/groupframe_topright.png + images/groupframe_bottom_left.png + images/groupframe_bottom_right.png + images/groupframe_top_stretch.png + images/groupframe_bottom_stretch.png + images/groupframe_left_stretch.png + images/groupframe_right_stretch.png + images/frame_topleft.png + images/frame_topright.png + images/frame_bottomleft.png + images/frame_bottomright.png + images/frame_left.png + images/frame_top.png + images/frame_right.png + images/frame_bottom.png + images/title_cap_left.png + images/title_cap_right.png + images/title_stretch.png + images/line_dash_dot.png + images/line_dotted.png + images/line_dashed.png + images/line_solid.png + images/line_dash_dot_dot.png + +