diff --git a/qad/blockview/blockview.cpp b/qad/blockview/blockview.cpp index 72f124b..b2b9c59 100644 --- a/qad/blockview/blockview.cpp +++ b/qad/blockview/blockview.cpp @@ -38,7 +38,7 @@ void BlockView::_init() { ghost_ = 0; grid_step = 10.; grid_points = 1; - grid_pen = QPen(Qt::lightGray, 1, Qt::NoPen); + grid_pen = QPen(palette().color(QPalette::Mid), 1, Qt::NoPen); thick = 1; thumb_hide_delay = 500; timer_thumb = 0; @@ -799,11 +799,11 @@ void BlockView::scrollContentsBy(int dx, int dy) { void BlockView::drawBackground(QPainter * painter, const QRectF & rect) { - QGraphicsView::drawBackground(painter, rect); +// QGraphicsView::drawBackground(painter, rect); if (mm_thumb) return; float rx, ry, sx = grid_step, sy = grid_step; double scl = qRound(1. / qSqrt(transform().determinant())); - painter->eraseRect(rect); + painter->fillRect(rect, palette().brush(QPalette::Base)); painter->setRenderHint(QPainter::Antialiasing, false); if (scl > 0.) { sx *= scl; diff --git a/qad/graphic/graphic.cpp b/qad/graphic/graphic.cpp index fdf5a93..ba8cbe1 100644 --- a/qad/graphic/graphic.cpp +++ b/qad/graphic/graphic.cpp @@ -102,15 +102,15 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), line_x_min(this), line_x_max curaction = gaMove; selbrush.setStyle(Qt::SolidPattern); selbrush.setColor(QColor(60, 175, 255, 100)); - text_color = Qt::black; - grid_pen = QPen(Qt::gray, 0., Qt::DotLine); + text_color = palette().color(QPalette::WindowText); + grid_pen = QPen(palette().color(QPalette::Button), 0., Qt::DotLine); //graph_pen = QPen(Qt::red); //graph_pen.setCosmetic(true); graphics.append(GraphicType()); curGraphic = 0; - selpen = QPen(Qt::black); + selpen = palette().color(QPalette::WindowText); selpen.setStyle(Qt::DashLine); - back_color = Qt::white; + back_color = palette().color(QPalette::Base); buttons_ = AllButtons; setOpenGL(false); setButtonsPosition(Graphic::Left); diff --git a/qad/graphic/graphic.h b/qad/graphic/graphic.h index 52bcfec..c2412dc 100644 --- a/qad/graphic/graphic.h +++ b/qad/graphic/graphic.h @@ -383,10 +383,10 @@ protected: Graduation grad_x, grad_y; AxisType axis_type_x; double gridx, gridy, history, visible_time, inc_x, mdm, grid_numbers_x, grid_numbers_y, LN2, LN5, LN10; - double eminx, eminy, emaxx, emaxy, pause_phase, gesture_angle, need_mouse_pan; + double eminx, eminy, emaxx, emaxy, pause_phase, gesture_angle; int legy, lastw, lasth, min_repaint_int, min_int, max_int, timer_pause, thick; bool aalias, aupdate, mupdate, grid, guides, isFit, isEmpty, isOGL, isHover, bufferActive, cancel, pause_, isPrinting, gestures; - bool hasLblX, hasLblY, navigation, only_expand_y, only_expand_x, is_lines_update, leg_update, visible_update, fullscr; + bool hasLblX, hasLblY, navigation, only_expand_y, only_expand_x, is_lines_update, leg_update, visible_update, fullscr, need_mouse_pan; protected slots: void canvasPaintEvent();