Compare commits

...

6 commits

Author SHA1 Message Date
Roman Telezhynskyi 4e05c704cc Fix rotation of piece label when export to DXF AAMA/ASTM. 2024-01-31 18:07:54 +02:00
Roman Telezhynskyi 2a3970559d Fix build. 2024-01-31 17:36:13 +02:00
Roman Telezhynskyi cc92270ecb Prevent stealing focus when scrolling. 2024-01-31 15:15:43 +02:00
Roman Telezhynskyi 1d198db6e9 Fix compatibility with scroll area. 2024-01-31 11:27:23 +02:00
Roman Telezhynskyi e23db69bb0 Remove redundant localizations: en_CA, en_IN. 2024-01-31 10:56:07 +02:00
Roman Telezhynskyi f6e929fbcd Remove mentions of English (India) and English (Canada). 2024-01-31 10:49:09 +02:00
18 changed files with 272 additions and 20 deletions

View file

@ -107,7 +107,6 @@ Name: "fileassoc5"; Description: "{cm:CreateFileAssocVkm}"; GroupDescription: "{
Name: "deletesettings"; Description: "{cm:RemoveAnyExistingSettings}"; GroupDescription: "{cm:ManageSettings}"; Flags: unchecked
[Types]
Name: "full_english"; Description: "{cm:SystemLanguage}"; Languages: english;
;Name: "full_armenian"; Description: "{cm:SystemLanguage}"; Languages: armenian;
Name: "full_brazilianportuguese"; Description: "{cm:SystemLanguage}"; Languages: brazilianportuguese;
;Name: "full_catalan"; Description: "{cm:SystemLanguage}"; Languages: catalan;
@ -139,10 +138,6 @@ Name: "custom"; Description: "{cm:CustomInstallation}"; Flags: iscustom
[Components]
Name: "lang_files"; Description: "{cm:LanguageComponent}"; Types: full custom; Flags: fixed
Name: "lang_files\english"; Description: "English"; Types: full full_english custom; Flags: disablenouninstallwarning
Name: "lang_files\english\us"; Description: "English (United States)"; Types: full full_english custom; Flags: disablenouninstallwarning
Name: "lang_files\english\in"; Description: "English (India)"; Types: full full_english custom; Flags: disablenouninstallwarning
Name: "lang_files\english\ca"; Description: "English (Canada)"; Types: full full_english custom; Flags: disablenouninstallwarning
;Name: "lang_files\armenian"; Description: "Armenian"; Types: full full_armenian custom; Flags: disablenouninstallwarning
Name: "lang_files\brazilianportuguese"; Description: "Brazilian portuguese"; Types: full full_brazilianportuguese custom; Flags: disablenouninstallwarning
;Name: "lang_files\catalan"; Description: "Catalan"; Types: full full_catalan custom; Flags: disablenouninstallwarning
@ -182,11 +177,6 @@ Source: "{#buildDirectory}\VPropertyExplorerLib.dll"; DestDir: "{app}"; Flags: i
Source: "{#buildDirectory}\QMUParserLib.dll"; DestDir: "{app}"; Flags: ignoreversion sign
; Localizations
Source: "{#buildDirectory}\translations\*_en_US.qm"; DestDir: "{app}\translations"; Flags: ignoreversion; Components: lang_files\english\us
Source: "{#buildDirectory}\translations\*_en_IN.qm"; DestDir: "{app}\translations"; Flags: ignoreversion; Components: lang_files\english\in
Source: "{#buildDirectory}\translations\*_en_CA.qm"; DestDir: "{app}\translations"; Flags: ignoreversion; Components: lang_files\english\ca
Source: "{#buildDirectory}\translations\*_en.qm"; DestDir: "{app}\translations"; Flags: ignoreversion; Components: lang_files\english
Source: "{#buildDirectory}\translations\*_uk_UA.qm"; DestDir: "{app}\translations"; Flags: ignoreversion; Components: lang_files\ukrainian
Source: "{#buildDirectory}\translations\*_uk.qm"; DestDir: "{app}\translations"; Flags: ignoreversion; Components: lang_files\ukrainian

View file

@ -32,6 +32,7 @@
#include "../vmisc/dialogs/vshortcutdialog.h"
#include "../vmisc/theme/vtheme.h"
#include "../vmisc/vabstractshortcutmanager.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#include "ui_puzzlepreferencesconfigurationpage.h"
#include <QStyleHints>
@ -43,6 +44,16 @@ PuzzlePreferencesConfigurationPage::PuzzlePreferencesConfigurationPage(QWidget *
{
ui->setupUi(this);
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->langCombo);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxThemeMode);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->undoCount);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->spinBoxDuration);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->spinBoxUpdateInterval);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSensor);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxWheel);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxAcceleration);
InitLanguages(ui->langCombo);
connect(ui->langCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
[this]() { m_langChanged = true; });

View file

@ -59,6 +59,7 @@
#include "../vmisc/theme/vtheme.h"
#include "../vmisc/vsysexits.h"
#include "../vwidgets/vmaingraphicsscene.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#include "dialogs/dialogpuzzlepreferences.h"
#include "dialogs/dialogsavemanuallayout.h"
#include "dialogs/vpdialogabout.h"
@ -333,6 +334,31 @@ VPMainWindow::VPMainWindow(const VPCommandLinePtr &cmd, QWidget *parent)
{
ui->setupUi(this);
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxCurrentPieceBoxPositionX);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxCurrentPieceBoxPositionY);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxCurrentPieceAngle);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxLayoutUnit);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxSheetTemplates);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSheetPaperWidth);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSheetPaperHeight);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSheetMarginTop);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSheetMarginLeft);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSheetMarginRight);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSheetMarginBottom);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSheetGridColWidth);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSheetGridRowHeight);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxTileTemplates);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxTilePaperWidth);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxTilePaperHeight);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxTileMarginTop);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxTileMarginLeft);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxTileMarginRight);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxTileMarginBottom);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxSheetPiecesGap);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxHorizontalScale);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxVerticalScale);
connect(m_layout.data(), &VPLayout::PieceSelectionChanged, this, &VPMainWindow::on_PieceSelectionChanged);
connect(m_layout.data(), &VPLayout::LayoutChanged, this, [this]() { LayoutWasSaved(false); });
connect(m_layout.data(), &VPLayout::PieceTransformationChanged, this,

View file

@ -35,8 +35,10 @@
#include "../vmisc/dialogs/vshortcutdialog.h"
#include "../vmisc/theme/vtheme.h"
#include "../vmisc/vabstractshortcutmanager.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#include "ui_tapepreferencesconfigurationpage.h"
#include <QScrollBar>
#include <QStyleHints>
//---------------------------------------------------------------------------------------------------------------------
@ -49,6 +51,11 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
ui->setupUi(this);
RetranslateUi();
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->langCombo);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxKnownMeasurements);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxThemeMode);
InitLanguages(ui->langCombo);
connect(ui->langCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
[this]() { m_langChanged = true; });

View file

@ -18,8 +18,6 @@ isEmpty(LOCALES){
es_ES \
fi_FI \
en_US \
en_CA \
en_IN \
ro_RO \
zh_CN \
pt_BR \

View file

@ -35,6 +35,7 @@
#include "../vmisc/theme/vtheme.h"
#include "../vmisc/vabstractshortcutmanager.h"
#include "../vmisc/vvalentinasettings.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#include "ui_preferencesconfigurationpage.h"
#include "vcommonsettings.h"
@ -52,6 +53,15 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
ui->setupUi(this);
RetranslateUi();
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->autoTime);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->langCombo);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxPieceLbelLanguage);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->unitCombo);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->labelCombo);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxThemeMode);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxPointerMode);
ui->tabWidget->setCurrentIndex(0);
// Tab General

View file

@ -35,6 +35,7 @@
#include "../vmisc/vabstractvalapplication.h"
#include "../vmisc/vvalentinasettings.h"
#include "../vwidgets/vmaingraphicsview.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#include "svgfont/svgdef.h"
#include "svgfont/vsvgfont.h"
#include "svgfont/vsvgfontengine.h"
@ -74,6 +75,18 @@ PreferencesPatternPage::PreferencesPatternPage(QWidget *parent)
ui->setupUi(this);
RetranslateUi();
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxCurveApproximation);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxLineWidth);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxLineWidthUnit);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->defaultSeamAllowance);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxLabelFontSize);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->fontComboBoxLabelFont);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxSingleLineFont);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxDateFormats);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxTimeFormats);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->spinBoxOpacity);
VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings();
ui->graphOutputCheck->setChecked(settings->GetGraphicalOutput());

View file

@ -30,6 +30,7 @@
#include "../vlayout/vlayoutgenerator.h"
#include "../vmisc/vabstractvalapplication.h"
#include "../vmisc/vvalentinasettings.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#include "ui_dialoglayoutsettings.h"
#include <QMessageBox>
@ -54,6 +55,22 @@ DialogLayoutSettings::DialogLayoutSettings(VLayoutGenerator *generator, QWidget
{
ui->setupUi(this);
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxTemplates);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxPaperWidth);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxPaperHeight);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxPaperSizeUnit);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxPaperSizeUnit);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxLeftField);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxRightField);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxTopField);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxBottomField);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxLayoutWidth);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxLayoutUnit);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->spinBoxNestingTime);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxEfficiency);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->spinBoxMultiplier);
VAbstractValApplication::VApp()->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale())
: setLocale(QLocale::c());
@ -537,7 +554,8 @@ auto DialogLayoutSettings::PageToPixels(qreal value) const -> qreal
auto DialogLayoutSettings::MakeGroupsHelp() -> QString
{
// that is REALLY dummy ... can't figure fast how to automate generation... :/
return tr("\n\tThree groups: big, middle, small = 0;\n\tTwo groups: big, small = 1;\n\tDescending area = 2");
return tr("\n\tThree groups: big, middle, small = 0;\n\tTwo groups: big, small = "
"1;\n\tDescending area = 2");
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -42,6 +42,7 @@
#include "../vtools/undocommands/image/rotatebackgroundimage.h"
#include "../vtools/undocommands/image/scalebackgroundimage.h"
#include "../vtools/undocommands/image/zvaluemovebackgroundimage.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#include "ui_vwidgetbackgroundimages.h"
#include <QMenu>
@ -154,6 +155,15 @@ VWidgetBackgroundImages::VWidgetBackgroundImages(VAbstractPattern *doc, QWidget
{
ui->setupUi(this);
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxImageHorizontalTranslate);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxTranslateUnit);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxImageVerticalTranslate);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxScaleWidth);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxScaleUnit);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxScaleHeight);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxRotationAngle);
SCASSERT(doc != nullptr)
UpdateImages();

View file

@ -1151,21 +1151,26 @@ void VDxfEngine::ExportPieceText(const QSharedPointer<dx_ifaceBlock> &detailBloc
textLine->text = tl.m_qsText.toStdString();
textLine->style = m_input->AddFont(fnt);
QLineF string(0, 0, 100, 0);
string.setAngle(angle);
string = lineMatrix.map(string);
const qreal labelAngle = string.angle();
if (detail.IsVerticallyFlipped() && detail.IsHorizontallyFlipped())
{
textLine->angle = angle + 180;
textLine->angle = labelAngle + 180;
}
else if (detail.IsVerticallyFlipped())
{
textLine->angle = -angle;
textLine->angle = -labelAngle;
}
else if (detail.IsHorizontallyFlipped())
{
textLine->angle = -angle - 180;
textLine->angle = -labelAngle - 180;
}
else
{
textLine->angle = angle;
textLine->angle = labelAngle;
}
detailBlock->ent.push_back(textLine);

View file

@ -44,6 +44,7 @@
#include "../vmisc/def.h"
#include "../vmisc/vabstractapplication.h"
#include "../vpropertyexplorer/checkablemessagebox.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
#include "../vmisc/compatibility.h"
@ -58,6 +59,12 @@ WatermarkWindow::WatermarkWindow(const QString &patternPath, QWidget *parent)
m_patternPath(patternPath)
{
ui->setupUi(this);
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->spinBoxOpacity);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->spinBoxTextRotation);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->spinBoxImageRotation);
m_okPathColor = ui->lineEditPath->palette().color(ui->lineEditPath->foregroundRole());
VAbstractApplication::VApp()->Settings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c());

View file

@ -172,7 +172,7 @@ QCheckBox:disabled
QGroupBox
{
/* Need to make sure the groupbox doesn't compress below the title. */
min-height: 1.2em;
/*min-height: 1.2em;*/
border: 0.04em solid #bab9b8;
border-radius: 0.09em;
/**

View file

@ -59,6 +59,7 @@
#include "../vpatterndb/vtranslatevars.h"
#include "../vwidgets/vabstractmainwindow.h"
#include "../vwidgets/vmaingraphicsscene.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#include "ui_dialogsplinepath.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 0)
@ -79,6 +80,13 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, VAbstractPattern *doc
{
ui->setupUi(this);
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxNewPoint);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxPoint);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxPenStyle);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBoxColor);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->doubleSpinBoxApproximationScale);
InitIcons();
formulaBaseHeightAngle1 = ui->plainTextEditAngle1F->height();

View file

@ -50,6 +50,7 @@
#include "../vpatterndb/vpiecenode.h"
#include "../vpatterndb/vpiecepath.h"
#include "../vwidgets/fancytabbar/fancytabbar.h"
#include "../vwidgets/vmousewheelwidgetadjustmentguard.h"
#include "dialogpatternmaterials.h"
#include "dialogpiecepath.h"
#include "dialogplacelabel.h"
@ -203,6 +204,33 @@ DialogSeamAllowance::DialogSeamAllowance(const VContainer *data, VAbstractPatter
InitIcons();
// Prevent stealing focus when scrolling
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabGrainline->comboBoxGrainlineCenterPin);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabGrainline->comboBoxGrainlineTopPin);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabGrainline->comboBoxGrainlineBottomPin);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabGrainline->comboBoxArrow);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxPieceLabelSize);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxDLCenterPin);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxDLTopLeftPin);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxDLBottomRightPin);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxPatternLabelSize);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxPLCenterPin);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxPLTopLeftPin);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxPLBottomRightPin);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->dateEditCustomerBirthDate);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxDateFormat);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->comboBoxTimeFormat);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabLabels->spinBoxQuantity);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabPassmarks->comboBoxPassmarks);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabPaths->comboBoxMLStartPoint);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabPaths->comboBoxMLEndPoint);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabPaths->spinBoxPriority);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabPaths->comboBoxNodes);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabPaths->comboBoxAngle);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabPaths->comboBoxStartPoint);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabPaths->comboBoxEndPoint);
VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(uiTabPaths->comboBoxIncludeType);
ChangeColor(uiTabPaths->labelEditName, OkColor(this));
flagMainPathIsValid = MainPathIsValid();

View file

@ -0,0 +1,62 @@
/************************************************************************
**
** @file vmousewheelwidgetadjustmentguard.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 31 1, 2024
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2024 Valentina project
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "vmousewheelwidgetadjustmentguard.h"
#include <QEvent>
#include <QWidget>
//---------------------------------------------------------------------------------------------------------------------
VMouseWheelWidgetAdjustmentGuard::VMouseWheelWidgetAdjustmentGuard(QObject *parent)
: QObject{parent}
{
}
//---------------------------------------------------------------------------------------------------------------------
void VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(QWidget *w)
{
if (w == nullptr)
{
return;
}
w->setFocusPolicy(Qt::StrongFocus);
w->installEventFilter(new VMouseWheelWidgetAdjustmentGuard(w));
}
//---------------------------------------------------------------------------------------------------------------------
auto VMouseWheelWidgetAdjustmentGuard::eventFilter(QObject *o, QEvent *e) -> bool
{
const QWidget *widget = qobject_cast<QWidget *>(o);
if (e->type() == QEvent::Wheel && (widget != nullptr) && !widget->hasFocus())
{
e->ignore();
return true;
}
return QObject::eventFilter(o, e);
}

View file

@ -0,0 +1,55 @@
/************************************************************************
**
** @file vmousewheelwidgetadjustmentguard.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 31 1, 2024
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2024 Valentina project
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VMOUSEWHEELWIDGETADJUSTMENTGUARD_H
#define VMOUSEWHEELWIDGETADJUSTMENTGUARD_H
#include <QObject>
// Helps to prevent widget from stealing scroll event.
// Install event filter
// Example:
// VMouseWheelWidgetAdjustmentGuard::InstallEventFilter(ui->comboBox);
class VMouseWheelWidgetAdjustmentGuard : public QObject
{
Q_OBJECT // NOLINT
public:
explicit VMouseWheelWidgetAdjustmentGuard(QObject *parent = nullptr);
~VMouseWheelWidgetAdjustmentGuard() override = default;
static void InstallEventFilter(QWidget *w);
protected:
auto eventFilter(QObject *o, QEvent *e) -> bool override;
private:
Q_DISABLE_COPY_MOVE(VMouseWheelWidgetAdjustmentGuard) // NOLINT
};
#endif // VMOUSEWHEELWIDGETADJUSTMENTGUARD_H

View file

@ -31,7 +31,8 @@ SOURCES += \
$$PWD/vhighlighter.cpp \
$$PWD/vpiecegrainline.cpp \
$$PWD/vtoolbuttonpopup.cpp \
$$PWD/vaspectratiopixmaplabel.cpp
$$PWD/vaspectratiopixmaplabel.cpp \
$$PWD/vmousewheelwidgetadjustmentguard.cpp
*msvc*:SOURCES += $$PWD/stable.cpp
@ -67,5 +68,6 @@ HEADERS += \
$$PWD/vpiecegrainline.h \
$$PWD/vpiecegrainline_p.h \
$$PWD/vtoolbuttonpopup.h \
$$PWD/vaspectratiopixmaplabel.h
$$PWD/vaspectratiopixmaplabel.h \
$$PWD/vmousewheelwidgetadjustmentguard.h

View file

@ -21,6 +21,8 @@ VLib {
"velidedlabel.cpp",
"vmaingraphicsscene.cpp",
"vmaingraphicsview.cpp",
"vmousewheelwidgetadjustmentguard.cpp",
"vmousewheelwidgetadjustmentguard.h",
"vtoolbuttonpopup.cpp",
"vtoolbuttonpopup.h",
"vwidgetpopup.cpp",