Tool box redesign.

This commit is contained in:
Roman Telezhynskyi 2023-07-08 18:23:33 +03:00
parent 276c620535
commit de0ffa0148
26 changed files with 1458 additions and 1975 deletions

View File

@ -32,6 +32,7 @@
- Support for single-line fonts.
- Export to HP-GL format.
- Fix crash after using tool Union of details.
- Tool box redesign.
# Valentina 0.7.52 September 12, 2022
- Fix crash when default locale is ru.

View File

@ -133,9 +133,6 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
// Theme
ui->darkModeCheck->setChecked(settings->GetDarkMode());
// Tool panel
ui->checkBoxToolPanelScaling->setChecked(settings->GetToolPanelScaling());
// Native dialogs
ui->checkBoxDontUseNativeDialog->setChecked(settings->IsDontUseNativeDialog());
@ -196,11 +193,6 @@ auto PreferencesConfigurationPage::Apply() -> QStringList
preferences.append(tr("dark mode"));
}
if (settings->GetToolPanelScaling() != ui->checkBoxToolPanelScaling->isChecked())
{
settings->SetToolPanelScaling(ui->checkBoxToolPanelScaling->isChecked());
}
if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked())
{
settings->SetDontUseNativeDialog(ui->checkBoxDontUseNativeDialog->isChecked());

View File

@ -35,7 +35,7 @@
<x>0</x>
<y>0</y>
<width>624</width>
<height>898</height>
<height>869</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@ -296,16 +296,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxToolPanelScaling">
<property name="toolTip">
<string>Change the position of the tool panel to optimize for big screen resolutions. By default, the tool panel will take all available space.</string>
</property>
<property name="text">
<string>Tool panel scaling</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxDontUseNativeDialog">
<property name="text">

File diff suppressed because it is too large Load Diff

View File

@ -133,7 +133,6 @@ private slots:
void PreviousPatternPiece();
void NextPatternPiece();
void ToolBarStyles();
void ToolBoxSizePolicy();
void ShowPaper(int index);
void Preferences();
#if defined(Q_OS_MAC)
@ -236,7 +235,7 @@ private slots:
void ShowProgress();
void ClearPatternMessages();
void AskDefaultSettings();
void AddBackgroundImageItem(const QUuid &id);
@ -295,9 +294,6 @@ private:
/** @brief currentDrawIndex save current selected pattern peace. */
qint32 m_currentDrawIndex{0};
/** @brief currentToolBoxIndex save current set of tools. */
qint32 m_currentToolBoxIndex{0};
/** @brief drawMode true if we current draw scene. */
bool m_drawMode{true};
@ -320,8 +316,6 @@ private:
VWidgetBackgroundImages *m_backgroundImagesWidget{nullptr};
QSharedPointer<VLockGuard<char>> m_lock{nullptr};
QList<QToolButton *> m_toolButtonPointerList{};
QProgressBar *m_progressBar;
QLabel *m_statusLabel;
@ -354,6 +348,7 @@ private:
void ToolBarStages();
void ToolBarDraws();
void ToolBarTools();
void ToolBarDrawTools();
void InitToolButtons();
void CancelTool();

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,7 @@
#include "dialogs/dialoglayoutprogress.h"
#include "dialogs/dialoglayoutsettings.h"
#include "dialogs/dialogsavelayout.h"
#include <QAction>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include "../vmisc/vtextcodec.h"
@ -158,7 +159,7 @@ MainWindowsNoGUI::~MainWindowsNoGUI()
//---------------------------------------------------------------------------------------------------------------------
void MainWindowsNoGUI::ToolLayoutSettings(bool checked)
{
QToolButton *tButton = qobject_cast<QToolButton *>(this->sender());
auto *tButton = qobject_cast<QAction *>(this->sender());
SCASSERT(tButton != nullptr)
if (checked)
@ -498,8 +499,7 @@ void MainWindowsNoGUI::ExportData(const QVector<VLayoutPiece> &listDetails)
QString::number(i + 1) +
VLayoutExporter::ExportFormatSuffix(m_dialogSaveLayout->Format());
auto *paper =
qgraphicsitem_cast<QGraphicsRectItem *>(m_layoutSettings->LayoutPapers().at(i));
auto *paper = qgraphicsitem_cast<QGraphicsRectItem *>(m_layoutSettings->LayoutPapers().at(i));
SCASSERT(paper != nullptr)
ExportApparelLayout(detailsOnLayout.at(i), name, paper->rect().size().toSize());

View File

@ -37,22 +37,12 @@
<file>icon/16x16/roll.png</file>
<file>icon/16x16/progress.gif</file>
<file>icon/32x32/export_to_picture_document.png</file>
<file>icon/16x16/toolsectionline.png</file>
<file>icon/16x16/toolsectioncurve.png</file>
<file>icon/16x16/toolsectionarc.png</file>
<file>icon/16x16/toolsectionpoint.png</file>
<file>icon/16x16/toolsectiondetail.png</file>
<file>icon/16x16/toolsectionlayout.png</file>
<file>icon/24x24/fast_forward_left_to_right_arrow.png</file>
<file>icon/24x24/fast_forward_right_to_left_arrow.png</file>
<file>icon/24x24/left_to_right_arrow.png</file>
<file>icon/24x24/right_to_left_arrow.png</file>
<file>icon/32x32/clockwise.png</file>
<file>icon/32x32/syncM.png</file>
<file>icon/16x16/toolsectionarc@2x.png</file>
<file>icon/16x16/toolsectioncurve@2x.png</file>
<file>icon/16x16/toolsectionline@2x.png</file>
<file>icon/16x16/toolsectionpoint@2x.png</file>
<file>icon/16x16/operations.png</file>
<file>icon/16x16/operations@2x.png</file>
<file>icon/16x16/closed_eye.png</file>
@ -63,8 +53,6 @@
<file>icon/16x16/allow_detail@2x.png</file>
<file>icon/16x16/forbid_detail.png</file>
<file>icon/16x16/forbid_detail@2x.png</file>
<file>icon/16x16/toolsectionelarc.png</file>
<file>icon/16x16/toolsectionelarc@2x.png</file>
<file>icon/32x32/grainline.png</file>
<file>icon/32x32/grainline@2x.png</file>
<file>icon/32x32/labels.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

View File

@ -62,8 +62,6 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationLabelLanguage,
// NOLINTNEXTLINE
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingAutoRefreshPatternMessage,
(QLatin1String("configuration/autoRefreshPatternMessage")))
// NOLINTNEXTLINE
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingToolPanelScaling, (QLatin1String("configuration/toolPanelScaling")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPathsLayout, (QLatin1String("paths/layout"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPathsLabelTemplate, (QLatin1String("paths/labels"))) // NOLINT
@ -752,18 +750,6 @@ void VValentinaSettings::SetAutoRefreshPatternMessage(bool value)
setValue(*settingAutoRefreshPatternMessage, value);
}
//---------------------------------------------------------------------------------------------------------------------
auto VValentinaSettings::GetToolPanelScaling() const -> bool
{
return value(*settingToolPanelScaling, false).toBool();
}
//---------------------------------------------------------------------------------------------------------------------
void VValentinaSettings::SetToolPanelScaling(const bool &value)
{
setValue(*settingToolPanelScaling, value);
}
//---------------------------------------------------------------------------------------------------------------------
auto VValentinaSettings::GetLayoutExportFormat() const -> qint8
{

View File

@ -170,9 +170,6 @@ public:
auto GetAutoRefreshPatternMessage() const -> bool;
void SetAutoRefreshPatternMessage(bool value);
auto GetToolPanelScaling() const -> bool;
void SetToolPanelScaling(const bool &value);
auto GetLayoutExportFormat() const -> qint8;
void SetLayoutExportFormat(qint8 format);

View File

@ -0,0 +1,36 @@
/************************************************************************
**
** @file vtoolbuttonpopup.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 8 7, 2023
**
** @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) 2023 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 "vtoolbuttonpopup.h"
//---------------------------------------------------------------------------------------------------------------------
VToolButtonPopup::VToolButtonPopup(QWidget *parent)
: QToolButton(parent)
{
setPopupMode(QToolButton::MenuButtonPopup);
QObject::connect(this, &QToolButton::triggered, this, &QToolButton::setDefaultAction);
}

View File

@ -0,0 +1,49 @@
/************************************************************************
**
** @file vtoolbuttonpopup.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 8 7, 2023
**
** @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) 2023 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 VTOOLBUTTONPOPUP_H
#define VTOOLBUTTONPOPUP_H
#include <QToolButton>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
class VToolButtonPopup : public QToolButton
{
Q_OBJECT // NOLINT
public:
explicit VToolButtonPopup(QWidget *parent = nullptr);
~VToolButtonPopup() override = default;
private:
Q_DISABLE_COPY_MOVE(VToolButtonPopup) // NOLINT
};
#endif // VTOOLBUTTONPOPUP_H

View File

@ -29,8 +29,9 @@ SOURCES += \
$$PWD/vlineedit.cpp \
$$PWD/vplaintextedit.cpp \
$$PWD/vhighlighter.cpp \
$$PWD/vpiecegrainline.cpp
$$PWD/vpiecegrainline.cpp \
$$PWD/vtoolbuttonpopup.cpp
*msvc*:SOURCES += $$PWD/stable.cpp
HEADERS += \
@ -63,4 +64,6 @@ HEADERS += \
$$PWD/vplaintextedit.h \
$$PWD/vhighlighter.h \
$$PWD/vpiecegrainline.h \
$$PWD/vpiecegrainline_p.h
$$PWD/vpiecegrainline_p.h \
$$PWD/vtoolbuttonpopup.h

View File

@ -19,6 +19,8 @@ VLib {
"velidedlabel.cpp",
"vmaingraphicsscene.cpp",
"vmaingraphicsview.cpp",
"vtoolbuttonpopup.cpp",
"vtoolbuttonpopup.h",
"vwidgetpopup.cpp",
"vcontrolpointspline.cpp",
"vgraphicssimpletextitem.cpp",
@ -69,7 +71,7 @@ VLib {
"vhighlighter.h",
"vpiecegrainline.h",
"vpiecegrainline.cpp",
"vpiecegrainline_p.h"
"vpiecegrainline_p.h",
]
Export {