From a627ea557e8c2722d7b9176cb56d1afadf3e1e65 Mon Sep 17 00:00:00 2001 From: Ivan Pelipenko Date: Sat, 23 May 2020 16:26:24 +0300 Subject: [PATCH] DrawTools, ui fix (line mode) --- qad/CMakeLists.txt | 5 ++++- qad/blockview/drawtools.cpp | 12 ++++++------ qad/blockview/drawtools.h | 2 +- qad/blockview/drawtools.ui | 32 ++++++++++++++++---------------- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/qad/CMakeLists.txt b/qad/CMakeLists.txt index 6b30462..ef416c2 100644 --- a/qad/CMakeLists.txt +++ b/qad/CMakeLists.txt @@ -48,7 +48,10 @@ endif() # Version -set(QAD_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/qad_version.h") +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/qad_version.h") + file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/qad_version.h") +endif() +set(QAD_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/qad_version.h") set_version(QAD MAJOR "${_QAD_MAJOR}" MINOR "${_QAD_MINOR}" diff --git a/qad/blockview/drawtools.cpp b/qad/blockview/drawtools.cpp index 391c2d0..01631ea 100644 --- a/qad/blockview/drawtools.cpp +++ b/qad/blockview/drawtools.cpp @@ -509,7 +509,7 @@ void DrawTools::alignClicked() { } -void DrawTools::setTollButtonsEnabled(bool pen, bool brush, bool wid_hei) { +void DrawTools::setToolButtonsEnabled(bool pen, bool brush, bool wid_hei) { ui->labelPen->setEnabled(pen); ui->colorButtonPen->setEnabled(pen); ui->labelBrush->setEnabled(brush); @@ -620,7 +620,7 @@ void DrawTools::selectionChanged() { font_dlg.blockSignals(true); font_dlg.setCurrentFont(itext->font()); font_dlg.blockSignals(false); - setTollButtonsEnabled(true, false, false); + setToolButtonsEnabled(true, false, false); ui->widgetAlign2->setEnabled(false); ui->widgetAlign9->setEnabled(false); size_item.assignObject(itext); @@ -631,7 +631,7 @@ void DrawTools::selectionChanged() { font_dlg.blockSignals(true); font_dlg.setCurrentFont(iatext->font()); font_dlg.blockSignals(false); - setTollButtonsEnabled(true, false, false); + setToolButtonsEnabled(true, false, false); foreach (QAction * a, menu_hor.actions()) a->setChecked(false); foreach (QAction * a, menu_ver.actions()) a->setChecked(false); align = iatext->alignment(); @@ -655,7 +655,7 @@ void DrawTools::selectionChanged() { } else if (ipixmap) { ui->stackedProperties->setCurrentIndex(2); ui->spinScale->setValue(sqrt(ipixmap->transform().determinant())); - setTollButtonsEnabled(false, false, false); + setToolButtonsEnabled(false, false, false); size_item.assignObject(ipixmap); } else if (irect || iell) { ui->stackedProperties->setCurrentIndex(1); @@ -675,7 +675,7 @@ void DrawTools::selectionChanged() { ui->colorButtonBrush->setColor(ishape->brush().color()); ui->spinThick->setValue(ishape->pen().widthF()); ui->comboLineStyle->setCurrentIndex(qMin((int)ishape->pen().style(), ui->comboLineStyle->count() - 1)); - setTollButtonsEnabled(true, true, true); + setToolButtonsEnabled(true, true, true); if (resize_enabled) size_item.assignObject(ishape); } @@ -684,7 +684,7 @@ void DrawTools::selectionChanged() { ui->colorButtonPen->setColor(iline->pen().color()); ui->spinThick->setValue(iline->pen().widthF()); ui->comboLineStyle->setCurrentIndex(qMin((int)iline->pen().style(), ui->comboLineStyle->count() - 1)); - setTollButtonsEnabled(true, false, false); + setToolButtonsEnabled(true, false, false); if (resize_enabled) size_item.assignObject(iline); } else { diff --git a/qad/blockview/drawtools.h b/qad/blockview/drawtools.h index 57ec4bd..a0f0042 100644 --- a/qad/blockview/drawtools.h +++ b/qad/blockview/drawtools.h @@ -94,7 +94,7 @@ protected: bool eventFilter(QObject * o, QEvent * e); QAction * newAction(const QString & text, const QIcon & icon, int type); - void setTollButtonsEnabled(bool pen, bool brush, bool wid_hei); + void setToolButtonsEnabled(bool pen, bool brush, bool wid_hei); void blockPropSignals(bool block_); void actionAlignTrigger(bool vert, Qt::AlignmentFlag value); void emitZAvailabe(QGraphicsItem * item = 0); diff --git a/qad/blockview/drawtools.ui b/qad/blockview/drawtools.ui index 86776a9..849f997 100644 --- a/qad/blockview/drawtools.ui +++ b/qad/blockview/drawtools.ui @@ -526,22 +526,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - @@ -561,6 +545,22 @@ + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 20 + 20 + + + +