diff --git a/src/app/core/vsettings.cpp b/src/app/core/vsettings.cpp
index ffdf2a635..311fc5111 100644
--- a/src/app/core/vsettings.cpp
+++ b/src/app/core/vsettings.cpp
@@ -42,6 +42,7 @@ const QString VSettings::SettingConfigurationUnit = QStringLitera
const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language");
const QString VSettings::SettingConfigurationConfirmItemDeletion
= QStringLiteral("configuration/confirm_item_deletion");
+const QString VSettings::SettingConfigurationToolBarStyle = QStringLiteral("configuration/tool_bar_style");
const QString VSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements");
const QString VSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements");
@@ -178,6 +179,18 @@ void VSettings::SetConfirmItemDelete(const bool &value)
setValue(SettingConfigurationConfirmItemDeletion, value);
}
+//---------------------------------------------------------------------------------------------------------------------
+bool VSettings::GetToolBarStyle() const
+{
+ return value(SettingConfigurationToolBarStyle, 1).toBool();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VSettings::SetToolBarStyle(const bool &value)
+{
+ setValue(SettingConfigurationToolBarStyle, value);
+}
+
//---------------------------------------------------------------------------------------------------------------------
QString VSettings::GetPathIndividualMeasurements() const
{
diff --git a/src/app/core/vsettings.h b/src/app/core/vsettings.h
index 23329014c..9957b0262 100644
--- a/src/app/core/vsettings.h
+++ b/src/app/core/vsettings.h
@@ -64,6 +64,9 @@ public:
bool GetConfirmItemDelete() const;
void SetConfirmItemDelete(const bool &value);
+ bool GetToolBarStyle() const;
+ void SetToolBarStyle(const bool &value);
+
QString GetPathIndividualMeasurements() const;
void SetPathIndividualMeasurements(const QString &value);
@@ -137,6 +140,7 @@ private:
static const QString SettingConfigurationUnit;
static const QString SettingConfigurationLabelLanguage;
static const QString SettingConfigurationConfirmItemDeletion;
+ static const QString SettingConfigurationToolBarStyle;
static const QString SettingPathsIndividualMeasurements;
static const QString SettingPathsStandardMeasurements;
diff --git a/src/app/dialogs/app/configpages/configurationpage.cpp b/src/app/dialogs/app/configpages/configurationpage.cpp
index 514842591..f83f45059 100644
--- a/src/app/dialogs/app/configpages/configurationpage.cpp
+++ b/src/app/dialogs/app/configpages/configurationpage.cpp
@@ -46,18 +46,20 @@
ConfigurationPage::ConfigurationPage(QWidget *parent)
: QWidget(parent), autoSaveCheck(nullptr), autoTime(nullptr), langCombo(nullptr), labelCombo(nullptr),
unitCombo(nullptr), osOptionCheck(nullptr), langChanged(false), unitChanged(false), labelLangChanged(false),
- sendReportCheck(nullptr), askPointDeletionCheck(nullptr)
+ sendReportCheck(nullptr), askPointDeletionCheck(nullptr), toolBarStyleCheck(nullptr)
{
QGroupBox *saveGroup = SaveGroup();
QGroupBox *langGroup = LangGroup();
QGroupBox *sendGroup = SendGroup();
QGroupBox *drawGroup = DrawGroup();
+ QGroupBox *toolBarGroup = ToolBarGroup();
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(saveGroup);
mainLayout->addWidget(langGroup);
mainLayout->addWidget(sendGroup);
mainLayout->addWidget(drawGroup);
+ mainLayout->addWidget(toolBarGroup);
mainLayout->addStretch(1);
setLayout(mainLayout);
}
@@ -76,6 +78,7 @@ void ConfigurationPage::Apply()
qApp->getSettings()->SetOsSeparator(osOptionCheck->isChecked());
qApp->getSettings()->SetSendReportState(sendReportCheck->isChecked());
qApp->getSettings()->SetConfirmItemDelete(askPointDeletionCheck->isChecked());
+ qApp->getSettings()->SetToolBarStyle(toolBarStyleCheck->isChecked());
if (langChanged)
{
@@ -289,6 +292,21 @@ QGroupBox *ConfigurationPage::DrawGroup()
return drawGroup;
}
+//---------------------------------------------------------------------------------------------------------------------
+QGroupBox *ConfigurationPage::ToolBarGroup()
+{
+ QGroupBox *toolBarGroup = new QGroupBox(tr("Toolbar"));
+
+ toolBarStyleCheck = new QCheckBox(tr("The text appears under the icon. (recommended for beginners.)"));
+ toolBarStyleCheck->setChecked(qApp->getSettings()->GetToolBarStyle());
+
+ QVBoxLayout *editLayout = new QVBoxLayout;
+ editLayout->addWidget(toolBarStyleCheck);
+
+ toolBarGroup->setLayout(editLayout);
+ return toolBarGroup;
+}
+
//---------------------------------------------------------------------------------------------------------------------
void ConfigurationPage::SetLabelComboBox(const QStringList &list)
{
diff --git a/src/app/dialogs/app/configpages/configurationpage.h b/src/app/dialogs/app/configpages/configurationpage.h
index d4ebdcf3b..8fdedf410 100644
--- a/src/app/dialogs/app/configpages/configurationpage.h
+++ b/src/app/dialogs/app/configpages/configurationpage.h
@@ -60,11 +60,13 @@ private:
bool labelLangChanged;
QCheckBox *sendReportCheck;
QCheckBox *askPointDeletionCheck;
+ QCheckBox *toolBarStyleCheck;
QGroupBox *SaveGroup();
QGroupBox *LangGroup();
QGroupBox *SendGroup();
QGroupBox *DrawGroup();
+ QGroupBox *ToolBarGroup();
void SetLabelComboBox(const QStringList &list);
};
diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp
index 5f444b9fc..8a0043e98 100644
--- a/src/app/mainwindow.cpp
+++ b/src/app/mainwindow.cpp
@@ -1419,6 +1419,7 @@ void MainWindow::Preferences()
ConfigDialog dlg(this);
connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::WindowsLocale); // Must be first
connect(&dlg, &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::RefreshOptions);
+ connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::ToolBarStyles);
if (dlg.exec() == QDialog::Accepted)
{
InitAutoSave();
@@ -2111,6 +2112,9 @@ void MainWindow::ReadSettings()
// Stack limit
qApp->getUndoStack()->setUndoLimit(qApp->getSettings()->GetUndoCount());
+
+ // Text under tool buton icon
+ ToolBarStyles();
}
//---------------------------------------------------------------------------------------------------------------------
@@ -2623,6 +2627,30 @@ void MainWindow::WindowsLocale()
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
}
+//---------------------------------------------------------------------------------------------------------------------
+void MainWindow::ToolBarStyles()
+{
+ ToolBarStyle(ui->toolBarArrows);
+ ToolBarStyle(ui->toolBarDraws);
+ ToolBarStyle(ui->toolBarOption);
+ ToolBarStyle(ui->toolBarStages);
+ ToolBarStyle(ui->toolBarTools);
+ ToolBarStyle(ui->mainToolBar);
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void MainWindow::ToolBarStyle(QToolBar *bar)
+{
+ if (qApp->getSettings()->GetToolBarStyle())
+ {
+ bar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
+ }
+ else
+ {
+ bar->setToolButtonStyle(Qt::ToolButtonIconOnly);
+ }
+}
+
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::ReopenFilesAfterCrash(QStringList &args)
{
diff --git a/src/app/mainwindow.h b/src/app/mainwindow.h
index fa23b4b16..079415182 100644
--- a/src/app/mainwindow.h
+++ b/src/app/mainwindow.h
@@ -134,6 +134,7 @@ public slots:
void UpdateGradation();
void GlobalChangePP(const QString &patternPiece);
void WindowsLocale();
+ void ToolBarStyles();
signals:
/**
* @brief ModelChosen emit after calculation all details.
@@ -271,6 +272,7 @@ private:
bool OpenNewValentina(const QString &fileName = QString())const;
void FileClosedCorrect();
QStringList GetUnlokedRestoreFileList()const;
+ void ToolBarStyle(QToolBar *bar);
};
#endif // MAINWINDOW_H
diff --git a/src/app/mainwindow.ui b/src/app/mainwindow.ui
index 8cff5bbc0..99932725a 100644
--- a/src/app/mainwindow.ui
+++ b/src/app/mainwindow.ui
@@ -825,9 +825,17 @@
+
+
+ 10
+
+
Toolbar files
+
+ Qt::ToolButtonTextUnderIcon
+
TopToolBarArea
@@ -843,9 +851,17 @@
true
+
+
+ 10
+
+
ToolBar modes
+
+ Qt::ToolButtonTextUnderIcon
+
TopToolBarArea
@@ -857,9 +873,17 @@
+
+
+ 10
+
+
Toolbar pattern
+
+ Qt::ToolButtonTextUnderIcon
+
TopToolBarArea
@@ -869,9 +893,17 @@
+
+
+ 10
+
+
Toolbar options
+
+ Qt::ToolButtonTextUnderIcon
+
BottomToolBarArea
@@ -883,9 +915,17 @@
true
+
+
+ 10
+
+
Toolbar tools
+
+ Qt::ToolButtonTextUnderIcon
+
TopToolBarArea
@@ -914,9 +954,17 @@
+
+
+ 10
+
+
toolBar
+
+ Qt::ToolButtonTextUnderIcon
+
TopToolBarArea
@@ -1058,7 +1106,7 @@
:/icon/32x32/arrow_cursor.png:/icon/32x32/arrow_cursor.png
- Pointer tools
+ Pointer
Pointer tools
@@ -1085,7 +1133,7 @@
:/icon/32x32/option_draw.png:/icon/32x32/option_draw.png
- Change the label of pattern piece
+ Config pattern piece
Change the label of pattern piece
@@ -1133,7 +1181,7 @@
:/icon/32x32/layout.png:/icon/32x32/layout.png
- Export pattern (layout)
+ Export pattern
Create layout
diff --git a/src/app/tablewindow.cpp b/src/app/tablewindow.cpp
index 091397397..4dee08383 100644
--- a/src/app/tablewindow.cpp
+++ b/src/app/tablewindow.cpp
@@ -84,6 +84,8 @@ TableWindow::TableWindow(QWidget *parent)
connect(ui->actionPrint_pre_view, &QAction::triggered, this, &TableWindow::PrintPreview);
connect(ui->action_Print, &QAction::triggered, this, &TableWindow::LayoutPrint);
connect(ui->actionSave_to_p_df, &QAction::triggered, this, &TableWindow::PrintToPdf);
+
+ ReadSettings();
}
//---------------------------------------------------------------------------------------------------------------------
@@ -754,3 +756,30 @@ void TableWindow::EnableActions(bool enable)
ui->actionPrint_pre_view->setEnabled(enable);
ui->action_Print->setEnabled(enable);
}
+
+//---------------------------------------------------------------------------------------------------------------------
+void TableWindow::ToolBarStyle(QToolBar *bar)
+{
+ if (qApp->getSettings()->GetToolBarStyle())
+ {
+ bar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
+ }
+ else
+ {
+ bar->setToolButtonStyle(Qt::ToolButtonIconOnly);
+ }
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void TableWindow::ReadSettings()
+{
+ // Text under tool buton icon
+ ToolBarStyles();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void TableWindow::ToolBarStyles()
+{
+ ToolBarStyle(ui->toolBar);
+ ToolBarStyle(ui->toolBar_2);
+}
diff --git a/src/app/tablewindow.h b/src/app/tablewindow.h
index c988a6f77..ad2452732 100644
--- a/src/app/tablewindow.h
+++ b/src/app/tablewindow.h
@@ -113,6 +113,9 @@ private:
QMap InitFormates() const;
void EnableActions(bool enable);
+ void ToolBarStyle(QToolBar *bar);
+ void ReadSettings();
+ void ToolBarStyles();
};
#endif // TABLEWINDOW_H
diff --git a/src/app/tablewindow.ui b/src/app/tablewindow.ui
index c3c213e30..c443cb6d5 100644
--- a/src/app/tablewindow.ui
+++ b/src/app/tablewindow.ui
@@ -38,6 +38,11 @@
+
+
+ 10
+
+
Main toolbar
@@ -48,7 +53,7 @@
- Qt::ToolButtonIconOnly
+ Qt::ToolButtonTextUnderIcon
TopToolBarArea
@@ -170,9 +175,17 @@
+
+
+ 10
+
+
Toolbar print
+
+ Qt::ToolButtonTextUnderIcon
+
TopToolBarArea
@@ -209,10 +222,10 @@
- Stop
+ Back
- Stop laying
+ Back to main window
@@ -247,7 +260,7 @@
:/icon/32x32/layout.png:/icon/32x32/layout.png
- Layout
+ Generate a layout
@@ -255,7 +268,9 @@
false
-
+
+
+
Print pre&view...
@@ -266,7 +281,9 @@
false
-
+
+
+
&Print...