Resolved issue #808. New feature. Global line width option.
--HG-- branch : develop
This commit is contained in:
parent
7fedd20319
commit
6c438f92e0
|
@ -44,6 +44,7 @@
|
||||||
- [#414] Add features from Qt Windows Extras.
|
- [#414] Add features from Qt Windows Extras.
|
||||||
- [#807] Issue with "Intersection" passmark.
|
- [#807] Issue with "Intersection" passmark.
|
||||||
- [#667] Check for updates - Test version.
|
- [#667] Check for updates - Test version.
|
||||||
|
- [#808] New feature. Global line width option.
|
||||||
|
|
||||||
# Version 0.5.1
|
# Version 0.5.1
|
||||||
- [#683] Tool Seam allowance's dialog is off screen on small resolutions.
|
- [#683] Tool Seam allowance's dialog is off screen on small resolutions.
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include "../ifc/xml/vabstractpattern.h"
|
#include "../ifc/xml/vabstractpattern.h"
|
||||||
#include "../dialogdatetimeformats.h"
|
#include "../dialogdatetimeformats.h"
|
||||||
#include "../dialogknownmaterials.h"
|
#include "../dialogknownmaterials.h"
|
||||||
#include "../vmisc/def.h"
|
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
|
@ -58,7 +57,8 @@ QStringList ComboBoxAllStrings(QComboBox *combo)
|
||||||
PreferencesPatternPage::PreferencesPatternPage(QWidget *parent)
|
PreferencesPatternPage::PreferencesPatternPage(QWidget *parent)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
ui(new Ui::PreferencesPatternPage),
|
ui(new Ui::PreferencesPatternPage),
|
||||||
m_knownMaterials()
|
m_knownMaterials(),
|
||||||
|
m_oldLineUnit(Unit::Mm)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
@ -70,6 +70,27 @@ PreferencesPatternPage::PreferencesPatternPage(QWidget *parent)
|
||||||
ui->doubleSpinBoxCurveApproximation->setMaximum(maxCurveApproximationScale);
|
ui->doubleSpinBoxCurveApproximation->setMaximum(maxCurveApproximationScale);
|
||||||
ui->undoCount->setValue(settings->GetUndoCount());
|
ui->undoCount->setValue(settings->GetUndoCount());
|
||||||
|
|
||||||
|
//----------------------- Unit setup
|
||||||
|
InitUnits();
|
||||||
|
connect(ui->comboBoxLineWidthUnit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
|
||||||
|
{
|
||||||
|
const Unit lineUnit = static_cast<Unit>(ui->comboBoxLineWidthUnit->currentData().toInt());
|
||||||
|
const qreal value = UnitConvertor(ui->doubleSpinBoxLineWidth->value(), m_oldLineUnit, lineUnit);
|
||||||
|
ui->doubleSpinBoxLineWidth->setDecimals(lineUnit == Unit::Mm ? 1 : 6);
|
||||||
|
ui->doubleSpinBoxLineWidth->setMinimum(UnitConvertor(ui->doubleSpinBoxLineWidth->minimum(), m_oldLineUnit,
|
||||||
|
lineUnit));
|
||||||
|
ui->doubleSpinBoxLineWidth->setMaximum(UnitConvertor(ui->doubleSpinBoxLineWidth->maximum(), m_oldLineUnit,
|
||||||
|
lineUnit));
|
||||||
|
ui->doubleSpinBoxLineWidth->setValue(value);
|
||||||
|
m_oldLineUnit = lineUnit;
|
||||||
|
});
|
||||||
|
|
||||||
|
m_oldLineUnit = static_cast<Unit>(ui->comboBoxLineWidthUnit->currentData().toInt());
|
||||||
|
ui->doubleSpinBoxLineWidth->setDecimals(m_oldLineUnit == Unit::Mm ? 1 : 6);
|
||||||
|
ui->doubleSpinBoxLineWidth->setMinimum(UnitConvertor(VCommonSettings::MinimalLineWidth(), Unit::Mm, m_oldLineUnit));
|
||||||
|
ui->doubleSpinBoxLineWidth->setMaximum(UnitConvertor(VCommonSettings::MaximalLineWidth(), Unit::Mm, m_oldLineUnit));
|
||||||
|
ui->doubleSpinBoxLineWidth->setValue(UnitConvertor(settings->GetLineWidth(), Unit::Mm, m_oldLineUnit));
|
||||||
|
|
||||||
InitDefaultSeamAllowance();
|
InitDefaultSeamAllowance();
|
||||||
InitLabelDateTimeFormats();
|
InitLabelDateTimeFormats();
|
||||||
|
|
||||||
|
@ -98,6 +119,7 @@ void PreferencesPatternPage::Apply()
|
||||||
// Scene antialiasing
|
// Scene antialiasing
|
||||||
settings->SetGraphicalOutput(ui->graphOutputCheck->isChecked());
|
settings->SetGraphicalOutput(ui->graphOutputCheck->isChecked());
|
||||||
settings->SetCurveApproximationScale(ui->doubleSpinBoxCurveApproximation->value());
|
settings->SetCurveApproximationScale(ui->doubleSpinBoxCurveApproximation->value());
|
||||||
|
settings->SetLineWidth(UnitConvertor(ui->doubleSpinBoxLineWidth->value(), m_oldLineUnit, Unit::Mm));
|
||||||
qApp->getSceneView()->setRenderHint(QPainter::Antialiasing, ui->graphOutputCheck->isChecked());
|
qApp->getSceneView()->setRenderHint(QPainter::Antialiasing, ui->graphOutputCheck->isChecked());
|
||||||
qApp->getSceneView()->setRenderHint(QPainter::SmoothPixmapTransform, ui->graphOutputCheck->isChecked());
|
qApp->getSceneView()->setRenderHint(QPainter::SmoothPixmapTransform, ui->graphOutputCheck->isChecked());
|
||||||
|
|
||||||
|
@ -198,6 +220,21 @@ void PreferencesPatternPage::InitComboBoxFormats(QComboBox *box, const QStringLi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void PreferencesPatternPage::InitUnits()
|
||||||
|
{
|
||||||
|
ui->comboBoxLineWidthUnit->addItem(tr("Millimiters"), static_cast<int>(Unit::Mm));
|
||||||
|
ui->comboBoxLineWidthUnit->addItem(tr("Inches"), static_cast<int>(Unit::Inch));
|
||||||
|
|
||||||
|
// set default unit
|
||||||
|
const Unit defUnit = QLocale().measurementSystem() == QLocale::MetricSystem ? Unit::Mm : Unit::Inch;
|
||||||
|
const qint32 indexUnit = ui->comboBoxLineWidthUnit->findData(static_cast<int>(defUnit));
|
||||||
|
if (indexUnit != -1)
|
||||||
|
{
|
||||||
|
ui->comboBoxLineWidthUnit->setCurrentIndex(indexUnit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void PreferencesPatternPage::CallDateTimeFormatEditor(const T &type, const QStringList &predefinedFormats,
|
void PreferencesPatternPage::CallDateTimeFormatEditor(const T &type, const QStringList &predefinedFormats,
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#define PREFERENCESPATTERNPAGE_H
|
#define PREFERENCESPATTERNPAGE_H
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include "../vmisc/def.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
@ -57,9 +58,11 @@ private:
|
||||||
Q_DISABLE_COPY(PreferencesPatternPage)
|
Q_DISABLE_COPY(PreferencesPatternPage)
|
||||||
Ui::PreferencesPatternPage *ui;
|
Ui::PreferencesPatternPage *ui;
|
||||||
QStringList m_knownMaterials;
|
QStringList m_knownMaterials;
|
||||||
|
Unit m_oldLineUnit;
|
||||||
|
|
||||||
void InitLabelDateTimeFormats();
|
void InitLabelDateTimeFormats();
|
||||||
void InitComboBoxFormats(QComboBox *box, const QStringList &items, const QString ¤tFormat);
|
void InitComboBoxFormats(QComboBox *box, const QStringList &items, const QString ¤tFormat);
|
||||||
|
void InitUnits();
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void CallDateTimeFormatEditor(const T &type, const QStringList &predefinedFormats,
|
void CallDateTimeFormatEditor(const T &type, const QStringList &predefinedFormats,
|
||||||
|
|
|
@ -76,6 +76,49 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Bold line width</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Line width:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxLineWidth">
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="decimals">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBoxLineWidthUnit"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -4694,8 +4694,7 @@ void MainWindow::Preferences()
|
||||||
connect(dlg.data(), &DialogPreferences::UpdateProperties, toolOptions,
|
connect(dlg.data(), &DialogPreferences::UpdateProperties, toolOptions,
|
||||||
&VToolOptionsPropertyBrowser::RefreshOptions);
|
&VToolOptionsPropertyBrowser::RefreshOptions);
|
||||||
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, &MainWindow::ToolBarStyles);
|
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, &MainWindow::ToolBarStyles);
|
||||||
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, &MainWindow::RefreshDetailsLabel);
|
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, [this](){emit doc->FullUpdateFromFile();});
|
||||||
connect(dlg.data(), &DialogPreferences::UpdateProperties, this, [](){VPattern::RefreshCurves();});
|
|
||||||
QGuiApplication::restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
|
|
||||||
if (guard->exec() == QDialog::Accepted)
|
if (guard->exec() == QDialog::Accepted)
|
||||||
|
|
|
@ -597,7 +597,7 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer)
|
||||||
|
|
||||||
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
||||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||||
painter.setPen(QPen(Qt::black, widthMainLine, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
painter.setPen(QPen(Qt::black, qApp->Settings()->WidthMainLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -786,25 +786,6 @@ void MainWindowsNoGUI::PrintTiled()
|
||||||
LayoutPrint();
|
LayoutPrint();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief RefreshDetailsLabel call to ecalculate piece labels. For example after changing a font.
|
|
||||||
*/
|
|
||||||
void MainWindowsNoGUI::RefreshDetailsLabel()
|
|
||||||
{
|
|
||||||
const QHash<quint32, VPiece> *list = pattern->DataPieces();
|
|
||||||
QHash<quint32, VPiece>::const_iterator i = list->constBegin();
|
|
||||||
while (i != list->constEnd())
|
|
||||||
{
|
|
||||||
if (VToolSeamAllowance *tool = qobject_cast<VToolSeamAllowance*>(VAbstractPattern::getTool(i.key())))
|
|
||||||
{
|
|
||||||
tool->UpdatePatternInfo();
|
|
||||||
tool->UpdateDetailLabel();
|
|
||||||
}
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QVector<VLayoutPiece> MainWindowsNoGUI::PrepareDetailsForLayout(const QHash<quint32, VPiece> &details)
|
QVector<VLayoutPiece> MainWindowsNoGUI::PrepareDetailsForLayout(const QHash<quint32, VPiece> &details)
|
||||||
{
|
{
|
||||||
|
@ -848,7 +829,8 @@ QIcon MainWindowsNoGUI::ScenePreview(int i) const
|
||||||
QPainter painter(&image);
|
QPainter painter(&image);
|
||||||
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
||||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||||
painter.setPen(QPen(Qt::black, widthMainLine, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
painter.setPen(QPen(Qt::black, qApp->Settings()->WidthMainLine(), Qt::SolidLine, Qt::RoundCap,
|
||||||
|
Qt::RoundJoin));
|
||||||
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
||||||
scenes.at(i)->render(&painter, r, r, Qt::IgnoreAspectRatio);
|
scenes.at(i)->render(&painter, r, r, Qt::IgnoreAspectRatio);
|
||||||
painter.end();
|
painter.end();
|
||||||
|
@ -934,7 +916,7 @@ void MainWindowsNoGUI::SvgFile(const QString &name, QGraphicsRectItem *paper, QG
|
||||||
painter.begin(&generator);
|
painter.begin(&generator);
|
||||||
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
||||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||||
painter.setPen(QPen(Qt::black, widthHairLine, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
painter.setPen(QPen(Qt::black, qApp->Settings()->WidthHairLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
||||||
scene->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio);
|
scene->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio);
|
||||||
painter.end();
|
painter.end();
|
||||||
|
@ -954,7 +936,7 @@ void MainWindowsNoGUI::PngFile(const QString &name, QGraphicsRectItem *paper, QG
|
||||||
QPainter painter(&image);
|
QPainter painter(&image);
|
||||||
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
||||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||||
painter.setPen(QPen(Qt::black, widthMainLine, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
painter.setPen(QPen(Qt::black, qApp->Settings()->WidthMainLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
||||||
scene->render(&painter, r, r, Qt::IgnoreAspectRatio);
|
scene->render(&painter, r, r, Qt::IgnoreAspectRatio);
|
||||||
image.save(name);
|
image.save(name);
|
||||||
|
@ -1004,7 +986,7 @@ void MainWindowsNoGUI::PdfFile(const QString &name, QGraphicsRectItem *paper, QG
|
||||||
}
|
}
|
||||||
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
painter.setFont( QFont( "Arial", 8, QFont::Normal ) );
|
||||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||||
painter.setPen(QPen(Qt::black, widthMainLine, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
painter.setPen(QPen(Qt::black, qApp->Settings()->WidthMainLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
||||||
scene->render(&painter, r, r, Qt::IgnoreAspectRatio);
|
scene->render(&painter, r, r, Qt::IgnoreAspectRatio);
|
||||||
painter.end();
|
painter.end();
|
||||||
|
@ -1460,7 +1442,8 @@ bool MainWindowsNoGUI::IsLayoutGrayscale() const
|
||||||
QImage image(target.size(), QImage::Format_RGB32);
|
QImage image(target.size(), QImage::Format_RGB32);
|
||||||
image.fill(Qt::white);
|
image.fill(Qt::white);
|
||||||
QPainter painter(&image);
|
QPainter painter(&image);
|
||||||
painter.setPen(QPen(Qt::black, widthMainLine, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
painter.setPen(QPen(Qt::black, qApp->Settings()->WidthMainLine(), Qt::SolidLine, Qt::RoundCap,
|
||||||
|
Qt::RoundJoin));
|
||||||
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
painter.setBrush ( QBrush ( Qt::NoBrush ) );
|
||||||
scenes.at(i)->render(&painter, target, paper->rect(), Qt::KeepAspectRatio);
|
scenes.at(i)->render(&painter, target, paper->rect(), Qt::KeepAspectRatio);
|
||||||
painter.end();
|
painter.end();
|
||||||
|
|
|
@ -60,7 +60,6 @@ public slots:
|
||||||
void PrintPreviewTiled();
|
void PrintPreviewTiled();
|
||||||
void PrintOrigin();
|
void PrintOrigin();
|
||||||
void PrintTiled();
|
void PrintTiled();
|
||||||
void RefreshDetailsLabel();
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void ExportFMeasurementsToCSV();
|
void ExportFMeasurementsToCSV();
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -530,20 +530,6 @@ void VPattern::LiteParseIncrements()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VPattern::RefreshCurves()
|
|
||||||
{
|
|
||||||
QHash<quint32, VDataTool*>::const_iterator i = tools.constBegin();
|
|
||||||
while (i != tools.constEnd())
|
|
||||||
{
|
|
||||||
if (VAbstractSpline *vTool = qobject_cast<VAbstractSpline *>(i.value()))
|
|
||||||
{
|
|
||||||
vTool->FullUpdateFromFile();
|
|
||||||
}
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
int VPattern::ElementsToParse() const
|
int VPattern::ElementsToParse() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -107,8 +107,6 @@ public:
|
||||||
|
|
||||||
void LiteParseIncrements();
|
void LiteParseIncrements();
|
||||||
|
|
||||||
static void RefreshCurves();
|
|
||||||
|
|
||||||
static const QString AttrReadOnly;
|
static const QString AttrReadOnly;
|
||||||
|
|
||||||
int ElementsToParse() const;
|
int ElementsToParse() const;
|
||||||
|
|
|
@ -70,6 +70,7 @@ const QString settingPatternHideMainPath = QStringLiteral("pattern/hi
|
||||||
const QString settingDoublePassmark = QStringLiteral("pattern/doublePassmark");
|
const QString settingDoublePassmark = QStringLiteral("pattern/doublePassmark");
|
||||||
const QString settingPatternDefaultSeamAllowance = QStringLiteral("pattern/defaultSeamAllowance");
|
const QString settingPatternDefaultSeamAllowance = QStringLiteral("pattern/defaultSeamAllowance");
|
||||||
const QString settingPatternLabelFont = QStringLiteral("pattern/labelFont");
|
const QString settingPatternLabelFont = QStringLiteral("pattern/labelFont");
|
||||||
|
const QString settingPatternLineWidth = QStringLiteral("pattern/lineWidth");
|
||||||
const QString settingPatternCurveApproximationScale = QStringLiteral("pattern/curveApproximationScale");
|
const QString settingPatternCurveApproximationScale = QStringLiteral("pattern/curveApproximationScale");
|
||||||
const QString settingPatternShowCurveDetails = QStringLiteral("pattern/showCurveDetails");
|
const QString settingPatternShowCurveDetails = QStringLiteral("pattern/showCurveDetails");
|
||||||
|
|
||||||
|
@ -98,6 +99,7 @@ const QString settingLabelUserTimeFormats = QStringLiteral("label/userTimeFormat
|
||||||
// Reading settings file is very expensive, cache curve approximation to speed up getting value
|
// Reading settings file is very expensive, cache curve approximation to speed up getting value
|
||||||
qreal curveApproximationCached = -1;
|
qreal curveApproximationCached = -1;
|
||||||
QString localeCached = QString();
|
QString localeCached = QString();
|
||||||
|
qreal lineWidthCached = 0;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QStringList ClearFormats(const QStringList &predefinedFormats, QStringList formats)
|
QStringList ClearFormats(const QStringList &predefinedFormats, QStringList formats)
|
||||||
|
@ -1053,3 +1055,34 @@ void VCommonSettings::SetShowCurveDetails(bool value)
|
||||||
{
|
{
|
||||||
setValue(settingPatternShowCurveDetails, value);
|
setValue(settingPatternShowCurveDetails, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
qreal VCommonSettings::GetLineWidth() const
|
||||||
|
{
|
||||||
|
if (lineWidthCached <= 0)
|
||||||
|
{
|
||||||
|
lineWidthCached = qBound(VCommonSettings::MinimalLineWidth(), value(settingPatternLineWidth, 1.2).toDouble(),
|
||||||
|
VCommonSettings::MaximalLineWidth());
|
||||||
|
}
|
||||||
|
|
||||||
|
return lineWidthCached;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VCommonSettings::SetLineWidth(qreal width)
|
||||||
|
{
|
||||||
|
lineWidthCached = qBound(VCommonSettings::MinimalLineWidth(), width, VCommonSettings::MaximalLineWidth());
|
||||||
|
setValue(settingPatternLineWidth, lineWidthCached);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
qreal VCommonSettings::WidthMainLine() const
|
||||||
|
{
|
||||||
|
return GetLineWidth() / 25.4 * PrintDPI;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
qreal VCommonSettings::WidthHairLine() const
|
||||||
|
{
|
||||||
|
return WidthMainLine()/3.0;
|
||||||
|
}
|
||||||
|
|
|
@ -194,8 +194,34 @@ public:
|
||||||
|
|
||||||
bool IsShowCurveDetails() const;
|
bool IsShowCurveDetails() const;
|
||||||
void SetShowCurveDetails(bool value);
|
void SetShowCurveDetails(bool value);
|
||||||
|
|
||||||
|
static qreal DefaultLineWidth();
|
||||||
|
static qreal MinimalLineWidth();
|
||||||
|
static qreal MaximalLineWidth();
|
||||||
|
qreal GetLineWidth() const;
|
||||||
|
void SetLineWidth(qreal width);
|
||||||
|
qreal WidthMainLine() const;
|
||||||
|
qreal WidthHairLine() const;
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VCommonSettings)
|
Q_DISABLE_COPY(VCommonSettings)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
inline qreal VCommonSettings::DefaultLineWidth()
|
||||||
|
{
|
||||||
|
return 1.2; // mm
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
inline qreal VCommonSettings::MinimalLineWidth()
|
||||||
|
{
|
||||||
|
return 0.5; // mm
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
inline qreal VCommonSettings::MaximalLineWidth()
|
||||||
|
{
|
||||||
|
return 5.0; // mm
|
||||||
|
}
|
||||||
|
|
||||||
#endif // VCOMMONSETTINGS_H
|
#endif // VCOMMONSETTINGS_H
|
||||||
|
|
|
@ -95,7 +95,8 @@ QPainterPath VAbstractSpline::shape() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VAbstractSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void VAbstractSpline::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
const qreal width = ScaleWidth(m_isHovered ? widthMainLine : widthHairLine, SceneScale(scene()));
|
const qreal width = ScaleWidth(m_isHovered ? qApp->Settings()->WidthMainLine() : qApp->Settings()->WidthHairLine(),
|
||||||
|
SceneScale(scene()));
|
||||||
|
|
||||||
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
|
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(m_id);
|
||||||
setPen(QPen(CorrectColor(this, curve->GetColor()), width, LineStyleToPenStyle(curve->GetPenStyle()), Qt::RoundCap));
|
setPen(QPen(CorrectColor(this, curve->GetColor()), width, LineStyleToPenStyle(curve->GetPenStyle()), Qt::RoundCap));
|
||||||
|
|
|
@ -76,7 +76,7 @@ VToolLinePoint::VToolLinePoint(VAbstractPattern *doc, VContainer *data, const qu
|
||||||
QPointF point1 = static_cast<QPointF>(*data->GeometricObject<VPointF>(basePointId));
|
QPointF point1 = static_cast<QPointF>(*data->GeometricObject<VPointF>(basePointId));
|
||||||
QPointF point2 = static_cast<QPointF>(*data->GeometricObject<VPointF>(id));
|
QPointF point2 = static_cast<QPointF>(*data->GeometricObject<VPointF>(id));
|
||||||
mainLine = new VScaledLine(QLineF(point1 - point2, QPointF()), this);
|
mainLine = new VScaledLine(QLineF(point1 - point2, QPointF()), this);
|
||||||
mainLine->SetBasicWidth(widthHairLine);
|
mainLine->SetBoldLine(false);
|
||||||
mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,14 +132,14 @@ void VToolLinePoint::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLinePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
void VToolLinePoint::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
|
||||||
{
|
{
|
||||||
mainLine->SetBasicWidth(widthMainLine);
|
mainLine->SetBoldLine(true);
|
||||||
VToolSinglePoint::hoverEnterEvent(event);
|
VToolSinglePoint::hoverEnterEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLinePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
void VToolLinePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
{
|
{
|
||||||
mainLine->SetBasicWidth(widthHairLine);
|
mainLine->SetBoldLine(false);
|
||||||
VToolSinglePoint::hoverLeaveEvent(event);
|
VToolSinglePoint::hoverLeaveEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,8 @@ QString VToolLine::getTagName() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void VToolLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
const qreal width = ScaleWidth(m_isHovered ? widthMainLine : widthHairLine, SceneScale(scene()));
|
const qreal width = ScaleWidth(m_isHovered ? qApp->Settings()->WidthMainLine() : qApp->Settings()->WidthHairLine(),
|
||||||
|
SceneScale(scene()));
|
||||||
|
|
||||||
setPen(QPen(CorrectColor(this, lineColor), width, LineStyleToPenStyle(m_lineType)));
|
setPen(QPen(CorrectColor(this, lineColor), width, LineStyleToPenStyle(m_lineType)));
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ QString VToolPiecePath::getTagName() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPiecePath::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void VToolPiecePath::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
qreal width = widthHairLine;
|
qreal width = qApp->Settings()->WidthHairLine();
|
||||||
|
|
||||||
const qreal scale = SceneScale(scene());
|
const qreal scale = SceneScale(scene());
|
||||||
if (scale > 1)
|
if (scale > 1)
|
||||||
|
|
|
@ -909,7 +909,7 @@ void VToolSeamAllowance::SaveRotateGrainline(qreal dRot, const QPointF& ptPos)
|
||||||
void VToolSeamAllowance::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void VToolSeamAllowance::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
QPen toolPen = pen();
|
QPen toolPen = pen();
|
||||||
toolPen.setWidthF(ScaleWidth(widthHairLine, SceneScale(scene())));
|
toolPen.setWidthF(ScaleWidth(qApp->Settings()->WidthHairLine(), SceneScale(scene())));
|
||||||
|
|
||||||
setPen(toolPen);
|
setPen(toolPen);
|
||||||
m_seamAllowance->setPen(toolPen);
|
m_seamAllowance->setPen(toolPen);
|
||||||
|
|
|
@ -55,7 +55,7 @@ VisPieceSpecialPoints::VisPieceSpecialPoints(const VContainer *data, QGraphicsIt
|
||||||
supportColor2(Qt::darkGreen)
|
supportColor2(Qt::darkGreen)
|
||||||
{
|
{
|
||||||
m_rectItem = InitItem<VCurvePathItem>(supportColor2, this);
|
m_rectItem = InitItem<VCurvePathItem>(supportColor2, this);
|
||||||
m_rectItem->SetWidth(widthHairLine);
|
m_rectItem->SetWidth(qApp->Settings()->WidthHairLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -35,8 +35,6 @@
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
|
|
||||||
static const qreal defPointRadiusPixel = (2./*mm*/ / 25.4) * PrintDPI;
|
static const qreal defPointRadiusPixel = (2./*mm*/ / 25.4) * PrintDPI;
|
||||||
const qreal widthMainLine = (1.2/*mm*/ / 25.4) * PrintDPI;
|
|
||||||
const qreal widthHairLine = widthMainLine/3.0;
|
|
||||||
const qreal minVisibleFontSize = 5;
|
const qreal minVisibleFontSize = 5;
|
||||||
|
|
||||||
qreal SceneScale(QGraphicsScene *scene)
|
qreal SceneScale(QGraphicsScene *scene)
|
||||||
|
|
|
@ -32,8 +32,6 @@
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
|
|
||||||
extern const qreal widthMainLine;
|
|
||||||
extern const qreal widthHairLine;
|
|
||||||
extern const qreal minVisibleFontSize;
|
extern const qreal minVisibleFontSize;
|
||||||
|
|
||||||
class QGraphicsScene;
|
class QGraphicsScene;
|
||||||
|
|
|
@ -28,41 +28,43 @@
|
||||||
|
|
||||||
#include "scalesceneitems.h"
|
#include "scalesceneitems.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
#include "../vmisc/vabstractapplication.h"
|
||||||
|
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VScaledLine::VScaledLine(QGraphicsItem *parent)
|
VScaledLine::VScaledLine(QGraphicsItem *parent)
|
||||||
: QGraphicsLineItem(parent),
|
: QGraphicsLineItem(parent),
|
||||||
basicWidth(widthMainLine)
|
m_isBoldLine(true)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VScaledLine::VScaledLine(const QLineF &line, QGraphicsItem *parent)
|
VScaledLine::VScaledLine(const QLineF &line, QGraphicsItem *parent)
|
||||||
: QGraphicsLineItem(line, parent),
|
: QGraphicsLineItem(line, parent),
|
||||||
basicWidth(widthMainLine)
|
m_isBoldLine(true)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VScaledLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void VScaledLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
QPen lPen = pen();
|
QPen lPen = pen();
|
||||||
lPen.setWidthF(ScaleWidth(basicWidth, SceneScale(scene())));
|
lPen.setWidthF(ScaleWidth(m_isBoldLine ? qApp->Settings()->WidthMainLine() : qApp->Settings()->WidthHairLine(),
|
||||||
|
SceneScale(scene())));
|
||||||
setPen(lPen);
|
setPen(lPen);
|
||||||
|
|
||||||
PaintWithFixItemHighlightSelected<QGraphicsLineItem>(this, painter, option, widget);
|
PaintWithFixItemHighlightSelected<QGraphicsLineItem>(this, painter, option, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qreal VScaledLine::GetBasicWidth() const
|
bool VScaledLine::IsBoldLine() const
|
||||||
{
|
{
|
||||||
return basicWidth;
|
return m_isBoldLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VScaledLine::SetBasicWidth(const qreal &value)
|
void VScaledLine::SetBoldLine(bool bold)
|
||||||
{
|
{
|
||||||
basicWidth = value;
|
m_isBoldLine = bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -74,7 +76,7 @@ VScaledEllipse::VScaledEllipse(QGraphicsItem *parent)
|
||||||
void VScaledEllipse::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void VScaledEllipse::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
{
|
{
|
||||||
const qreal scale = SceneScale(scene());
|
const qreal scale = SceneScale(scene());
|
||||||
const qreal width = ScaleWidth(widthMainLine, scale);
|
const qreal width = ScaleWidth(qApp->Settings()->WidthMainLine(), scale);
|
||||||
|
|
||||||
QPen visPen = pen();
|
QPen visPen = pen();
|
||||||
visPen.setWidthF(width);
|
visPen.setWidthF(width);
|
||||||
|
|
|
@ -46,13 +46,13 @@ public:
|
||||||
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
QWidget *widget = nullptr) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
qreal GetBasicWidth() const;
|
bool IsBoldLine() const;
|
||||||
void SetBasicWidth(const qreal &value);
|
void SetBoldLine(bool bold);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VScaledLine)
|
Q_DISABLE_COPY(VScaledLine)
|
||||||
|
|
||||||
qreal basicWidth;
|
bool m_isBoldLine;
|
||||||
};
|
};
|
||||||
|
|
||||||
class VScaledEllipse : public QGraphicsEllipseItem
|
class VScaledEllipse : public QGraphicsEllipseItem
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
|
|
||||||
#include "../vwidgets/global.h"
|
#include "../vwidgets/global.h"
|
||||||
#include "../vgeometry/vgobject.h"
|
#include "../vgeometry/vgobject.h"
|
||||||
|
#include "../vmisc/vabstractapplication.h"
|
||||||
#include "vmaingraphicsscene.h"
|
#include "vmaingraphicsscene.h"
|
||||||
#include "vmaingraphicsview.h"
|
#include "vmaingraphicsview.h"
|
||||||
#include "vgraphicssimpletextitem.h"
|
#include "vgraphicssimpletextitem.h"
|
||||||
|
@ -258,7 +259,7 @@ void VControlPointSpline::Init()
|
||||||
this->setZValue(100);
|
this->setZValue(100);
|
||||||
|
|
||||||
controlLine = new VScaledLine(this);
|
controlLine = new VScaledLine(this);
|
||||||
controlLine->SetBasicWidth(widthHairLine);
|
controlLine->SetBoldLine(false);
|
||||||
controlLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
controlLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
||||||
controlLine->setVisible(false);
|
controlLine->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "vcurvepathitem.h"
|
#include "vcurvepathitem.h"
|
||||||
#include "../vwidgets/global.h"
|
#include "../vwidgets/global.h"
|
||||||
#include "../vgeometry/vabstractcurve.h"
|
#include "../vgeometry/vabstractcurve.h"
|
||||||
|
#include "../vmisc/vabstractapplication.h"
|
||||||
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
@ -37,9 +38,8 @@ VCurvePathItem::VCurvePathItem(QGraphicsItem *parent)
|
||||||
: QGraphicsPathItem(parent),
|
: QGraphicsPathItem(parent),
|
||||||
m_directionArrows(),
|
m_directionArrows(),
|
||||||
m_points(),
|
m_points(),
|
||||||
m_defaultWidth(widthMainLine)
|
m_defaultWidth(qApp->Settings()->WidthMainLine())
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QPainterPath VCurvePathItem::shape() const
|
QPainterPath VCurvePathItem::shape() const
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
#include "../vmisc/vabstractapplication.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -117,7 +118,7 @@ void VMainGraphicsScene::InitOrigins()
|
||||||
{
|
{
|
||||||
origins.clear();
|
origins.clear();
|
||||||
|
|
||||||
QPen originsPen(Qt::green, widthHairLine, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
|
QPen originsPen(Qt::green, qApp->Settings()->WidthHairLine(), Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
|
||||||
QBrush axisTextBrush(Qt::green);
|
QBrush axisTextBrush(Qt::green);
|
||||||
const qreal arrowAngle = 35.0;
|
const qreal arrowAngle = 35.0;
|
||||||
const qreal arrowLength = 12.0;
|
const qreal arrowLength = 12.0;
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "vscenepoint.h"
|
#include "vscenepoint.h"
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vabstractapplication.h"
|
||||||
#include "../vgeometry/vpointf.h"
|
#include "../vgeometry/vpointf.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "vgraphicssimpletextitem.h"
|
#include "vgraphicssimpletextitem.h"
|
||||||
|
@ -53,7 +54,7 @@ VScenePoint::VScenePoint(QGraphicsItem *parent)
|
||||||
{
|
{
|
||||||
m_namePoint = new VGraphicsSimpleTextItem(this);
|
m_namePoint = new VGraphicsSimpleTextItem(this);
|
||||||
m_lineName = new VScaledLine(this);
|
m_lineName = new VScaledLine(this);
|
||||||
m_lineName->SetBasicWidth(widthHairLine);
|
m_lineName->SetBoldLine(false);
|
||||||
m_lineName->setLine(QLineF(0, 0, 1, 0));
|
m_lineName->setLine(QLineF(0, 0, 1, 0));
|
||||||
m_lineName->setVisible(false);
|
m_lineName->setVisible(false);
|
||||||
|
|
||||||
|
@ -173,7 +174,8 @@ void VScenePoint::RefreshLine()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VScenePoint::ScaleMainPenWidth(qreal scale)
|
void VScenePoint::ScaleMainPenWidth(qreal scale)
|
||||||
{
|
{
|
||||||
const qreal width = ScaleWidth(m_isHovered ? widthMainLine : widthHairLine, scale);
|
const qreal width = ScaleWidth(m_isHovered ? qApp->Settings()->WidthMainLine() : qApp->Settings()->WidthHairLine(),
|
||||||
|
scale);
|
||||||
|
|
||||||
setPen(QPen(CorrectColor(this, m_baseColor), width));
|
setPen(QPen(CorrectColor(this, m_baseColor), width));
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,16 +175,7 @@ void VSimpleCurve::keyReleaseEvent(QKeyEvent *event)
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VSimpleCurve::ScalePenWidth()
|
void VSimpleCurve::ScalePenWidth()
|
||||||
{
|
{
|
||||||
qreal width = 1;
|
qreal width = m_isHovered ? qApp->Settings()->WidthMainLine() : qApp->Settings()->WidthHairLine();
|
||||||
if (m_isHovered)
|
|
||||||
{
|
|
||||||
width = widthMainLine;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
width = widthHairLine;
|
|
||||||
}
|
|
||||||
|
|
||||||
width = ScaleWidth(width, SceneScale(scene()));
|
width = ScaleWidth(width, SceneScale(scene()));
|
||||||
setPen(QPen(CorrectColor(this, m_curve->GetColor()), width, LineStyleToPenStyle(m_curve->GetPenStyle())));
|
setPen(QPen(CorrectColor(this, m_curve->GetColor()), width, LineStyleToPenStyle(m_curve->GetPenStyle())));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user