Improve support for dark theme.

Custom dark theme updated. Added support for native dark mode. Added new icon themes. Scene still needs improvement.
This commit is contained in:
Roman Telezhynskyi 2023-07-24 13:41:42 +03:00
parent 2646a9c6d7
commit ec8a22cc84
20517 changed files with 320092 additions and 2719 deletions

4
.gitignore vendored
View File

@ -166,3 +166,7 @@ $RECYCLE.BIN/
*.udb *.udb
__pycache__ __pycache__
# Temporary svg cursor files
/src/app/valentina/share/resources/cursor/svg/light/
/src/app/valentina/share/resources/cursor/svg/dark/

View File

@ -66,7 +66,5 @@
</dict> </dict>
</dict> </dict>
</array> </array>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
</dict> </dict>
</plist> </plist>

View File

@ -102,7 +102,5 @@
</dict> </dict>
</dict> </dict>
</array> </array>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
</dict> </dict>
</plist> </plist>

View File

@ -160,7 +160,5 @@
</dict> </dict>
</dict> </dict>
</array> </array>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
</dict> </dict>
</plist> </plist>

View File

@ -15,10 +15,17 @@
# I have spent hour before understand why i don't see PNG inside SVG in Nautilus. # I have spent hour before understand why i don't see PNG inside SVG in Nautilus.
PATTERN=*@2x.png PATTERN=*@2x.png
TOOLICONPATH=../src/app/valentina/share/resources/toolicon/32x32/ # PNG tool icon should be here TOOLICONPATH=../src/app/valentina/share/resources/toolicon/ # PNG tool icon should be here
TOOLICONS=`ls $TOOLICONPATH$PATTERN` OUTPATH=../src/app/valentina/share/resources/cursor
OUTPATH=../src/app/valentina/share/resources/cursor/svg # Seek SVG templates here
COLOR_SCHEMES=("light" "dark")
for scheme in "${COLOR_SCHEMES[@]}"
do
# Create a subdirectory for the current scheme if it doesn't exist
mkdir -p "$OUTPATH/$scheme"
TOOLICONS=`ls $TOOLICONPATH${scheme}/$PATTERN`
for var in $TOOLICONS for var in $TOOLICONS
do do
@ -26,8 +33,13 @@ do
basename=${basename%.png} # remove the extension from a path-string basename=${basename%.png} # remove the extension from a path-string
basename=${basename%@2x} # remove optional @2x suffix basename=${basename%@2x} # remove optional @2x suffix
if [ ! -f $basename@2x.png ]; then # always prefere hidpi version if [ ! -f $basename@2x.png ]; then # always prefere hidpi version
sed "s/<<basename>>/$basename@2x/" $OUTPATH/template_cursor.svg > $OUTPATH/${basename}_cursor.svg sed "s/<<basename>>/$basename@2x/" $OUTPATH/svg/template_cursor_${scheme}.svg > $OUTPATH/svg/${scheme}/${basename}_cursor.svg
else else
sed "s/<<basename>>/$basename/" $OUTPATH/template_cursor.svg > $OUTPATH/${basename}_cursor.svg sed "s/<<basename>>/$basename/" $OUTPATH/svg/template_cursor_${scheme}.svg > $OUTPATH/svg/${scheme}/${basename}_cursor.svg
fi fi
# Generate PNG files from the SVGs
inkscape --export-filename "$OUTPATH/$scheme/${basename}_cursor@2x.png" --export-width 64 --export-height 64 "$OUTPATH/svg/$scheme/${basename}_cursor.svg"
inkscape --export-filename "$OUTPATH/$scheme/${basename}_cursor.png" --export-width 32 --export-height 32 "$OUTPATH/svg/$scheme/${basename}_cursor.svg"
done
done done

View File

@ -34,6 +34,7 @@
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vganalytics/vganalytics.h" #include "../vganalytics/vganalytics.h"
#include "../vmisc/theme/vtheme.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
PuzzlePreferencesConfigurationPage::PuzzlePreferencesConfigurationPage(QWidget *parent) PuzzlePreferencesConfigurationPage::PuzzlePreferencesConfigurationPage(QWidget *parent)
@ -49,7 +50,12 @@ PuzzlePreferencesConfigurationPage::PuzzlePreferencesConfigurationPage(QWidget *
VPSettings *settings = VPApplication::VApp()->PuzzleSettings(); VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
// Theme // Theme
ui->darkModeCheck->setChecked(settings->GetDarkMode()); SetThemeModeComboBox();
int index = ui->comboBoxThemeMode->findData(static_cast<int>(settings->GetThemeMode()));
if (index != -1)
{
ui->comboBoxThemeMode->setCurrentIndex(index);
}
// Native dialogs // Native dialogs
ui->checkBoxDontUseNativeDialog->setChecked(settings->IsDontUseNativeDialog()); ui->checkBoxDontUseNativeDialog->setChecked(settings->IsDontUseNativeDialog());
@ -110,10 +116,11 @@ auto PuzzlePreferencesConfigurationPage::Apply() -> QStringList
settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked()); settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked());
if (settings->GetDarkMode() != ui->darkModeCheck->isChecked()) auto themeMode = static_cast<VThemeMode>(ui->comboBoxThemeMode->currentData().toInt());
if (settings->GetThemeMode() != themeMode)
{ {
settings->SetDarkMode(ui->darkModeCheck->isChecked()); settings->SetThemeMode(themeMode);
preferences.append(tr("dark mode")); VTheme::Instance()->ResetThemeSettings();
} }
if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked()) if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked())
@ -190,3 +197,12 @@ void PuzzlePreferencesConfigurationPage::changeEvent(QEvent *event)
// remember to call base class implementation // remember to call base class implementation
QWidget::changeEvent(event); QWidget::changeEvent(event);
} }
//---------------------------------------------------------------------------------------------------------------------
void PuzzlePreferencesConfigurationPage::SetThemeModeComboBox()
{
ui->comboBoxThemeMode->clear();
ui->comboBoxThemeMode->addItem(tr("System", "theme"), static_cast<int>(VThemeMode::System));
ui->comboBoxThemeMode->addItem(tr("Dark", "theme"), static_cast<int>(VThemeMode::Dark));
ui->comboBoxThemeMode->addItem(tr("Light", "theme"), static_cast<int>(VThemeMode::Light));
}

View File

@ -57,6 +57,8 @@ private:
Q_DISABLE_COPY_MOVE(PuzzlePreferencesConfigurationPage) // NOLINT Q_DISABLE_COPY_MOVE(PuzzlePreferencesConfigurationPage) // NOLINT
Ui::PuzzlePreferencesConfigurationPage *ui; Ui::PuzzlePreferencesConfigurationPage *ui;
bool m_langChanged{false}; bool m_langChanged{false};
void SetThemeModeComboBox();
}; };
#endif // PUZZLEPREFERENCESCONFIGURATIONPAGE_H #endif // PUZZLEPREFERENCESCONFIGURATIONPAGE_H

View File

@ -46,7 +46,7 @@
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
@ -87,12 +87,25 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<widget class="QCheckBox" name="darkModeCheck"> <layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Activate dark mode</string> <string>Theme:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QComboBox" name="comboBoxThemeMode"/>
</item>
</layout>
</item>
<item> <item>
<widget class="QCheckBox" name="checkBoxDontUseNativeDialog"> <widget class="QCheckBox" name="checkBoxDontUseNativeDialog">
<property name="text"> <property name="text">
@ -237,8 +250,8 @@ This option will take an affect after restart.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>503</width> <width>497</width>
<height>627</height> <height>633</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_8"> <layout class="QVBoxLayout" name="verticalLayout_8">
@ -249,7 +262,7 @@ This option will take an affect after restart.</string>
</property> </property>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QFormLayout" name="formLayout_3">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_8">
@ -313,7 +326,7 @@ This option will take an affect after restart.</string>
</property> </property>
<layout class="QFormLayout" name="formLayout_4"> <layout class="QFormLayout" name="formLayout_4">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_11">
@ -377,7 +390,7 @@ This option will take an affect after restart.</string>
</property> </property>
<layout class="QFormLayout" name="formLayout_5"> <layout class="QFormLayout" name="formLayout_5">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">

View File

@ -43,7 +43,7 @@
<item> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelLayoutUnit"> <widget class="QLabel" name="labelLayoutUnit">
@ -327,6 +327,12 @@
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLabel" name="labelSheetPiecesGap"> <widget class="QLabel" name="labelSheetPiecesGap">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Pieces gap</string> <string>Pieces gap</string>
</property> </property>
@ -341,6 +347,12 @@
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Line width:</string> <string>Line width:</string>
</property> </property>
@ -429,7 +441,7 @@
<item> <item>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">

View File

@ -27,19 +27,19 @@
*************************************************************************/ *************************************************************************/
#include "dialogpuzzlepreferences.h" #include "dialogpuzzlepreferences.h"
#include "ui_dialogpuzzlepreferences.h"
#include "../vpapplication.h" #include "../vpapplication.h"
#include "configpages/puzzlepreferencesconfigurationpage.h" #include "configpages/puzzlepreferencesconfigurationpage.h"
#include "configpages/puzzlepreferencespathpage.h"
#include "configpages/puzzlepreferenceslayoutpage.h" #include "configpages/puzzlepreferenceslayoutpage.h"
#include "configpages/puzzlepreferencespathpage.h"
#include "ui_dialogpuzzlepreferences.h"
#include <QMessageBox> #include <QMessageBox>
#include <QPushButton> #include <QPushButton>
#include <QShowEvent> #include <QShowEvent>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogPuzzlePreferences::DialogPuzzlePreferences(QWidget *parent) : DialogPuzzlePreferences::DialogPuzzlePreferences(QWidget *parent)
QDialog(parent), : QDialog(parent),
ui(new Ui::DialogPuzzlePreferences), ui(new Ui::DialogPuzzlePreferences),
m_configurationPage(new PuzzlePreferencesConfigurationPage), m_configurationPage(new PuzzlePreferencesConfigurationPage),
m_layoutPage(new PuzzlePreferencesLayoutPage), m_layoutPage(new PuzzlePreferencesLayoutPage),
@ -120,6 +120,24 @@ void DialogPuzzlePreferences::changeEvent(QEvent *event)
// retranslate designer form (single inheritance approach) // retranslate designer form (single inheritance approach)
ui->retranslateUi(this); ui->retranslateUi(this);
} }
if (event->type() == QEvent::PaletteChange)
{
QStyle *style = QApplication::style();
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
SCASSERT(bOk != nullptr)
bOk->setIcon(style->standardIcon(QStyle::SP_DialogOkButton));
QPushButton *bApply = ui->buttonBox->button(QDialogButtonBox::Apply);
SCASSERT(bApply != nullptr)
bApply->setIcon(style->standardIcon(QStyle::SP_DialogApplyButton));
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
SCASSERT(bCancel != nullptr)
bCancel->setIcon(style->standardIcon(QStyle::SP_DialogCancelButton));
}
// remember to call base class implementation // remember to call base class implementation
QDialog::changeEvent(event); QDialog::changeEvent(event);
} }
@ -135,8 +153,9 @@ void DialogPuzzlePreferences::Apply()
if (not preferences.isEmpty()) if (not preferences.isEmpty())
{ {
const QString text = tr("Followed %n option(s) require restart to take effect: %1.", "", const QString text =
static_cast<int>(preferences.size())).arg(preferences.join(QStringLiteral(", "))); tr("Followed %n option(s) require restart to take effect: %1.", "", static_cast<int>(preferences.size()))
.arg(preferences.join(QStringLiteral(", ")));
QMessageBox::information(this, QCoreApplication::applicationName(), text); QMessageBox::information(this, QCoreApplication::applicationName(), text);
} }

View File

@ -29,8 +29,8 @@
#include <QMessageBox> // For QT_REQUIRE_VERSION #include <QMessageBox> // For QT_REQUIRE_VERSION
#include <QTimer> #include <QTimer>
#include "vpapplication.h"
#include "../vmisc/def.h" #include "../vmisc/def.h"
#include "vpapplication.h"
#if defined(APPIMAGE) && defined(Q_OS_LINUX) #if defined(APPIMAGE) && defined(Q_OS_LINUX)
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
@ -54,12 +54,16 @@ auto main(int argc, char *argv[]) -> int
#endif // defined(APPIMAGE) && defined(Q_OS_LINUX) #endif // defined(APPIMAGE) && defined(Q_OS_LINUX)
Q_INIT_RESOURCE(puzzleicon); // NOLINT Q_INIT_RESOURCE(puzzleicon); // NOLINT
Q_INIT_RESOURCE(theme); // NOLINT
Q_INIT_RESOURCE(icon); // NOLINT Q_INIT_RESOURCE(icon); // NOLINT
Q_INIT_RESOURCE(schema); // NOLINT Q_INIT_RESOURCE(schema); // NOLINT
Q_INIT_RESOURCE(flags); // NOLINT Q_INIT_RESOURCE(flags); // NOLINT
Q_INIT_RESOURCE(style); // NOLINT Q_INIT_RESOURCE(breeze); // NOLINT
Q_INIT_RESOURCE(cursor); // NOLINT Q_INIT_RESOURCE(cursor); // NOLINT
#if defined(Q_OS_MACX)
Q_INIT_RESOURCE(mac_theme); // NOLINT
#else
Q_INIT_RESOURCE(win_theme); // NOLINT
#endif
QT_REQUIRE_VERSION(argc, argv, "5.4.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT QT_REQUIRE_VERSION(argc, argv, "5.4.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT
@ -69,7 +73,7 @@ auto main(int argc, char *argv[]) -> int
#ifndef Q_OS_MAC // supports natively #ifndef Q_OS_MAC // supports natively
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
InitHighDpiScaling(argc, argv); VAbstractApplication::InitHighDpiScaling(argc, argv);
#endif #endif
#endif // ndef Q_OS_MAC #endif // ndef Q_OS_MAC

View File

@ -27,6 +27,7 @@
*************************************************************************/ *************************************************************************/
#include "vpapplication.h" #include "vpapplication.h"
#include "../fervor/fvupdater.h"
#include "../ifc/exception/vexceptionbadid.h" #include "../ifc/exception/vexceptionbadid.h"
#include "../ifc/exception/vexceptionconversionerror.h" #include "../ifc/exception/vexceptionconversionerror.h"
#include "../ifc/exception/vexceptionemptyparameter.h" #include "../ifc/exception/vexceptionemptyparameter.h"
@ -34,6 +35,9 @@
#include "../ifc/exception/vexceptionwrongid.h" #include "../ifc/exception/vexceptionwrongid.h"
#include "../vganalytics/def.h" #include "../vganalytics/def.h"
#include "../vganalytics/vganalytics.h" #include "../vganalytics/vganalytics.h"
#include "../vmisc/qt_dispatch/qt_dispatch.h"
#include "../vmisc/theme/vapplicationstyle.h"
#include "../vmisc/theme/vtheme.h"
#include "../vmisc/vsysexits.h" #include "../vmisc/vsysexits.h"
#include "version.h" #include "version.h"
#include "vpmainwindow.h" #include "vpmainwindow.h"
@ -42,11 +46,14 @@
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
#include "../fervor/fvupdater.h" #include <QCommandLineParser>
#include "../vmisc/qt_dispatch/qt_dispatch.h" #include <QFileOpenEvent>
#include <QLocalServer>
#include <QLocalSocket>
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QMessageBox> #include <QMessageBox>
#include <QPixmapCache>
#include <QStyleFactory>
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes")
@ -56,12 +63,6 @@ Q_LOGGING_CATEGORY(pApp, "p.application") // NOLINT
QT_WARNING_POP QT_WARNING_POP
#include <QCommandLineParser>
#include <QFileOpenEvent>
#include <QLocalServer>
#include <QLocalSocket>
#include <QPixmapCache>
#if !defined(BUILD_REVISION) && defined(QBS_BUILD) #if !defined(BUILD_REVISION) && defined(QBS_BUILD)
#include <vcsRepoState.h> #include <vcsRepoState.h>
#define BUILD_REVISION VCS_REPO_STATE_REVISION #define BUILD_REVISION VCS_REPO_STATE_REVISION
@ -274,12 +275,13 @@ VPApplication::VPApplication(int &argc, char **argv)
// The first inside own bundle where info.plist is works fine, but the second, // The first inside own bundle where info.plist is works fine, but the second,
// when we run inside Valentina's bundle, require direct setting the icon. // when we run inside Valentina's bundle, require direct setting the icon.
setWindowIcon(QIcon(":/puzzleicon/64x64/logo.png")); setWindowIcon(QIcon(":/puzzleicon/64x64/logo.png"));
VTheme::Instance()->StoreDefaultThemeName(QIcon::themeName());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VPApplication::~VPApplication() VPApplication::~VPApplication()
{ {
if (IsAppInGUIMode() && settings->IsCollectStatistic()) if (VPApplication::IsAppInGUIMode() && settings->IsCollectStatistic())
{ {
auto *statistic = VGAnalytics::Instance(); auto *statistic = VGAnalytics::Instance();
@ -433,16 +435,8 @@ void VPApplication::InitOptions()
CheckSystemLocale(); CheckSystemLocale();
static const char *GENERIC_ICON_TO_CHECK = "document-open"; VTheme::SetIconTheme();
if (not QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK)) VTheme::InitThemeMode();
{
// If there is no default working icon theme then we should
// use an icon theme that we provide via a .qrc file
// This case happens under Windows and Mac OS X
// This does not happen under GNOME or KDE
QIcon::setThemeName(QStringLiteral("win.icon.theme"));
}
ActivateDarkMode();
auto *statistic = VGAnalytics::Instance(); auto *statistic = VGAnalytics::Instance();
QString clientID = settings->GetClientID(); QString clientID = settings->GetClientID();
@ -480,26 +474,6 @@ auto VPApplication::PuzzleSettings() -> VPSettings *
return qobject_cast<VPSettings *>(settings); return qobject_cast<VPSettings *>(settings);
} }
//---------------------------------------------------------------------------------------------------------------------
void VPApplication::ActivateDarkMode()
{
VPSettings *settings = PuzzleSettings();
if (settings->GetDarkMode())
{
QFile f(QStringLiteral(":qdarkstyle/style.qss"));
if (!f.exists())
{
qDebug() << "Unable to set stylesheet, file not found\n";
}
else
{
f.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&f);
VPApplication::VApp()->setStyleSheet(ts.readAll());
}
}
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPApplication::ParseCommandLine(const SocketConnection &connection, const QStringList &arguments) void VPApplication::ParseCommandLine(const SocketConnection &connection, const QStringList &arguments)
{ {
@ -525,6 +499,17 @@ void VPApplication::ParseCommandLine(const SocketConnection &connection, const Q
qCDebug(pApp, "Can't establish connection to the server '%s'", qUtf8Printable(serverName)); qCDebug(pApp, "Can't establish connection to the server '%s'", qUtf8Printable(serverName));
StartLocalServer(serverName); StartLocalServer(serverName);
LoadTranslation(PuzzleSettings()->GetLocale()); LoadTranslation(PuzzleSettings()->GetLocale());
QString styleOpt = cmd->OptionStyle();
if (styleOpt != QLatin1String("native"))
{
QStyle *style = QStyleFactory::create(styleOpt);
if (style != nullptr)
{
style = new VApplicationStyle(style);
setStyle(style);
}
}
} }
ProcessArguments(cmd); ProcessArguments(cmd);

View File

@ -29,20 +29,25 @@
#define VPAPPLICATION_H #define VPAPPLICATION_H
#include "../vmisc/def.h" #include "../vmisc/def.h"
#include "vpsettings.h"
#include "../vmisc/vabstractapplication.h" #include "../vmisc/vabstractapplication.h"
#include "vpcommandline.h" #include "vpcommandline.h"
#include "vpsettings.h"
template <typename T> class QWeakPointer; template <typename T> class QWeakPointer;
class VPMainWindow; class VPMainWindow;
class QLocalServer; class QLocalServer;
class DialogPuzzlePreferences; class DialogPuzzlePreferences;
enum class SocketConnection : bool {Client = false, Server = true}; enum class SocketConnection : bool
{
Client = false,
Server = true
};
class VPApplication : public VAbstractApplication class VPApplication : public VAbstractApplication
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
VPApplication(int &argc, char **argv); VPApplication(int &argc, char **argv);
~VPApplication() override; ~VPApplication() override;
@ -61,7 +66,6 @@ public:
void OpenSettings() override; void OpenSettings() override;
auto PuzzleSettings() -> VPSettings *; auto PuzzleSettings() -> VPSettings *;
void ActivateDarkMode();
void ParseCommandLine(const SocketConnection &connection, const QStringList &arguments); void ParseCommandLine(const SocketConnection &connection, const QStringList &arguments);
void ProcessArguments(const VPCommandLinePtr &cmd); void ProcessArguments(const VPCommandLinePtr &cmd);

View File

@ -26,14 +26,16 @@
** **
*************************************************************************/ *************************************************************************/
#include "vpcommandline.h" #include "vpcommandline.h"
#include "vpcommands.h"
#include "../vmisc/vsysexits.h"
#include "../vmisc/literals.h" #include "../vmisc/literals.h"
#include "../vmisc/vsysexits.h"
#include "vpcommands.h"
#include <QDebug> #include <QDebug>
std::shared_ptr<VPCommandLine> VPCommandLine::instance = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) std::shared_ptr<VPCommandLine> VPCommandLine::instance =
nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
#define translate(context, source) QCoreApplication::translate((context), source)// NOLINT(cppcoreguidelines-macro-usage) #define translate(context, source) \
QCoreApplication::translate((context), source) // NOLINT(cppcoreguidelines-macro-usage)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VPCommandLine::OptionRawLayouts() const -> QStringList auto VPCommandLine::OptionRawLayouts() const -> QStringList
@ -65,7 +67,19 @@ void VPCommandLine::ShowHelp(int exitCode)
parser.showHelp(exitCode); parser.showHelp(exitCode);
} }
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
auto VPCommandLine::OptionStyle() const -> QString
{
QString value = OptionValue(LONG_OPTION_STYLE);
if (value.isEmpty())
{
return QStringLiteral("native");
}
return value;
}
//----------------------------------------------------------------------------------------------------------------------
VPCommandLine::VPCommandLine() VPCommandLine::VPCommandLine()
{ {
parser.setApplicationDescription(translate("Puzzle", "Valentina's manual layout editor.")); parser.setApplicationDescription(translate("Puzzle", "Valentina's manual layout editor."));
@ -106,6 +120,7 @@ void VPCommandLine::InitCommandLineOptions()
translate("VCommandLine", "Disable high dpi scaling. Call this option if has problem with scaling (by default " translate("VCommandLine", "Disable high dpi scaling. Call this option if has problem with scaling (by default "
"scaling enabled). Alternatively you can use the %1 environment variable.") "scaling enabled). Alternatively you can use the %1 environment variable.")
.arg(QStringLiteral("QT_AUTO_SCREEN_SCALE_FACTOR=0"))}, .arg(QStringLiteral("QT_AUTO_SCREEN_SCALE_FACTOR=0"))},
{LONG_OPTION_STYLE, tr("Application style") + QString(" `Fusion`, `Windows`, `native`, ..."), "", "native"},
}); });
} }
@ -126,5 +141,3 @@ auto VPCommandLine::OptionValues(const QString &option) const -> QStringList
{ {
return parser.values(option); return parser.values(option);
} }

View File

@ -65,6 +65,8 @@ public:
Q_NORETURN void ShowHelp(int exitCode = 0); Q_NORETURN void ShowHelp(int exitCode = 0);
auto OptionStyle() const -> QString;
protected: protected:
VPCommandLine(); VPCommandLine();

View File

@ -31,6 +31,7 @@
const QString LONG_OPTION_RAW_LAYOUT = QStringLiteral("rawLayout"); // NOLINT const QString LONG_OPTION_RAW_LAYOUT = QStringLiteral("rawLayout"); // NOLINT
const QString SINGLE_OPTION_RAW_LAYOUT = QStringLiteral("r"); // NOLINT const QString SINGLE_OPTION_RAW_LAYOUT = QStringLiteral("r"); // NOLINT
const QString LONG_OPTION_STYLE = QStringLiteral("style"); // NOLINT
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
@ -39,9 +40,5 @@ const QString SINGLE_OPTION_RAW_LAYOUT = QStringLiteral("r"); // NOLINT
*/ */
auto AllKeys() -> QStringList auto AllKeys() -> QStringList
{ {
return return {LONG_OPTION_RAW_LAYOUT, SINGLE_OPTION_RAW_LAYOUT, LONG_OPTION_STYLE};
{
LONG_OPTION_RAW_LAYOUT,
SINGLE_OPTION_RAW_LAYOUT
};
} }

View File

@ -28,12 +28,14 @@
#ifndef VPCOMMANDS_H #ifndef VPCOMMANDS_H
#define VPCOMMANDS_H #define VPCOMMANDS_H
#include <QString> #include <QString>
extern const QString LONG_OPTION_RAW_LAYOUT; extern const QString LONG_OPTION_RAW_LAYOUT;
extern const QString SINGLE_OPTION_RAW_LAYOUT; extern const QString SINGLE_OPTION_RAW_LAYOUT;
extern const QString LONG_OPTION_STYLE;
extern const QString LONG_OPTION_STYLESHEET;
auto AllKeys() -> QStringList; auto AllKeys() -> QStringList;
#endif // VPCOMMANDS_H #endif // VPCOMMANDS_H

View File

@ -36,6 +36,7 @@
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../qmuparser/qmudef.h" #include "../qmuparser/qmudef.h"
#include "../vganalytics/vganalytics.h" #include "../vganalytics/vganalytics.h"
#include "../vmisc/theme/vtheme.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *parent) TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *parent)
@ -57,7 +58,12 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
ui->osOptionCheck->setChecked(settings->GetOsSeparator()); ui->osOptionCheck->setChecked(settings->GetOsSeparator());
// Theme // Theme
ui->darkModeCheck->setChecked(settings->GetDarkMode()); SetThemeModeComboBox();
int index = ui->comboBoxThemeMode->findData(static_cast<int>(settings->GetThemeMode()));
if (index != -1)
{
ui->comboBoxThemeMode->setCurrentIndex(index);
}
// Native dialogs // Native dialogs
ui->checkBoxDontUseNativeDialog->setChecked(settings->IsDontUseNativeDialog()); ui->checkBoxDontUseNativeDialog->setChecked(settings->IsDontUseNativeDialog());
@ -78,7 +84,7 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
}); });
// set default pattern making system // set default pattern making system
int index = ui->systemCombo->findData(settings->GetPMSystemCode()); index = ui->systemCombo->findData(settings->GetPMSystemCode());
if (index != -1) if (index != -1)
{ {
ui->systemCombo->setCurrentIndex(index); ui->systemCombo->setCurrentIndex(index);
@ -113,10 +119,11 @@ auto TapePreferencesConfigurationPage::Apply() -> QStringList
settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked()); settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked());
if (settings->GetDarkMode() != ui->darkModeCheck->isChecked()) auto themeMode = static_cast<VThemeMode>(ui->comboBoxThemeMode->currentData().toInt());
if (settings->GetThemeMode() != themeMode)
{ {
settings->SetDarkMode(ui->darkModeCheck->isChecked()); settings->SetThemeMode(themeMode);
preferences.append(tr("dark mode")); VTheme::Instance()->ResetThemeSettings();
} }
if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked()) if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked())
@ -183,3 +190,12 @@ void TapePreferencesConfigurationPage::RetranslateUi()
ui->systemCombo->setCurrentIndex(ui->systemCombo->findData(code)); ui->systemCombo->setCurrentIndex(ui->systemCombo->findData(code));
} }
} }
//---------------------------------------------------------------------------------------------------------------------
void TapePreferencesConfigurationPage::SetThemeModeComboBox()
{
ui->comboBoxThemeMode->clear();
ui->comboBoxThemeMode->addItem(tr("System", "theme"), static_cast<int>(VThemeMode::System));
ui->comboBoxThemeMode->addItem(tr("Dark", "theme"), static_cast<int>(VThemeMode::Dark));
ui->comboBoxThemeMode->addItem(tr("Light", "theme"), static_cast<int>(VThemeMode::Light));
}

View File

@ -31,6 +31,10 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class TapePreferencesConfigurationPage; class TapePreferencesConfigurationPage;
@ -57,6 +61,7 @@ private:
bool m_systemChanged; bool m_systemChanged;
void RetranslateUi(); void RetranslateUi();
void SetThemeModeComboBox();
}; };
#endif // TAPEPREFERENCESCONFIGURATIONPAGE_H #endif // TAPEPREFERENCESCONFIGURATIONPAGE_H

View File

@ -46,7 +46,7 @@
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
@ -85,7 +85,7 @@
</property> </property>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
@ -182,12 +182,25 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<widget class="QCheckBox" name="darkModeCheck"> <layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Activate dark mode</string> <string>Theme:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QComboBox" name="comboBoxThemeMode"/>
</item>
</layout>
</item>
<item> <item>
<widget class="QCheckBox" name="checkBoxDontUseNativeDialog"> <widget class="QCheckBox" name="checkBoxDontUseNativeDialog">
<property name="text"> <property name="text">

View File

@ -31,6 +31,10 @@
#include <QWidget> #include <QWidget>
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif
namespace Ui namespace Ui
{ {
class TapePreferencesPathPage; class TapePreferencesPathPage;

View File

@ -27,10 +27,10 @@
*************************************************************************/ *************************************************************************/
#include "dialogtapepreferences.h" #include "dialogtapepreferences.h"
#include "ui_dialogtapepreferences.h"
#include "../mapplication.h" #include "../mapplication.h"
#include "configpages/tapepreferencesconfigurationpage.h" #include "configpages/tapepreferencesconfigurationpage.h"
#include "configpages/tapepreferencespathpage.h" #include "configpages/tapepreferencespathpage.h"
#include "ui_dialogtapepreferences.h"
#include <QMessageBox> #include <QMessageBox>
#include <QPushButton> #include <QPushButton>
@ -117,6 +117,24 @@ void DialogTapePreferences::changeEvent(QEvent *event)
// retranslate designer form (single inheritance approach) // retranslate designer form (single inheritance approach)
ui->retranslateUi(this); ui->retranslateUi(this);
} }
if (event->type() == QEvent::PaletteChange)
{
QStyle *style = QApplication::style();
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
SCASSERT(bOk != nullptr)
bOk->setIcon(style->standardIcon(QStyle::SP_DialogOkButton));
QPushButton *bApply = ui->buttonBox->button(QDialogButtonBox::Apply);
SCASSERT(bApply != nullptr)
bApply->setIcon(style->standardIcon(QStyle::SP_DialogApplyButton));
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
SCASSERT(bCancel != nullptr)
bCancel->setIcon(style->standardIcon(QStyle::SP_DialogCancelButton));
}
// remember to call base class implementation // remember to call base class implementation
QDialog::changeEvent(event); QDialog::changeEvent(event);
} }
@ -131,8 +149,9 @@ void DialogTapePreferences::Apply()
if (not preferences.isEmpty()) if (not preferences.isEmpty())
{ {
const QString text = tr("Followed %n option(s) require restart to take effect: %1.", "", const QString text =
static_cast<int>(preferences.size())).arg(preferences.join(QStringLiteral(", "))); tr("Followed %n option(s) require restart to take effect: %1.", "", static_cast<int>(preferences.size()))
.arg(preferences.join(QStringLiteral(", ")));
QMessageBox::information(this, QCoreApplication::applicationName(), text); QMessageBox::information(this, QCoreApplication::applicationName(), text);
} }

View File

@ -53,11 +53,15 @@ auto main(int argc, char *argv[]) -> int
#endif // defined(APPIMAGE) && defined(Q_OS_LINUX) #endif // defined(APPIMAGE) && defined(Q_OS_LINUX)
Q_INIT_RESOURCE(tapeicon); // NOLINT Q_INIT_RESOURCE(tapeicon); // NOLINT
Q_INIT_RESOURCE(theme); // NOLINT
Q_INIT_RESOURCE(icon); // NOLINT Q_INIT_RESOURCE(icon); // NOLINT
Q_INIT_RESOURCE(schema); // NOLINT Q_INIT_RESOURCE(schema); // NOLINT
Q_INIT_RESOURCE(flags); // NOLINT Q_INIT_RESOURCE(flags); // NOLINT
Q_INIT_RESOURCE(style); // NOLINT Q_INIT_RESOURCE(breeze); // NOLINT
#if defined(Q_OS_MACX)
Q_INIT_RESOURCE(mac_theme); // NOLINT
#else
Q_INIT_RESOURCE(win_theme); // NOLINT
#endif
QT_REQUIRE_VERSION(argc, argv, "5.4.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT QT_REQUIRE_VERSION(argc, argv, "5.4.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT
@ -73,7 +77,7 @@ auto main(int argc, char *argv[]) -> int
#ifndef Q_OS_MAC // supports natively #ifndef Q_OS_MAC // supports natively
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
InitHighDpiScaling(argc, argv); VAbstractApplication::InitHighDpiScaling(argc, argv);
#endif #endif
#endif // Q_OS_MAC #endif // Q_OS_MAC

View File

@ -35,6 +35,8 @@
#include "../vganalytics/def.h" #include "../vganalytics/def.h"
#include "../vganalytics/vganalytics.h" #include "../vganalytics/vganalytics.h"
#include "../vmisc/projectversion.h" #include "../vmisc/projectversion.h"
#include "../vmisc/theme/vapplicationstyle.h"
#include "../vmisc/theme/vtheme.h"
#include "../vmisc/vsysexits.h" #include "../vmisc/vsysexits.h"
#include "tmainwindow.h" #include "tmainwindow.h"
#include "version.h" #include "version.h"
@ -57,6 +59,7 @@
#include <QPointer> #include <QPointer>
#include <QResource> #include <QResource>
#include <QSpacerItem> #include <QSpacerItem>
#include <QStyleFactory>
#include <QThread> #include <QThread>
#include <QTranslator> #include <QTranslator>
#include <iostream> #include <iostream>
@ -100,6 +103,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, SINGLE_OPTION_UNITS, (QChar('u')))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, LONG_OPTION_TEST, (QLatin1String("test"))) // NOLINT Q_GLOBAL_STATIC_WITH_ARGS(const QString, LONG_OPTION_TEST, (QLatin1String("test"))) // NOLINT
Q_GLOBAL_STATIC_WITH_ARGS(const QString, LONG_OPTION_STYLE, (QLatin1String("style"))) // NOLINT
QT_WARNING_POP QT_WARNING_POP
} // namespace } // namespace
@ -316,6 +321,7 @@ MApplication::MApplication(int &argc, char **argv)
// The first inside own bundle where info.plist is works fine, but the second, // The first inside own bundle where info.plist is works fine, but the second,
// when we run inside Valentina's bundle, require direct setting the icon. // when we run inside Valentina's bundle, require direct setting the icon.
setWindowIcon(QIcon(":/tapeicon/64x64/logo.png")); setWindowIcon(QIcon(":/tapeicon/64x64/logo.png"));
VTheme::Instance()->StoreDefaultThemeName(QIcon::themeName());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -476,16 +482,9 @@ void MApplication::InitOptions()
CheckSystemLocale(); CheckSystemLocale();
static const char *GENERIC_ICON_TO_CHECK = "document-open"; VTheme::SetIconTheme();
if (not QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK)) VTheme::InitThemeMode();
{
// If there is no default working icon theme then we should
// use an icon theme that we provide via a .qrc file
// This case happens under Windows and Mac OS X
// This does not happen under GNOME or KDE
QIcon::setThemeName(QStringLiteral("win.icon.theme"));
}
ActivateDarkMode();
QResource::registerResource(diagramsPath()); QResource::registerResource(diagramsPath());
auto *statistic = VGAnalytics::Instance(); auto *statistic = VGAnalytics::Instance();
@ -503,27 +502,6 @@ void MApplication::InitOptions()
statistic->Enable(settings->IsCollectStatistic()); statistic->Enable(settings->IsCollectStatistic());
} }
//---------------------------------------------------------------------------------------------------------------------
// Dark mode
void MApplication::ActivateDarkMode()
{
VTapeSettings *settings = TapeSettings();
if (settings->GetDarkMode())
{
QFile f(QStringLiteral(":qdarkstyle/style.qss"));
if (!f.exists())
{
qDebug() << "Unable to set stylesheet, file not found\n";
}
else
{
f.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&f);
qApp->setStyleSheet(ts.readAll()); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
}
}
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MApplication::InitTrVars() void MApplication::InitTrVars()
{ {
@ -710,6 +688,22 @@ void MApplication::ParseCommandLine(const SocketConnection &connection, const QS
qCDebug(mApp, "Can't establish connection to the server '%s'", qUtf8Printable(serverName)); qCDebug(mApp, "Can't establish connection to the server '%s'", qUtf8Printable(serverName));
StartLocalServer(serverName); StartLocalServer(serverName);
LoadTranslation(TapeSettings()->GetLocale()); LoadTranslation(TapeSettings()->GetLocale());
QString styleOpt = parser.value(*LONG_OPTION_STYLE);
if (styleOpt.isEmpty())
{
styleOpt = QLatin1String("native");
}
if (styleOpt != QLatin1String("native"))
{
QStyle *style = QStyleFactory::create(styleOpt);
if (style != nullptr)
{
style = new VApplicationStyle(style);
setStyle(style);
}
}
} }
const QStringList args = parser.positionalArguments(); const QStringList args = parser.positionalArguments();
@ -822,6 +816,7 @@ void MApplication::InitParserOptions(QCommandLineParser &parser)
tr("Disable high dpi scaling. Call this option if has problem with scaling (by default scaling enabled). " tr("Disable high dpi scaling. Call this option if has problem with scaling (by default scaling enabled). "
"Alternatively you can use the %1 environment variable.") "Alternatively you can use the %1 environment variable.")
.arg("QT_AUTO_SCREEN_SCALE_FACTOR=0")}, .arg("QT_AUTO_SCREEN_SCALE_FACTOR=0")},
{*LONG_OPTION_STYLE, tr("Application style") + QString(" `Fusion`, `Windows`, `native`, ..."), "", "native"},
}); });
} }

View File

@ -29,16 +29,20 @@
#ifndef MAPPLICATION_H #ifndef MAPPLICATION_H
#define MAPPLICATION_H #define MAPPLICATION_H
#include "../vpatterndb/vtranslatevars.h"
#include "vtapesettings.h"
#include "../vmisc/vabstractapplication.h" #include "../vmisc/vabstractapplication.h"
#include "../vpatterndb/vtranslatevars.h"
#include "dialogs/dialogmdatabase.h" #include "dialogs/dialogmdatabase.h"
#include "vtapesettings.h"
class TMainWindow; class TMainWindow;
class QLocalServer; class QLocalServer;
class QCommandLineParser; class QCommandLineParser;
enum class SocketConnection : bool {Client = false, Server = true}; enum class SocketConnection : bool
{
Client = false,
Server = true
};
class MApplication : public VAbstractApplication class MApplication : public VAbstractApplication
{ {
@ -62,7 +66,6 @@ public:
void OpenSettings() override; void OpenSettings() override;
auto TapeSettings() -> VTapeSettings *; auto TapeSettings() -> VTapeSettings *;
void ActivateDarkMode();
static auto diagramsPath() -> QString; static auto diagramsPath() -> QString;

View File

@ -1946,15 +1946,13 @@ void TMainWindow::DeployFormula()
{ {
ui->plainTextEditFormula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT); ui->plainTextEditFormula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT);
// Set icon from theme (internal for Windows system) // Set icon from theme (internal for Windows system)
ui->pushButtonGrow->setIcon( ui->pushButtonGrow->setIcon(QIcon::fromTheme(QStringLiteral("go-next")));
QIcon::fromTheme(QStringLiteral("go-next"), QIcon(":/icons/win.icon.theme/16x16/actions/go-next.png")));
} }
else else
{ {
ui->plainTextEditFormula->setFixedHeight(m_formulaBaseHeight); ui->plainTextEditFormula->setFixedHeight(m_formulaBaseHeight);
// Set icon from theme (internal for Windows system) // Set icon from theme (internal for Windows system)
ui->pushButtonGrow->setIcon( ui->pushButtonGrow->setIcon(QIcon::fromTheme(QStringLiteral("go-down")));
QIcon::fromTheme(QStringLiteral("go-down"), QIcon(":/icons/win.icon.theme/16x16/actions/go-down.png")));
} }
// I found that after change size of formula field, it was filed for angle formula, field for formula became black. // I found that after change size of formula field, it was filed for angle formula, field for formula became black.

View File

@ -39,6 +39,8 @@
#include "../vganalytics/def.h" #include "../vganalytics/def.h"
#include "../vganalytics/vganalytics.h" #include "../vganalytics/vganalytics.h"
#include "../vmisc/qt_dispatch/qt_dispatch.h" #include "../vmisc/qt_dispatch/qt_dispatch.h"
#include "../vmisc/theme/vapplicationstyle.h"
#include "../vmisc/theme/vtheme.h"
#include "../vmisc/vsysexits.h" #include "../vmisc/vsysexits.h"
#include "../vmisc/vvalentinasettings.h" #include "../vmisc/vvalentinasettings.h"
@ -50,12 +52,15 @@
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QIcon> #include <QIcon>
#include <QLoggingCategory>
#include <QMessageBox> #include <QMessageBox>
#include <QProcess> #include <QProcess>
#include <QStandardPaths> #include <QStandardPaths>
#include <QStyleFactory>
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QThread> #include <QThread>
#include <Qt> #include <QTimer>
#include <QUuid>
#include <QtDebug> #include <QtDebug>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@ -378,6 +383,7 @@ VApplication::VApplication(int &argc, char **argv)
setApplicationVersion(APP_VERSION_STR); setApplicationVersion(APP_VERSION_STR);
// making sure will create new instance...just in case we will ever do 2 objects of VApplication // making sure will create new instance...just in case we will ever do 2 objects of VApplication
VCommandLine::Reset(); VCommandLine::Reset();
VTheme::Instance()->StoreDefaultThemeName(QIcon::themeName());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -523,26 +529,6 @@ auto VApplication::notify(QObject *receiver, QEvent *event) -> bool
return false; return false;
} }
//---------------------------------------------------------------------------------------------------------------------
void VApplication::ActivateDarkMode()
{
VValentinaSettings *settings = ValentinaSettings();
if (settings->GetDarkMode())
{
QFile f(QStringLiteral(":qdarkstyle/style.qss"));
if (!f.exists())
{
qDebug() << "Unable to set stylesheet, file not found\n";
}
else
{
f.open(QFile::ReadOnly | QFile::Text);
QTextStream ts(&f);
qApp->setStyleSheet(ts.readAll()); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
}
}
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VApplication::TapeFilePath() -> QString auto VApplication::TapeFilePath() -> QString
{ {
@ -696,18 +682,21 @@ void VApplication::InitOptions()
if (VApplication::IsGUIMode()) // By default console version uses system locale if (VApplication::IsGUIMode()) // By default console version uses system locale
{ {
LoadTranslation(ValentinaSettings()->GetLocale()); LoadTranslation(ValentinaSettings()->GetLocale());
}
static const char *GENERIC_ICON_TO_CHECK = "document-open"; VTheme::SetIconTheme();
if (not QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK)) VTheme::InitThemeMode();
QString styleOpt = VApplication::CommandLine()->OptStyle();
if (styleOpt != QLatin1String("native"))
{ {
// If there is no default working icon theme then we should QStyle *style = QStyleFactory::create(styleOpt);
// use an icon theme that we provide via a .qrc file if (style != nullptr)
// This case happens under Windows and Mac OS X {
// This does not happen under GNOME or KDE style = new VApplicationStyle(style);
QIcon::setThemeName(QStringLiteral("win.icon.theme")); setStyle(style);
}
}
} }
ActivateDarkMode();
auto *statistic = VGAnalytics::Instance(); auto *statistic = VGAnalytics::Instance();
QString clientID = settings->GetClientID(); QString clientID = settings->GetClientID();

View File

@ -30,9 +30,9 @@
#define VAPPLICATION_H #define VAPPLICATION_H
#include "../vmisc/vabstractvalapplication.h" #include "../vmisc/vabstractvalapplication.h"
#include "../vmisc/vlockguard.h"
#include "../vpatterndb/vtranslatevars.h" #include "../vpatterndb/vtranslatevars.h"
#include "vcmdexport.h" #include "vcmdexport.h"
#include "../vmisc/vlockguard.h"
class VApplication; // use in define class VApplication; // use in define
@ -42,6 +42,7 @@ class VApplication;// use in define
class VApplication : public VAbstractValApplication class VApplication : public VAbstractValApplication
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
VApplication(int &argc, char **argv); VApplication(int &argc, char **argv);
~VApplication() override; ~VApplication() override;
@ -62,7 +63,6 @@ public:
static auto LabelLanguages() -> QStringList; static auto LabelLanguages() -> QStringList;
void StartLogging(); void StartLogging();
void ActivateDarkMode();
auto LogFile() -> QTextStream *; auto LogFile() -> QTextStream *;
auto TrVars() -> const VTranslateVars * override; auto TrVars() -> const VTranslateVars * override;

View File

@ -30,11 +30,11 @@
#include "../dialogs/dialoglayoutsettings.h" #include "../dialogs/dialoglayoutsettings.h"
#include "../dialogs/dialogsavelayout.h" #include "../dialogs/dialogsavelayout.h"
#include "../ifc/xml/vdomdocument.h" #include "../ifc/xml/vdomdocument.h"
#include "../vlayout/vlayoutgenerator.h"
#include "../vmisc/commandoptions.h" #include "../vmisc/commandoptions.h"
#include "../vmisc/dialogs/dialogexporttocsv.h"
#include "../vmisc/vsysexits.h" #include "../vmisc/vsysexits.h"
#include "../vmisc/vvalentinasettings.h" #include "../vmisc/vvalentinasettings.h"
#include "../vmisc/dialogs/dialogexporttocsv.h"
#include "../vlayout/vlayoutgenerator.h"
#include <QDebug> #include <QDebug>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@ -45,7 +45,8 @@
VCommandLinePtr VCommandLine::instance = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) VCommandLinePtr VCommandLine::instance = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
#define translate(context, source) QCoreApplication::translate((context), (source)) // NOLINT(cppcoreguidelines-macro-usage) #define translate(context, source) \
QCoreApplication::translate((context), (source)) // NOLINT(cppcoreguidelines-macro-usage)
namespace namespace
{ {
@ -193,9 +194,8 @@ auto VCommandLine::Get(const QCoreApplication& app) -> VCommandLinePtr
instance->parser.process(app); instance->parser.process(app);
// fixme: in case of additional options/modes which will need to disable GUI - add it here too // fixme: in case of additional options/modes which will need to disable GUI - add it here too
instance->isGuiEnabled = not (instance->IsExportEnabled() instance->isGuiEnabled =
|| instance->IsTestModeEnabled() not(instance->IsExportEnabled() || instance->IsTestModeEnabled() || instance->IsExportFMEnabled());
|| instance->IsExportFMEnabled());
return instance; return instance;
} }
@ -276,8 +276,7 @@ auto VCommandLine::OptGroup() const -> Cases
auto VCommandLine::OptMeasurePath() const -> QString auto VCommandLine::OptMeasurePath() const -> QString
{ {
QString measure; QString measure;
if (IsOptionSet(LONG_OPTION_MEASUREFILE) if (IsOptionSet(LONG_OPTION_MEASUREFILE) && (IsExportEnabled() || IsTestModeEnabled()))
&& (IsExportEnabled() || IsTestModeEnabled()))
// todo: don't want yet to allow user set measure file for general loading, // todo: don't want yet to allow user set measure file for general loading,
// because need to fix multiply opened windows as well // because need to fix multiply opened windows as well
{ {
@ -597,10 +596,22 @@ auto VCommandLine::OptTiledPageOrientation() const -> PageOrientation
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VCommandLine::OptStyle() const -> QString
{
QString style = OptionValue(LONG_OPTION_STYLE);
if (style.isEmpty())
{
return QStringLiteral("native");
}
return style;
}
//----------------------------------------------------------------------------------------------------------------------
void VCommandLine::InitCommandLineOptions() void VCommandLine::InitCommandLineOptions()
{ {
// keep in mind order here - that is how user will see it, so group-up for usability // keep in mind order here - that is how user will see it, so group-up for usability
//================================================================================================================= //==================================================================================================================
parser.addOptions({ parser.addOptions({
{{SINGLE_OPTION_BASENAME, LONG_OPTION_BASENAME}, {{SINGLE_OPTION_BASENAME, LONG_OPTION_BASENAME},
translate("VCommandLine", "The base filename of exported layout files. Use it to enable console export mode."), translate("VCommandLine", "The base filename of exported layout files. Use it to enable console export mode."),
@ -618,22 +629,25 @@ void VCommandLine::InitCommandLineOptions()
translate("VCommandLine", "Time")}, translate("VCommandLine", "Time")},
{LONG_OPTION_EFFICIENCY_COEFFICIENT, {LONG_OPTION_EFFICIENCY_COEFFICIENT,
translate("VCommandLine", "Set layout efficiency <coefficient>. Layout efficiency coefficient is the ratio of " translate("VCommandLine", "Set layout efficiency <coefficient>. Layout efficiency coefficient is the ratio of "
"the area occupied by the pieces to the bounding rect of all pieces. If nesting reaches required level the " "the area occupied by the pieces to the bounding rect of all pieces. If nesting "
"process stops. If value is 0 no check will be made. Coefficient must be in range from 0 to 100. Default " "reaches required level "
"the "
"process stops. If value is 0 no check will be made. Coefficient must be in range "
"from 0 to 100. Default "
"value 0."), "value 0."),
translate("VCommandLine", "Coefficient")}, translate("VCommandLine", "Coefficient")},
{{SINGLE_OPTION_EXP2FORMAT, LONG_OPTION_EXP2FORMAT}, {{SINGLE_OPTION_EXP2FORMAT, LONG_OPTION_EXP2FORMAT},
translate("VCommandLine", "Number corresponding to output format (default = 0, export mode):") + translate("VCommandLine", "Number corresponding to output format (default = 0, export mode):") +
DialogSaveLayout::MakeHelpFormatList(), DialogSaveLayout::MakeHelpFormatList(),
translate("VCommandLine", "Format number"), QChar('0')}, translate("VCommandLine", "Format number"),
QChar('0')},
{LONG_OPTION_BINARYDXF, translate("VCommandLine", "Export dxf in binary form.")}, {LONG_OPTION_BINARYDXF, translate("VCommandLine", "Export dxf in binary form.")},
{LONG_OPTION_NOGRAINLINE, translate("VCommandLine", "Show/hide grainline when export layout.")}, {LONG_OPTION_NOGRAINLINE, translate("VCommandLine", "Show/hide grainline when export layout.")},
{LONG_OPTION_TEXT2PATHS, translate("VCommandLine", "Export text as paths.")}, {LONG_OPTION_TEXT2PATHS, translate("VCommandLine", "Export text as paths.")},
{LONG_OPTION_EXPORTONLYDETAILS, {LONG_OPTION_EXPORTONLYDETAILS,
translate("VCommandLine", "Export only details. Export details as they positioned in the details mode. Any " translate("VCommandLine", "Export only details. Export details as they positioned in the details mode. Any "
"layout related options will be ignored.")}, "layout related options will be ignored.")},
{LONG_OPTION_EXPORTSUCHDETAILS, {LONG_OPTION_EXPORTSUCHDETAILS, translate("VCommandLine", "Export only details that match a piece name regex."),
translate("VCommandLine", "Export only details that match a piece name regex."),
translate("VCommandLine", "The name regex")}, translate("VCommandLine", "The name regex")},
{LONG_OPTION_DIMENSION_A, {LONG_OPTION_DIMENSION_A,
@ -650,14 +664,18 @@ void VCommandLine::InitCommandLineOptions()
{LONG_OPTION_USER_MATERIAL, {LONG_OPTION_USER_MATERIAL,
translate("VCommandLine", "Use this option to override user material defined in pattern. The value must be in " translate("VCommandLine", "Use this option to override user material defined in pattern. The value must be in "
"form <number>@<user matrial name>. The number should be in range from 1 to %1. For example, 1@Fabric2. The " "form <number>@<user matrial name>. The number should be in range from 1 to %1. For "
"key can be used multiple times. Has no effect in GUI mode.").arg(userMaterialPlaceholdersQuantity), "example, "
"1@Fabric2. The "
"key can be used multiple times. Has no effect in GUI mode.")
.arg(userMaterialPlaceholdersQuantity),
translate("VCommandLine", "User material")}, translate("VCommandLine", "User material")},
//================================================================================================================= //==============================================================================================================
{{SINGLE_OPTION_PAGETEMPLATE, LONG_OPTION_PAGETEMPLATE}, {{SINGLE_OPTION_PAGETEMPLATE, LONG_OPTION_PAGETEMPLATE},
translate("VCommandLine", "Number corresponding to layout page template (default = 0, export mode):") + translate("VCommandLine", "Number corresponding to layout page template (default = 0, export mode):") +
DialogLayoutSettings::MakeHelpTemplateList(), DialogLayoutSettings::MakeHelpTemplateList(),
translate("VCommandLine", "Template number"), QChar('0')}, translate("VCommandLine", "Template number"),
QChar('0')},
{LONG_OPTION_LANDSCAPE_ORIENTATION, {LONG_OPTION_LANDSCAPE_ORIENTATION,
translate("VCommandLine", "Switch page template orientation to landscape (export mode). This option has " translate("VCommandLine", "Switch page template orientation to landscape (export mode). This option has "
"effect only for one of predefined page templates.")}, "effect only for one of predefined page templates.")},
@ -698,26 +716,25 @@ void VCommandLine::InitCommandLineOptions()
{LONG_OPTION_EXPYSCALE, {LONG_OPTION_EXPYSCALE,
translate("VCommandLine", "Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode)."), translate("VCommandLine", "Set vertical scale factor from 0.01 to 3.0 (default = 1.0, export mode)."),
translate("VCommandLine", "Vertical scale")}, translate("VCommandLine", "Vertical scale")},
//================================================================================================================= //==============================================================================================================
{LONG_OPTION_FOLLOW_GRAINLINE, {LONG_OPTION_FOLLOW_GRAINLINE,
translate("VCommandLine", "Order detail to follow grainline direction (export mode).")}, translate("VCommandLine", "Order detail to follow grainline direction (export mode).")},
{LONG_OPTION_MANUAL_PRIORITY, {LONG_OPTION_MANUAL_PRIORITY,
translate("VCommandLine", "Follow manual priority over priority by square (export mode).")}, translate("VCommandLine", "Follow manual priority over priority by square (export mode).")},
{LONG_OPTION_NEST_QUANTITY, {LONG_OPTION_NEST_QUANTITY, translate("VCommandLine", "Nest quantity copies of each piece (export mode).")},
translate("VCommandLine", "Nest quantity copies of each piece (export mode).")},
{{SINGLE_OPTION_CROP_LENGTH, LONG_OPTION_CROP_LENGTH}, {{SINGLE_OPTION_CROP_LENGTH, LONG_OPTION_CROP_LENGTH},
translate("VCommandLine", "Auto crop unused length (export mode).")}, translate("VCommandLine", "Auto crop unused length (export mode).")},
{LONG_OPTION_CROP_WIDTH, {LONG_OPTION_CROP_WIDTH, translate("VCommandLine", "Auto crop unused width (export mode).")},
translate("VCommandLine", "Auto crop unused width (export mode).")},
{{SINGLE_OPTION_UNITE, LONG_OPTION_UNITE}, {{SINGLE_OPTION_UNITE, LONG_OPTION_UNITE},
translate("VCommandLine", "Unite pages if possible (export mode). Maximum value limited by QImage that " translate("VCommandLine", "Unite pages if possible (export mode). Maximum value limited by QImage that "
"supports only a maximum of 32768x32768 px images.")}, "supports only a maximum of 32768x32768 px images.")},
{LONG_OPTION_PREFER_ONE_SHEET_SOLUTION, {LONG_OPTION_PREFER_ONE_SHEET_SOLUTION,
translate("VCommandLine", "Prefer one sheet layout solution (export mode).")}, translate("VCommandLine", "Prefer one sheet layout solution (export mode).")},
//================================================================================================================= //==============================================================================================================
{{SINGLE_OPTION_SAVELENGTH, LONG_OPTION_SAVELENGTH}, {{SINGLE_OPTION_SAVELENGTH, LONG_OPTION_SAVELENGTH},
translate("VCommandLine", "Save length of the sheet if set (export mode). The option tells the program to use " translate("VCommandLine", "Save length of the sheet if set (export mode). The option tells the program to use "
"as much as possible width of sheet. Quality of a layout can be worse when this option was used.")}, "as much as possible width of sheet. Quality of a layout can be worse when this "
"option was used.")},
{{SINGLE_OPTION_SHIFTUNITS, LONG_OPTION_SHIFTUNITS}, {{SINGLE_OPTION_SHIFTUNITS, LONG_OPTION_SHIFTUNITS},
translate("VCommandLine", "Layout units (as paper's one except px, export mode). Default units cm."), translate("VCommandLine", "Layout units (as paper's one except px, export mode). Default units cm."),
translate("VCommandLine", "The unit")}, translate("VCommandLine", "The unit")},
@ -728,40 +745,53 @@ void VCommandLine::InitCommandLineOptions()
{{SINGLE_OPTION_GROUPPING, LONG_OPTION_GROUPPING}, {{SINGLE_OPTION_GROUPPING, LONG_OPTION_GROUPPING},
translate("VCommandLine", "Sets layout groupping cases (export mode): %1.") translate("VCommandLine", "Sets layout groupping cases (export mode): %1.")
.arg(DialogLayoutSettings::MakeGroupsHelp()), .arg(DialogLayoutSettings::MakeGroupsHelp()),
translate("VCommandLine", "Grouping type"), QChar('2')}, translate("VCommandLine", "Grouping type"),
QChar('2')},
{{SINGLE_OPTION_TEST, LONG_OPTION_TEST}, {{SINGLE_OPTION_TEST, LONG_OPTION_TEST},
translate("VCommandLine", "Run the program in a test mode. The program in this mode loads a single pattern " translate("VCommandLine", "Run the program in a test mode. The program in this mode loads a single pattern "
"file and silently quit without showing the main window. The key have priority before key '%1'.") "file and silently quit without showing the main window. The key have priority "
"before key '%1'.")
.arg(LONG_OPTION_BASENAME)}, .arg(LONG_OPTION_BASENAME)},
{LONG_OPTION_PENDANTIC, {LONG_OPTION_PENDANTIC,
translate("VCommandLine", "Make all parsing warnings into errors. Have effect only in console mode. Use to " translate("VCommandLine",
"Make all parsing warnings into errors. Have effect only in console mode. Use to "
"force Valentina to immediately terminate if a pattern contains a parsing warning.")}, "force Valentina to immediately terminate if a pattern contains a parsing warning.")},
{LONG_OPTION_NO_HDPI_SCALING, {LONG_OPTION_NO_HDPI_SCALING,
translate("VCommandLine", "Disable high dpi scaling. Call this option if has problem with scaling (by default " translate("VCommandLine", "Disable high dpi scaling. Call this option if has problem with scaling (by default "
"scaling enabled). Alternatively you can use the %1 environment variable.") "scaling enabled). Alternatively you can use the %1 environment variable.")
.arg(QStringLiteral("QT_AUTO_SCREEN_SCALE_FACTOR=0"))}, .arg(QStringLiteral("QT_AUTO_SCREEN_SCALE_FACTOR=0"))},
//================================================================================================================= //==============================================================================================================
{LONG_OPTION_CSVWITHHEADER, {LONG_OPTION_CSVWITHHEADER, translate("VCommandLine", "Export to csv with header. By default disabled.")},
translate("VCommandLine", "Export to csv with header. By default disabled.")},
{LONG_OPTION_CSVCODEC, {LONG_OPTION_CSVCODEC,
translate("VCommandLine", "Specify codec that will be used to save data. List of supported codecs provided by " translate("VCommandLine", "Specify codec that will be used to save data. List of supported codecs provided by "
"Qt. Default value depend from system. On Windows, the codec will be based on a system locale. On Unix " "Qt. Default value depend from system. On Windows, the codec will be based on a "
"systems, the codec will might fall back to using the iconv library if no builtin codec for the locale can be " "system locale. On Unix "
"found. Valid values for this installation:") + DialogExportToCSV::MakeHelpCodecsList(), "systems, the codec will might fall back to using the iconv library if no builtin "
"codec for the locale "
"can be "
"found. Valid values for this installation:") +
DialogExportToCSV::MakeHelpCodecsList(),
translate("VCommandLine", "Codec name"), QString(VTextCodec::codecForLocale()->name())}, translate("VCommandLine", "Codec name"), QString(VTextCodec::codecForLocale()->name())},
{LONG_OPTION_CSVSEPARATOR, {LONG_OPTION_CSVSEPARATOR,
translate("VCommandLine", "Specify csv separator character. Default value is '%1'. Valid characters:") translate("VCommandLine", "Specify csv separator character. Default value is '%1'. Valid characters:")
.arg(VCommonSettings::GetDefCSVSeparator()) + DialogExportToCSV::MakeHelpSeparatorList(), .arg(VCommonSettings::GetDefCSVSeparator()) +
DialogExportToCSV::MakeHelpSeparatorList(),
translate("VCommandLine", "Separator character"), QString(VCommonSettings::GetDefCSVSeparator())}, translate("VCommandLine", "Separator character"), QString(VCommonSettings::GetDefCSVSeparator())},
{LONG_OPTION_CSVEXPORTFM, {LONG_OPTION_CSVEXPORTFM,
translate("VCommandLine", "Calling this command enable exporting final measurements. Specify path to csv file " translate("VCommandLine",
"with final measurements. The path must contain path to directory and name of file. It can be absolute or " "Calling this command enable exporting final measurements. Specify path to csv file "
"relatetive. In case of relative path will be used current working directory to calc a destination path."), "with final measurements. The path must contain path to directory and name of file. "
"It can be "
"absolute or "
"relatetive. In case of relative path will be used current working directory to calc "
"a destination "
"path."),
translate("VCommandLine", "Path to csv file")}, translate("VCommandLine", "Path to csv file")},
//================================================================================================================= //==============================================================================================================
{LONG_OPTION_TILED_PDF_PAGE_TEMPLATE, {LONG_OPTION_TILED_PDF_PAGE_TEMPLATE,
translate("VCommandLine", "Number corresponding to tiled pdf page template (default = 0, export mode with " translate("VCommandLine", "Number corresponding to tiled pdf page template (default = 0, export mode with "
"tiled pdf format):") + DialogLayoutSettings::MakeHelpTiledPdfTemplateList(), "tiled pdf format):") +
DialogLayoutSettings::MakeHelpTiledPdfTemplateList(),
translate("VCommandLine", "Template number"), QChar('0')}, translate("VCommandLine", "Template number"), QChar('0')},
{LONG_OPTION_TILED_PDF_LEFT_MARGIN, {LONG_OPTION_TILED_PDF_LEFT_MARGIN,
translate("VCommandLine", "Tiled page left margin in current units like 3.0 (export mode). If not set will be " translate("VCommandLine", "Tiled page left margin in current units like 3.0 (export mode). If not set will be "
@ -781,7 +811,10 @@ void VCommandLine::InitCommandLineOptions()
translate("VCommandLine", "The bottom margin")}, translate("VCommandLine", "The bottom margin")},
{LONG_OPTION_TILED_PDF_LANDSCAPE, {LONG_OPTION_TILED_PDF_LANDSCAPE,
translate("VCommandLine", "Set tiled page orienatation to landscape (export mode). Default value if not set " translate("VCommandLine", "Set tiled page orienatation to landscape (export mode). Default value if not set "
"portrait.")} "portrait.")},
//==============================================================================================================
{LONG_OPTION_STYLE,
translate("VCommandLine", "Application style") + QString(" `Fusion`, `Windows`, `native`, ..."), "", "native"},
}); });
} }
@ -814,8 +847,7 @@ auto VCommandLine::OptNestingTime() const -> int
if (not ok || time < 1 || time > 60) if (not ok || time < 1 || time > 60)
{ {
qCritical() << translate("VCommandLine", "Time must be in range from 1 minute to 60 minutes.") qCritical() << translate("VCommandLine", "Time must be in range from 1 minute to 60 minutes.") << "\n";
<< "\n";
const_cast<VCommandLine *>(this)->parser.showHelp(V_EX_USAGE); const_cast<VCommandLine *>(this)->parser.showHelp(V_EX_USAGE);
} }
} }
@ -834,8 +866,7 @@ auto VCommandLine::OptEfficiencyCoefficient() const -> qreal
if (not ok || coefficient < 0 || coefficient > 100) if (not ok || coefficient < 0 || coefficient > 100)
{ {
qCritical() << translate("VCommandLine", "Coefficient must be in range from 0 to 100.") qCritical() << translate("VCommandLine", "Coefficient must be in range from 0 to 100.") << "\n";
<< "\n";
const_cast<VCommandLine *>(this)->parser.showHelp(V_EX_USAGE); const_cast<VCommandLine *>(this)->parser.showHelp(V_EX_USAGE);
} }
} }
@ -854,8 +885,7 @@ void VCommandLine::TestPageformat() const
if ((a || b) && x) if ((a || b) && x)
{ {
qCritical() << translate("VCommandLine", "Cannot use pageformat and page explicit size together.") qCritical() << translate("VCommandLine", "Cannot use pageformat and page explicit size together.") << "\n";
<< "\n";
const_cast<VCommandLine *>(this)->parser.showHelp(V_EX_USAGE); const_cast<VCommandLine *>(this)->parser.showHelp(V_EX_USAGE);
} }

View File

@ -29,11 +29,11 @@
#ifndef VCMDEXPORT_H #ifndef VCMDEXPORT_H
#define VCMDEXPORT_H #define VCMDEXPORT_H
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QTextStream>
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <QTextStream>
#include <QCoreApplication>
#include <QCommandLineParser>
#include "../dialogs/dialoglayoutsettings.h" #include "../dialogs/dialoglayoutsettings.h"
@ -127,8 +127,9 @@ public:
auto OptTiledPaperSize() const -> VAbstractLayoutDialog::PaperSizeTemplate; auto OptTiledPaperSize() const -> VAbstractLayoutDialog::PaperSizeTemplate;
auto OptTiledPageOrientation() const -> PageOrientation; auto OptTiledPageOrientation() const -> PageOrientation;
protected: auto OptStyle() const -> QString;
protected:
VCommandLine(); VCommandLine();
//@brief returns VAbstractLayoutDialog::PaperSizeTemplate //@brief returns VAbstractLayoutDialog::PaperSizeTemplate
@ -136,7 +137,8 @@ protected:
auto OptGroup() const -> Cases; auto OptGroup() const -> Cases;
//@brief: called in destructor of application, so instance destroyed and new maybe created (never happen scenario though) //@brief: called in destructor of application, so instance destroyed and new maybe created (never happen scenario
// though)
static void Reset(); static void Reset();
//@brief called to create single object, by VApplication only //@brief called to create single object, by VApplication only

View File

@ -31,7 +31,9 @@
#include "../vmisc/literals.h" #include "../vmisc/literals.h"
#include "../vmisc/vvalentinasettings.h" #include "../vmisc/vvalentinasettings.h"
#include "../vpatterndb/pmsystems.h" #include "../vpatterndb/pmsystems.h"
#include "theme/vtheme.h"
#include "ui_preferencesconfigurationpage.h" #include "ui_preferencesconfigurationpage.h"
#include "vcommonsettings.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h" #include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
@ -131,7 +133,12 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
ui->toolBarStyleCheck->setChecked(settings->GetToolBarStyle()); ui->toolBarStyleCheck->setChecked(settings->GetToolBarStyle());
// Theme // Theme
ui->darkModeCheck->setChecked(settings->GetDarkMode()); SetThemeModeComboBox();
index = ui->comboBoxThemeMode->findData(static_cast<int>(settings->GetThemeMode()));
if (index != -1)
{
ui->comboBoxThemeMode->setCurrentIndex(index);
}
// Native dialogs // Native dialogs
ui->checkBoxDontUseNativeDialog->setChecked(settings->IsDontUseNativeDialog()); ui->checkBoxDontUseNativeDialog->setChecked(settings->IsDontUseNativeDialog());
@ -187,10 +194,11 @@ auto PreferencesConfigurationPage::Apply() -> QStringList
settings->SetOsSeparator(ui->osOptionCheck->isChecked()); settings->SetOsSeparator(ui->osOptionCheck->isChecked());
settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked()); settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked());
if (settings->GetDarkMode() != ui->darkModeCheck->isChecked()) auto themeMode = static_cast<VThemeMode>(ui->comboBoxThemeMode->currentData().toInt());
if (settings->GetThemeMode() != themeMode)
{ {
settings->SetDarkMode(ui->darkModeCheck->isChecked()); settings->SetThemeMode(themeMode);
preferences.append(tr("dark mode")); VTheme::Instance()->ResetThemeSettings();
} }
if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked()) if (settings->IsDontUseNativeDialog() != ui->checkBoxDontUseNativeDialog->isChecked())
@ -279,6 +287,15 @@ void PreferencesConfigurationPage::SetLabelComboBox(const QStringList &list)
} }
} }
//---------------------------------------------------------------------------------------------------------------------
void PreferencesConfigurationPage::SetThemeModeComboBox()
{
ui->comboBoxThemeMode->clear();
ui->comboBoxThemeMode->addItem(tr("System", "theme"), static_cast<int>(VThemeMode::System));
ui->comboBoxThemeMode->addItem(tr("Dark", "theme"), static_cast<int>(VThemeMode::Dark));
ui->comboBoxThemeMode->addItem(tr("Light", "theme"), static_cast<int>(VThemeMode::Light));
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void PreferencesConfigurationPage::InitUnits() void PreferencesConfigurationPage::InitUnits()
{ {

View File

@ -40,7 +40,8 @@ class PreferencesConfigurationPage : public QWidget
{ {
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public : explicit PreferencesConfigurationPage(QWidget *parent = nullptr); public:
explicit PreferencesConfigurationPage(QWidget *parent = nullptr);
~PreferencesConfigurationPage() override; ~PreferencesConfigurationPage() override;
auto Apply() -> QStringList; auto Apply() -> QStringList;
@ -59,6 +60,7 @@ private:
bool m_labelLangChanged{false}; bool m_labelLangChanged{false};
void SetLabelComboBox(const QStringList &list); void SetLabelComboBox(const QStringList &list);
void SetThemeModeComboBox();
void InitUnits(); void InitUnits();
void RetranslateUi(); void RetranslateUi();
}; };

View File

@ -33,9 +33,9 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>-70</y>
<width>624</width> <width>624</width>
<height>869</height> <height>873</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
@ -91,7 +91,7 @@
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
@ -101,7 +101,14 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QComboBox" name="langCombo"/> <widget class="QComboBox" name="langCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_14"> <widget class="QLabel" name="label_14">
@ -160,7 +167,7 @@
</property> </property>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
@ -287,15 +294,29 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_7"> <layout class="QVBoxLayout" name="verticalLayout_7">
<item> <item>
<widget class="QCheckBox" name="darkModeCheck"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_16">
<property name="text"> <property name="text">
<string>Activate dark mode</string> <string>Theme:</string>
</property>
<property name="checked">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QComboBox" name="comboBoxThemeMode">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<widget class="QCheckBox" name="checkBoxDontUseNativeDialog"> <widget class="QCheckBox" name="checkBoxDontUseNativeDialog">
<property name="text"> <property name="text">
@ -346,7 +367,7 @@
</property> </property>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QFormLayout" name="formLayout_3">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_8">
@ -410,7 +431,7 @@
</property> </property>
<layout class="QFormLayout" name="formLayout_4"> <layout class="QFormLayout" name="formLayout_4">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_11">
@ -474,7 +495,7 @@
</property> </property>
<layout class="QFormLayout" name="formLayout_5"> <layout class="QFormLayout" name="formLayout_5">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">

View File

@ -138,7 +138,10 @@ PreferencesPatternPage::PreferencesPatternPage(QWidget *parent)
InitSingleLineFonts(); InitSingleLineFonts();
const qint32 indexFont = ui->comboBoxSingleLineFont->findData(settings->GetLabelSVGFont()); const qint32 indexFont = ui->comboBoxSingleLineFont->findData(settings->GetLabelSVGFont());
if (indexFont != -1)
{
ui->comboBoxSingleLineFont->setCurrentIndex(indexFont); ui->comboBoxSingleLineFont->setCurrentIndex(indexFont);
}
ui->checkBoxSingleStrokeOutlineFont->setChecked(settings->GetSingleStrokeOutlineFont()); ui->checkBoxSingleStrokeOutlineFont->setChecked(settings->GetSingleStrokeOutlineFont());
ui->checkBoxSingleLineFonts->setChecked(settings->GetSingleLineFonts()); ui->checkBoxSingleLineFonts->setChecked(settings->GetSingleLineFonts());
@ -252,6 +255,18 @@ void PreferencesPatternPage::changeEvent(QEvent *event)
RetranslateUi(); RetranslateUi();
ui->retranslateUi(this); ui->retranslateUi(this);
} }
if (event->type() == QEvent::PaletteChange)
{
QString currentSingleLineFont = ui->comboBoxSingleLineFont->currentData().toString();
InitSingleLineFonts();
const qint32 indexFont = ui->comboBoxSingleLineFont->findData(currentSingleLineFont);
if (indexFont != -1)
{
ui->comboBoxSingleLineFont->setCurrentIndex(indexFont);
}
}
// remember to call base class implementation // remember to call base class implementation
QWidget::changeEvent(event); QWidget::changeEvent(event);
} }
@ -344,6 +359,7 @@ void PreferencesPatternPage::InitSingleLineFonts()
ui->comboBoxSingleLineFont->setIconSize(QSize(previewScaledWidthPixels, previewScaledHeightPixels)); ui->comboBoxSingleLineFont->setIconSize(QSize(previewScaledWidthPixels, previewScaledHeightPixels));
QPen pen(Qt::SolidPattern, 1 * scale, Qt::SolidLine, Qt::RoundCap, Qt::SvgMiterJoin); QPen pen(Qt::SolidPattern, 1 * scale, Qt::SolidLine, Qt::RoundCap, Qt::SvgMiterJoin);
pen.setColor(ui->comboBoxSingleLineFont->palette().color(QPalette::Text));
VSvgFontDatabase *db = VAbstractApplication::VApp()->SVGFontDatabase(); VSvgFontDatabase *db = VAbstractApplication::VApp()->SVGFontDatabase();
QStringList families = db->Families(); QStringList families = db->Families();
@ -362,7 +378,7 @@ void PreferencesPatternPage::InitSingleLineFonts()
engine.SetFontPixelSize(previewScaledHeightPixels); engine.SetFontPixelSize(previewScaledHeightPixels);
QPixmap pixmap(previewScaledWidthPixels, previewScaledHeightPixels); QPixmap pixmap(previewScaledWidthPixels, previewScaledHeightPixels);
pixmap.fill(Qt::white); pixmap.fill(ui->comboBoxSingleLineFont->palette().color(QPalette::Base));
QPainter painter(&pixmap); QPainter painter(&pixmap);
painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(pen); painter.setPen(pen);

View File

@ -23,7 +23,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>-62</y>
<width>519</width> <width>519</width>
<height>1021</height> <height>1021</height>
</rect> </rect>
@ -61,7 +61,7 @@ This option will take an affect after restart.</string>
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -73,6 +73,12 @@ This option will take an affect after restart.</string>
</item> </item>
<item> <item>
<widget class="QDoubleSpinBox" name="doubleSpinBoxCurveApproximation"> <widget class="QDoubleSpinBox" name="doubleSpinBoxCurveApproximation">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Set default curve approximation scale</string> <string>Set default curve approximation scale</string>
</property> </property>
@ -90,19 +96,6 @@ This option will take an affect after restart.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_2">
<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> </layout>
</item> </item>
<item> <item>
@ -146,19 +139,6 @@ This option will take an affect after restart.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>500</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -294,6 +274,12 @@ This option will take an affect after restart.</string>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Size:</string> <string>Size:</string>
</property> </property>
@ -302,25 +288,18 @@ This option will take an affect after restart.</string>
<item> <item>
<widget class="QComboBox" name="comboBoxLabelFontSize"/> <widget class="QComboBox" name="comboBoxLabelFontSize"/>
</item> </item>
<item>
<spacer name="horizontalSpacer_5">
<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> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Outline font:</string> <string>Outline font:</string>
</property> </property>
@ -329,25 +308,18 @@ This option will take an affect after restart.</string>
<item> <item>
<widget class="QFontComboBox" name="fontComboBoxLabelFont"/> <widget class="QFontComboBox" name="fontComboBoxLabelFont"/>
</item> </item>
<item>
<spacer name="horizontalSpacer_6">
<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> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Single-line font:</string> <string>Single-line font:</string>
</property> </property>
@ -360,19 +332,6 @@ This option will take an affect after restart.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_7">
<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> </layout>
</item> </item>
<item> <item>

View File

@ -27,13 +27,13 @@
*************************************************************************/ *************************************************************************/
#include "dialogfinalmeasurements.h" #include "dialogfinalmeasurements.h"
#include "ui_dialogfinalmeasurements.h" #include "../qmuparser/qmudef.h"
#include "../vmisc/vvalentinasettings.h"
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"
#include "../vmisc/vabstractvalapplication.h" #include "../vmisc/vabstractvalapplication.h"
#include "../qmuparser/qmudef.h" #include "../vmisc/vvalentinasettings.h"
#include "../vpatterndb/calculator.h" #include "../vpatterndb/calculator.h"
#include "../vtools/dialogs/support/dialogeditwrongformula.h" #include "../vtools/dialogs/support/dialogeditwrongformula.h"
#include "ui_dialogfinalmeasurements.h"
#include <QMenu> #include <QMenu>
#include <qnumeric.h> #include <qnumeric.h>
@ -388,8 +388,8 @@ void DialogFinalMeasurements::SaveFormula()
try try
{ {
m_measurements[row].formula = VAbstractApplication::VApp()->TrVars() m_measurements[row].formula = VAbstractApplication::VApp()->TrVars()->FormulaFromUser(
->FormulaFromUser(text, VAbstractApplication::VApp()->Settings()->GetOsSeparator()); text, VAbstractApplication::VApp()->Settings()->GetOsSeparator());
} }
catch (qmu::QmuParserError &e) // Just in case something bad will happen catch (qmu::QmuParserError &e) // Just in case something bad will happen
{ {
@ -416,15 +416,13 @@ void DialogFinalMeasurements::DeployFormula()
{ {
ui->plainTextEditFormula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT); ui->plainTextEditFormula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT);
// Set icon from theme (internal for Windows system) // Set icon from theme (internal for Windows system)
ui->pushButtonGrow->setIcon(QIcon::fromTheme(QStringLiteral("go-next"), ui->pushButtonGrow->setIcon(QIcon::fromTheme(QStringLiteral("go-next")));
QIcon(":/icons/win.icon.theme/16x16/actions/go-next.png")));
} }
else else
{ {
ui->plainTextEditFormula->setFixedHeight(formulaBaseHeight); ui->plainTextEditFormula->setFixedHeight(formulaBaseHeight);
// Set icon from theme (internal for Windows system) // Set icon from theme (internal for Windows system)
ui->pushButtonGrow->setIcon(QIcon::fromTheme(QStringLiteral("go-down"), ui->pushButtonGrow->setIcon(QIcon::fromTheme(QStringLiteral("go-down")));
QIcon(":/icons/win.icon.theme/16x16/actions/go-down.png")));
} }
// I found that after change size of formula field, it was filed for angle formula, field for formula became black. // I found that after change size of formula field, it was filed for angle formula, field for formula became black.
@ -492,14 +490,12 @@ void DialogFinalMeasurements::FillFinalMeasurements(bool freshCall)
bool ok = true; bool ok = true;
const qreal result = EvalFormula(m.formula, ok); const qreal result = EvalFormula(m.formula, ok);
AddCell(VAbstractApplication::VApp() AddCell(VAbstractApplication::VApp()->LocaleToString(result), i, 1, Qt::AlignHCenter | Qt::AlignVCenter,
->LocaleToString(result), i, 1, Qt::AlignHCenter | Qt::AlignVCenter, ok); // calculated value ok); // calculated value
const QString formula = const QString formula =
VTranslateVars::TryFormulaFromUser(m.formula, VTranslateVars::TryFormulaFromUser(m.formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator());
VAbstractApplication::VApp()->Settings()->GetOsSeparator());
AddCell(formula, i, 2, Qt::AlignVCenter); // formula AddCell(formula, i, 2, Qt::AlignVCenter); // formula
} }
if (freshCall) if (freshCall)
@ -570,8 +566,8 @@ auto DialogFinalMeasurements::EvalUserFormula(const QString &formula, bool fromU
// Replace line return character with spaces for calc if exist // Replace line return character with spaces for calc if exist
if (fromUser) if (fromUser)
{ {
f = VAbstractApplication::VApp()->TrVars() f = VAbstractApplication::VApp()->TrVars()->FormulaFromUser(
->FormulaFromUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator()); formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator());
} }
else else
{ {
@ -588,8 +584,8 @@ auto DialogFinalMeasurements::EvalUserFormula(const QString &formula, bool fromU
return false; return false;
} }
ui->labelCalculatedValue->setText( ui->labelCalculatedValue->setText(VAbstractApplication::VApp()->LocaleToString(result) + QChar(QChar::Space) +
VAbstractApplication::VApp()->LocaleToString(result) + QChar(QChar::Space) + postfix); postfix);
ui->labelCalculatedValue->setToolTip(tr("Value")); ui->labelCalculatedValue->setToolTip(tr("Value"));
return true; return true;
} }
@ -732,28 +728,34 @@ void DialogFinalMeasurements::InitSearch()
UpdateSearchControlsTooltips(); UpdateSearchControlsTooltips();
connect(ui->lineEditFind, &QLineEdit::textEdited, this, [this](const QString &term) { m_search->Find(term); }); connect(ui->lineEditFind, &QLineEdit::textEdited, this, [this](const QString &term) { m_search->Find(term); });
connect(ui->lineEditFind, &QLineEdit::editingFinished, this, [this]() connect(ui->lineEditFind, &QLineEdit::editingFinished, this,
[this]()
{ {
SaveSearchRequest(); SaveSearchRequest();
InitSearchHistory(); InitSearchHistory();
m_search->Find(ui->lineEditFind->text()); m_search->Find(ui->lineEditFind->text());
}); });
connect(ui->toolButtonFindPrevious, &QToolButton::clicked, this, [this]() connect(ui->toolButtonFindPrevious, &QToolButton::clicked, this,
[this]()
{ {
SaveSearchRequest(); SaveSearchRequest();
InitSearchHistory(); InitSearchHistory();
m_search->FindPrevious(); m_search->FindPrevious();
ui->labelResults->setText(QStringLiteral("%1/%2").arg(m_search->MatchIndex()+1).arg(m_search->MatchCount())); ui->labelResults->setText(
QStringLiteral("%1/%2").arg(m_search->MatchIndex() + 1).arg(m_search->MatchCount()));
}); });
connect(ui->toolButtonFindNext, &QToolButton::clicked, this, [this]() connect(ui->toolButtonFindNext, &QToolButton::clicked, this,
[this]()
{ {
SaveSearchRequest(); SaveSearchRequest();
InitSearchHistory(); InitSearchHistory();
m_search->FindNext(); m_search->FindNext();
ui->labelResults->setText(QStringLiteral("%1/%2").arg(m_search->MatchIndex()+1).arg(m_search->MatchCount())); ui->labelResults->setText(
QStringLiteral("%1/%2").arg(m_search->MatchIndex() + 1).arg(m_search->MatchCount()));
}); });
connect(m_search.data(), &VTableSearch::HasResult, this, [this] (bool state) connect(m_search.data(), &VTableSearch::HasResult, this,
[this](bool state)
{ {
ui->toolButtonFindPrevious->setEnabled(state); ui->toolButtonFindPrevious->setEnabled(state);
ui->toolButtonFindNext->setEnabled(state); ui->toolButtonFindNext->setEnabled(state);
@ -786,21 +788,24 @@ void DialogFinalMeasurements::InitSearch()
} }
}); });
connect(ui->toolButtonCaseSensitive, &QToolButton::toggled, this, [this](bool checked) connect(ui->toolButtonCaseSensitive, &QToolButton::toggled, this,
[this](bool checked)
{ {
m_search->SetMatchCase(checked); m_search->SetMatchCase(checked);
m_search->Find(ui->lineEditFind->text()); m_search->Find(ui->lineEditFind->text());
ui->lineEditFind->setPlaceholderText(m_search->SearchPlaceholder()); ui->lineEditFind->setPlaceholderText(m_search->SearchPlaceholder());
}); });
connect(ui->toolButtonWholeWord, &QToolButton::toggled, this, [this](bool checked) connect(ui->toolButtonWholeWord, &QToolButton::toggled, this,
[this](bool checked)
{ {
m_search->SetMatchWord(checked); m_search->SetMatchWord(checked);
m_search->Find(ui->lineEditFind->text()); m_search->Find(ui->lineEditFind->text());
ui->lineEditFind->setPlaceholderText(m_search->SearchPlaceholder()); ui->lineEditFind->setPlaceholderText(m_search->SearchPlaceholder());
}); });
connect(ui->toolButtonRegexp, &QToolButton::toggled, this, [this](bool checked) connect(ui->toolButtonRegexp, &QToolButton::toggled, this,
[this](bool checked)
{ {
m_search->SetMatchRegexp(checked); m_search->SetMatchRegexp(checked);
@ -825,7 +830,8 @@ void DialogFinalMeasurements::InitSearch()
ui->lineEditFind->setPlaceholderText(m_search->SearchPlaceholder()); ui->lineEditFind->setPlaceholderText(m_search->SearchPlaceholder());
}); });
connect(ui->toolButtonUseUnicodeProperties, &QToolButton::toggled, this, [this](bool checked) connect(ui->toolButtonUseUnicodeProperties, &QToolButton::toggled, this,
[this](bool checked)
{ {
m_search->SetUseUnicodePreperties(checked); m_search->SetUseUnicodePreperties(checked);
m_search->Find(ui->lineEditFind->text()); m_search->Find(ui->lineEditFind->text());
@ -846,7 +852,8 @@ void DialogFinalMeasurements::InitSearchHistory()
{ {
QAction *action = m_searchHistory->addAction(term); QAction *action = m_searchHistory->addAction(term);
action->setData(term); action->setData(term);
connect(action, &QAction::triggered, this, [this]() connect(action, &QAction::triggered, this,
[this]()
{ {
auto *action = qobject_cast<QAction *>(sender()); auto *action = qobject_cast<QAction *>(sender());
if (action != nullptr) if (action != nullptr)

View File

@ -1818,15 +1818,13 @@ void DialogIncrements::DeployFormula()
{ {
plainTextEditFormula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT); plainTextEditFormula->setFixedHeight(DIALOG_MAX_FORMULA_HEIGHT);
// Set icon from theme (internal for Windows system) // Set icon from theme (internal for Windows system)
pushButtonGrow->setIcon( pushButtonGrow->setIcon(QIcon::fromTheme(QStringLiteral("go-next")));
QIcon::fromTheme(QStringLiteral("go-next"), QIcon(":/icons/win.icon.theme/16x16/actions/go-next.png")));
} }
else else
{ {
plainTextEditFormula->setFixedHeight(baseHeight); plainTextEditFormula->setFixedHeight(baseHeight);
// Set icon from theme (internal for Windows system) // Set icon from theme (internal for Windows system)
pushButtonGrow->setIcon( pushButtonGrow->setIcon(QIcon::fromTheme(QStringLiteral("go-down")));
QIcon::fromTheme(QStringLiteral("go-down"), QIcon(":/icons/win.icon.theme/16x16/actions/go-down.png")));
} }
// I found that after change size of formula field, it was filed for angle formula, field for formula became black. // I found that after change size of formula field, it was filed for angle formula, field for formula became black.

View File

@ -27,13 +27,14 @@
*************************************************************************/ *************************************************************************/
#include "dialogpreferences.h" #include "dialogpreferences.h"
#include "ui_dialogpreferences.h"
#include "configpages/preferencesconfigurationpage.h"
#include "configpages/preferencespatternpage.h"
#include "configpages/preferencespathpage.h"
#include "../vmisc/vvalentinasettings.h"
#include "../vmisc/vabstractvalapplication.h" #include "../vmisc/vabstractvalapplication.h"
#include "../vmisc/vvalentinasettings.h"
#include "configpages/preferencesconfigurationpage.h"
#include "configpages/preferencespathpage.h"
#include "configpages/preferencespatternpage.h"
#include "ui_dialogpreferences.h"
#include <QApplication>
#include <QMessageBox> #include <QMessageBox>
#include <QPushButton> #include <QPushButton>
#include <QShowEvent> #include <QShowEvent>
@ -121,6 +122,24 @@ void DialogPreferences::changeEvent(QEvent *event)
// retranslate designer form (single inheritance approach) // retranslate designer form (single inheritance approach)
ui->retranslateUi(this); ui->retranslateUi(this);
} }
if (event->type() == QEvent::PaletteChange)
{
QStyle *style = QApplication::style();
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
SCASSERT(bOk != nullptr)
bOk->setIcon(style->standardIcon(QStyle::SP_DialogOkButton));
QPushButton *bApply = ui->buttonBox->button(QDialogButtonBox::Apply);
SCASSERT(bApply != nullptr)
bApply->setIcon(style->standardIcon(QStyle::SP_DialogApplyButton));
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
SCASSERT(bCancel != nullptr)
bCancel->setIcon(style->standardIcon(QStyle::SP_DialogCancelButton));
}
// remember to call base class implementation // remember to call base class implementation
QDialog::changeEvent(event); QDialog::changeEvent(event);
} }
@ -147,12 +166,12 @@ void DialogPreferences::Apply()
if (not preferences.isEmpty()) if (not preferences.isEmpty())
{ {
const QString text = tr("Followed %n option(s) require restart to take effect: %1.", "", const QString text =
static_cast<int>(preferences.size())).arg(preferences.join(QStringLiteral(", "))); tr("Followed %n option(s) require restart to take effect: %1.", "", static_cast<int>(preferences.size()))
.arg(preferences.join(QStringLiteral(", ")));
QMessageBox::information(this, QCoreApplication::applicationName(), text); QMessageBox::information(this, QCoreApplication::applicationName(), text);
} }
m_patternPage->InitDefaultSeamAllowance(); m_patternPage->InitDefaultSeamAllowance();
VAbstractValApplication::VApp()->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale()) VAbstractValApplication::VApp()->ValentinaSettings()->GetOsSeparator() ? setLocale(QLocale())

View File

@ -26,10 +26,11 @@
** **
*************************************************************************/ *************************************************************************/
#include "mainwindow.h"
#include "core/vapplication.h"
#include "../fervor/fvupdater.h" #include "../fervor/fvupdater.h"
#include "../vpatterndb/vpiecenode.h" #include "../vpatterndb/vpiecenode.h"
#include "core/vapplication.h"
#include "mainwindow.h"
#include "vabstractapplication.h"
#include <QMessageBox> // For QT_REQUIRE_VERSION #include <QMessageBox> // For QT_REQUIRE_VERSION
#include <QTimer> #include <QTimer>
@ -60,11 +61,15 @@ auto main(int argc, char *argv[]) -> int
Q_INIT_RESOURCE(cursor); // NOLINT Q_INIT_RESOURCE(cursor); // NOLINT
Q_INIT_RESOURCE(icon); // NOLINT Q_INIT_RESOURCE(icon); // NOLINT
Q_INIT_RESOURCE(schema); // NOLINT Q_INIT_RESOURCE(schema); // NOLINT
Q_INIT_RESOURCE(theme); // NOLINT
Q_INIT_RESOURCE(flags); // NOLINT Q_INIT_RESOURCE(flags); // NOLINT
Q_INIT_RESOURCE(icons); // NOLINT Q_INIT_RESOURCE(icons); // NOLINT
Q_INIT_RESOURCE(toolicon); // NOLINT Q_INIT_RESOURCE(toolicon); // NOLINT
Q_INIT_RESOURCE(style); // NOLINT Q_INIT_RESOURCE(breeze); // NOLINT
#if defined(Q_OS_MACX)
Q_INIT_RESOURCE(mac_theme); // NOLINT
#else
Q_INIT_RESOURCE(win_theme); // NOLINT
#endif
QT_REQUIRE_VERSION(argc, argv, "5.4.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT QT_REQUIRE_VERSION(argc, argv, "5.4.0") // clazy:exclude=qstring-arg,qstring-allocations NOLINT
@ -79,7 +84,7 @@ auto main(int argc, char *argv[]) -> int
#ifndef Q_OS_MAC // supports natively #ifndef Q_OS_MAC // supports natively
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
InitHighDpiScaling(argc, argv); VAbstractApplication::InitHighDpiScaling(argc, argv);
#endif #endif
#endif // Q_OS_MAC #endif // Q_OS_MAC

View File

@ -54,6 +54,7 @@
#include "../vwidgets/vwidgetpopup.h" #include "../vwidgets/vwidgetpopup.h"
#include "core/vapplication.h" #include "core/vapplication.h"
#include "core/vtooloptionspropertybrowser.h" #include "core/vtooloptionspropertybrowser.h"
#include "theme/vtheme.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "vabstractapplication.h" #include "vabstractapplication.h"
#include "vsinglelineoutlinechar.h" #include "vsinglelineoutlinechar.h"
@ -826,7 +827,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons
CancelTool(); CancelTool();
emit EnableItemMove(false); emit EnableItemMove(false);
m_currentTool = m_lastUsedTool = t; m_currentTool = m_lastUsedTool = t;
auto cursorResource = cursor; auto cursorResource = VTheme::GetResourceName(QStringLiteral("cursor"), cursor);
if (qApp->devicePixelRatio() >= 2) // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) if (qApp->devicePixelRatio() >= 2) // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
{ {
// Try to load HiDPI versions of the cursors if availible // Try to load HiDPI versions of the cursors if availible
@ -1030,7 +1031,7 @@ template <typename DrawTool> void MainWindow::ApplyDetailsDialog()
void MainWindow::ToolEndLine(bool checked) void MainWindow::ToolEndLine(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogEndLine>(checked, Tool::EndLine, QStringLiteral(":/cursor/endline_cursor.png"), SetToolButtonWithApply<DialogEndLine>(checked, Tool::EndLine, QStringLiteral("segment_cursor.png"),
tr("Select point"), &MainWindow::ClosedDrawDialogWithApply<VToolEndLine>, tr("Select point"), &MainWindow::ClosedDrawDialogWithApply<VToolEndLine>,
&MainWindow::ApplyDrawDialog<VToolEndLine>); &MainWindow::ApplyDrawDialog<VToolEndLine>);
} }
@ -1043,8 +1044,8 @@ void MainWindow::ToolEndLine(bool checked)
void MainWindow::ToolLine(bool checked) void MainWindow::ToolLine(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogLine>(checked, Tool::Line, QStringLiteral(":/cursor/line_cursor.png"), SetToolButtonWithApply<DialogLine>(checked, Tool::Line, QStringLiteral("line_cursor.png"), tr("Select first point"),
tr("Select first point"), &MainWindow::ClosedDrawDialogWithApply<VToolLine>, &MainWindow::ClosedDrawDialogWithApply<VToolLine>,
&MainWindow::ApplyDrawDialog<VToolLine>); &MainWindow::ApplyDrawDialog<VToolLine>);
} }
@ -1056,7 +1057,7 @@ void MainWindow::ToolLine(bool checked)
void MainWindow::ToolAlongLine(bool checked) void MainWindow::ToolAlongLine(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogAlongLine>(checked, Tool::AlongLine, QStringLiteral(":/cursor/alongline_cursor.png"), SetToolButtonWithApply<DialogAlongLine>(checked, Tool::AlongLine, QStringLiteral("along_line_cursor.png"),
tr("Select point"), &MainWindow::ClosedDrawDialogWithApply<VToolAlongLine>, tr("Select point"), &MainWindow::ClosedDrawDialogWithApply<VToolAlongLine>,
&MainWindow::ApplyDrawDialog<VToolAlongLine>); &MainWindow::ApplyDrawDialog<VToolAlongLine>);
} }
@ -1066,7 +1067,7 @@ void MainWindow::ToolMidpoint(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
// Reuse DialogAlongLine and VToolAlongLine but with different cursor // Reuse DialogAlongLine and VToolAlongLine but with different cursor
SetToolButtonWithApply<DialogAlongLine>(checked, Tool::Midpoint, QStringLiteral(":/cursor/midpoint_cursor.png"), SetToolButtonWithApply<DialogAlongLine>(checked, Tool::Midpoint, QStringLiteral("midpoint_cursor.png"),
tr("Select point"), &MainWindow::ClosedDrawDialogWithApply<VToolAlongLine>, tr("Select point"), &MainWindow::ClosedDrawDialogWithApply<VToolAlongLine>,
&MainWindow::ApplyDrawDialog<VToolAlongLine>); &MainWindow::ApplyDrawDialog<VToolAlongLine>);
} }
@ -1080,7 +1081,7 @@ void MainWindow::ToolShoulderPoint(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogShoulderPoint>( SetToolButtonWithApply<DialogShoulderPoint>(
checked, Tool::ShoulderPoint, QStringLiteral(":/cursor/shoulder_cursor.png"), tr("Select point"), checked, Tool::ShoulderPoint, QStringLiteral("shoulder_cursor.png"), tr("Select point"),
&MainWindow::ClosedDrawDialogWithApply<VToolShoulderPoint>, &MainWindow::ApplyDrawDialog<VToolShoulderPoint>); &MainWindow::ClosedDrawDialogWithApply<VToolShoulderPoint>, &MainWindow::ApplyDrawDialog<VToolShoulderPoint>);
} }
@ -1093,7 +1094,7 @@ void MainWindow::ToolNormal(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogNormal>( SetToolButtonWithApply<DialogNormal>(
checked, Tool::Normal, QStringLiteral(":/cursor/normal_cursor.png"), tr("Select first point of line"), checked, Tool::Normal, QStringLiteral("normal_cursor.png"), tr("Select first point of line"),
&MainWindow::ClosedDrawDialogWithApply<VToolNormal>, &MainWindow::ApplyDrawDialog<VToolNormal>); &MainWindow::ClosedDrawDialogWithApply<VToolNormal>, &MainWindow::ApplyDrawDialog<VToolNormal>);
} }
@ -1106,7 +1107,7 @@ void MainWindow::ToolBisector(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogBisector>( SetToolButtonWithApply<DialogBisector>(
checked, Tool::Bisector, QStringLiteral(":/cursor/bisector_cursor.png"), tr("Select first point of angle"), checked, Tool::Bisector, QStringLiteral("bisector_cursor.png"), tr("Select first point of angle"),
&MainWindow::ClosedDrawDialogWithApply<VToolBisector>, &MainWindow::ApplyDrawDialog<VToolBisector>); &MainWindow::ClosedDrawDialogWithApply<VToolBisector>, &MainWindow::ApplyDrawDialog<VToolBisector>);
} }
@ -1119,9 +1120,8 @@ void MainWindow::ToolLineIntersect(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogLineIntersect>( SetToolButtonWithApply<DialogLineIntersect>(
checked, Tool::LineIntersect, QStringLiteral(":/cursor/intersect_cursor.png"), checked, Tool::LineIntersect, QStringLiteral("intersect_cursor.png"), tr("Select first point of first line"),
tr("Select first point of first line"), &MainWindow::ClosedDrawDialogWithApply<VToolLineIntersect>, &MainWindow::ClosedDrawDialogWithApply<VToolLineIntersect>, &MainWindow::ApplyDrawDialog<VToolLineIntersect>);
&MainWindow::ApplyDrawDialog<VToolLineIntersect>);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -1133,7 +1133,7 @@ void MainWindow::ToolSpline(bool checked)
{ {
ToolSelectPointByPress(); ToolSelectPointByPress();
SetToolButtonWithApply<DialogSpline>( SetToolButtonWithApply<DialogSpline>(
checked, Tool::Spline, QStringLiteral(":/cursor/spline_cursor.png"), tr("Select first point curve"), checked, Tool::Spline, QStringLiteral("spline_cursor.png"), tr("Select first point curve"),
&MainWindow::ClosedDrawDialogWithApply<VToolSpline>, &MainWindow::ApplyDrawDialog<VToolSpline>); &MainWindow::ClosedDrawDialogWithApply<VToolSpline>, &MainWindow::ApplyDrawDialog<VToolSpline>);
} }
@ -1142,7 +1142,7 @@ void MainWindow::ToolCubicBezier(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogCubicBezier>( SetToolButtonWithApply<DialogCubicBezier>(
checked, Tool::CubicBezier, QStringLiteral(":/cursor/cubic_bezier_cursor.png"), tr("Select first curve point"), checked, Tool::CubicBezier, QStringLiteral("cubic_bezier_cursor.png"), tr("Select first curve point"),
&MainWindow::ClosedDrawDialogWithApply<VToolCubicBezier>, &MainWindow::ApplyDrawDialog<VToolCubicBezier>); &MainWindow::ClosedDrawDialogWithApply<VToolCubicBezier>, &MainWindow::ApplyDrawDialog<VToolCubicBezier>);
} }
@ -1155,7 +1155,7 @@ void MainWindow::ToolCutSpline(bool checked)
{ {
ToolSelectSpline(); ToolSelectSpline();
SetToolButtonWithApply<DialogCutSpline>( SetToolButtonWithApply<DialogCutSpline>(
checked, Tool::CutSpline, QStringLiteral(":/cursor/spline_cut_point_cursor.png"), tr("Select simple curve"), checked, Tool::CutSpline, QStringLiteral("spline_cut_point_cursor.png"), tr("Select simple curve"),
&MainWindow::ClosedDrawDialogWithApply<VToolCutSpline>, &MainWindow::ApplyDrawDialog<VToolCutSpline>); &MainWindow::ClosedDrawDialogWithApply<VToolCutSpline>, &MainWindow::ApplyDrawDialog<VToolCutSpline>);
} }
@ -1168,7 +1168,7 @@ void MainWindow::ToolArc(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogArc>( SetToolButtonWithApply<DialogArc>(
checked, Tool::Arc, QStringLiteral(":/cursor/arc_cursor.png"), tr("Select point of center of arc"), checked, Tool::Arc, QStringLiteral("arc_cursor.png"), tr("Select point of center of arc"),
&MainWindow::ClosedDrawDialogWithApply<VToolArc>, &MainWindow::ApplyDrawDialog<VToolArc>); &MainWindow::ClosedDrawDialogWithApply<VToolArc>, &MainWindow::ApplyDrawDialog<VToolArc>);
} }
@ -1180,9 +1180,9 @@ void MainWindow::ToolArc(bool checked)
void MainWindow::ToolEllipticalArc(bool checked) void MainWindow::ToolEllipticalArc(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogEllipticalArc>( SetToolButtonWithApply<DialogEllipticalArc>(checked, Tool::EllipticalArc, QStringLiteral("el_arc_cursor.png"),
checked, Tool::EllipticalArc, QStringLiteral(":/cursor/el_arc_cursor.png"), tr("Select point of center of elliptical arc"),
tr("Select point of center of elliptical arc"), &MainWindow::ClosedDrawDialogWithApply<VToolEllipticalArc>, &MainWindow::ClosedDrawDialogWithApply<VToolEllipticalArc>,
&MainWindow::ApplyDrawDialog<VToolEllipticalArc>); &MainWindow::ApplyDrawDialog<VToolEllipticalArc>);
} }
@ -1195,7 +1195,7 @@ void MainWindow::ToolSplinePath(bool checked)
{ {
ToolSelectPointByPress(); ToolSelectPointByPress();
SetToolButtonWithApply<DialogSplinePath>( SetToolButtonWithApply<DialogSplinePath>(
checked, Tool::SplinePath, QStringLiteral(":/cursor/splinepath_cursor.png"), tr("Select point of curve path"), checked, Tool::SplinePath, QStringLiteral("splinePath_cursor.png"), tr("Select point of curve path"),
&MainWindow::ClosedDrawDialogWithApply<VToolSplinePath>, &MainWindow::ApplyDrawDialog<VToolSplinePath>); &MainWindow::ClosedDrawDialogWithApply<VToolSplinePath>, &MainWindow::ApplyDrawDialog<VToolSplinePath>);
} }
@ -1204,7 +1204,7 @@ void MainWindow::ToolCubicBezierPath(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogCubicBezierPath>( SetToolButtonWithApply<DialogCubicBezierPath>(
checked, Tool::CubicBezierPath, QStringLiteral(":/cursor/cubic_bezier_path_cursor.png"), checked, Tool::CubicBezierPath, QStringLiteral("cubic_bezier_path_cursor.png"),
tr("Select point of cubic bezier path"), &MainWindow::ClosedDrawDialogWithApply<VToolCubicBezierPath>, tr("Select point of cubic bezier path"), &MainWindow::ClosedDrawDialogWithApply<VToolCubicBezierPath>,
&MainWindow::ApplyDrawDialog<VToolCubicBezierPath>); &MainWindow::ApplyDrawDialog<VToolCubicBezierPath>);
} }
@ -1218,9 +1218,8 @@ void MainWindow::ToolCutSplinePath(bool checked)
{ {
ToolSelectSplinePath(); ToolSelectSplinePath();
SetToolButtonWithApply<DialogCutSplinePath>( SetToolButtonWithApply<DialogCutSplinePath>(
checked, Tool::CutSplinePath, QStringLiteral(":/cursor/splinepath_cut_point_cursor.png"), checked, Tool::CutSplinePath, QStringLiteral("splinePath_cut_point_cursor.png"), tr("Select curve path"),
tr("Select curve path"), &MainWindow::ClosedDrawDialogWithApply<VToolCutSplinePath>, &MainWindow::ClosedDrawDialogWithApply<VToolCutSplinePath>, &MainWindow::ApplyDrawDialog<VToolCutSplinePath>);
&MainWindow::ApplyDrawDialog<VToolCutSplinePath>);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -1232,9 +1231,8 @@ void MainWindow::ToolPointOfContact(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogPointOfContact>( SetToolButtonWithApply<DialogPointOfContact>(
checked, Tool::PointOfContact, QStringLiteral(":/cursor/pointcontact_cursor.png"), checked, Tool::PointOfContact, QStringLiteral("point_of_contact_cursor.png"), tr("Select first point of line"),
tr("Select first point of line"), &MainWindow::ClosedDrawDialogWithApply<VToolPointOfContact>, &MainWindow::ClosedDrawDialogWithApply<VToolPointOfContact>, &MainWindow::ApplyDrawDialog<VToolPointOfContact>);
&MainWindow::ApplyDrawDialog<VToolPointOfContact>);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -1245,7 +1243,7 @@ void MainWindow::ToolPointOfContact(bool checked)
void MainWindow::ToolDetail(bool checked) void MainWindow::ToolDetail(bool checked)
{ {
ToolSelectAllDrawObjects(); ToolSelectAllDrawObjects();
SetToolButtonWithApply<DialogSeamAllowance>(checked, Tool::Piece, QStringLiteral("://cursor/new_detail_cursor.png"), SetToolButtonWithApply<DialogSeamAllowance>(checked, Tool::Piece, QStringLiteral("new_detail_cursor.png"),
tr("Select main path objects clockwise."), tr("Select main path objects clockwise."),
&MainWindow::ClosedDetailsDialogWithApply<VToolSeamAllowance>, &MainWindow::ClosedDetailsDialogWithApply<VToolSeamAllowance>,
&MainWindow::ApplyDetailsDialog<VToolSeamAllowance>); &MainWindow::ApplyDetailsDialog<VToolSeamAllowance>);
@ -1256,7 +1254,7 @@ void MainWindow::ToolPiecePath(bool checked)
{ {
ToolSelectAllDrawObjects(); ToolSelectAllDrawObjects();
SetToolButton<DialogPiecePath>( SetToolButton<DialogPiecePath>(
checked, Tool::PiecePath, QStringLiteral("://cursor/path_cursor.png"), checked, Tool::PiecePath, QStringLiteral("path_cursor.png"),
tr("Select path objects, <b>%1</b> - reverse direction curve").arg(VModifierKey::Shift()), tr("Select path objects, <b>%1</b> - reverse direction curve").arg(VModifierKey::Shift()),
&MainWindow::ClosedDialogPiecePath); &MainWindow::ClosedDialogPiecePath);
} }
@ -1265,7 +1263,7 @@ void MainWindow::ToolPiecePath(bool checked)
void MainWindow::ToolPin(bool checked) void MainWindow::ToolPin(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButton<DialogPin>(checked, Tool::Pin, QStringLiteral("://cursor/pin_cursor.png"), tr("Select pin point"), SetToolButton<DialogPin>(checked, Tool::Pin, QStringLiteral("pin_cursor.png"), tr("Select pin point"),
&MainWindow::ClosedDialogPin); &MainWindow::ClosedDialogPin);
} }
@ -1273,7 +1271,7 @@ void MainWindow::ToolPin(bool checked)
void MainWindow::ToolPlaceLabel(bool checked) void MainWindow::ToolPlaceLabel(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButton<DialogPlaceLabel>(checked, Tool::PlaceLabel, QStringLiteral("://cursor/place_label_cursor.png"), SetToolButton<DialogPlaceLabel>(checked, Tool::PlaceLabel, QStringLiteral("place_label_cursor.png"),
tr("Select placelabel center point"), &MainWindow::ClosedDialogPlaceLabel); tr("Select placelabel center point"), &MainWindow::ClosedDialogPlaceLabel);
} }
@ -1285,7 +1283,7 @@ void MainWindow::ToolPlaceLabel(bool checked)
void MainWindow::ToolHeight(bool checked) void MainWindow::ToolHeight(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogHeight>(checked, Tool::Height, QStringLiteral(":/cursor/height_cursor.png"), SetToolButtonWithApply<DialogHeight>(checked, Tool::Height, QStringLiteral("height_cursor.png"),
tr("Select base point"), &MainWindow::ClosedDrawDialogWithApply<VToolHeight>, tr("Select base point"), &MainWindow::ClosedDrawDialogWithApply<VToolHeight>,
&MainWindow::ApplyDrawDialog<VToolHeight>); &MainWindow::ApplyDrawDialog<VToolHeight>);
} }
@ -1299,7 +1297,7 @@ void MainWindow::ToolTriangle(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogTriangle>( SetToolButtonWithApply<DialogTriangle>(
checked, Tool::Triangle, QStringLiteral(":/cursor/triangle_cursor.png"), tr("Select first point of axis"), checked, Tool::Triangle, QStringLiteral("triangle_cursor.png"), tr("Select first point of axis"),
&MainWindow::ClosedDrawDialogWithApply<VToolTriangle>, &MainWindow::ApplyDrawDialog<VToolTriangle>); &MainWindow::ClosedDrawDialogWithApply<VToolTriangle>, &MainWindow::ApplyDrawDialog<VToolTriangle>);
} }
@ -1312,7 +1310,7 @@ void MainWindow::ToolPointOfIntersection(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogPointOfIntersection>( SetToolButtonWithApply<DialogPointOfIntersection>(
checked, Tool::PointOfIntersection, QStringLiteral(":/cursor/pointofintersect_cursor.png"), checked, Tool::PointOfIntersection, QStringLiteral("point_of_intersection_cursor.png"),
tr("Select point for X value (vertical)"), &MainWindow::ClosedDrawDialogWithApply<VToolPointOfIntersection>, tr("Select point for X value (vertical)"), &MainWindow::ClosedDrawDialogWithApply<VToolPointOfIntersection>,
&MainWindow::ApplyDrawDialog<VToolPointOfIntersection>); &MainWindow::ApplyDrawDialog<VToolPointOfIntersection>);
} }
@ -1325,7 +1323,7 @@ void MainWindow::ToolPointOfIntersection(bool checked)
void MainWindow::ToolUnionDetails(bool checked) void MainWindow::ToolUnionDetails(bool checked)
{ {
ToolSelectDetail(); ToolSelectDetail();
SetToolButton<DialogUnionDetails>(checked, Tool::UnionDetails, QStringLiteral(":/cursor/union_cursor.png"), SetToolButton<DialogUnionDetails>(checked, Tool::UnionDetails, QStringLiteral("union_cursor.png"),
tr("Select detail"), &MainWindow::ClosedDialogUnionDetails); tr("Select detail"), &MainWindow::ClosedDialogUnionDetails);
} }
@ -1343,9 +1341,8 @@ void MainWindow::ClosedDialogUnionDetails(int result)
void MainWindow::ToolDuplicateDetail(bool checked) void MainWindow::ToolDuplicateDetail(bool checked)
{ {
ToolSelectDetail(); ToolSelectDetail();
SetToolButton<DialogDuplicateDetail>(checked, Tool::DuplicateDetail, SetToolButton<DialogDuplicateDetail>(checked, Tool::DuplicateDetail, QStringLiteral("duplicate_detail_cursor.png"),
QStringLiteral(":/cursor/duplicate_detail_cursor.png"), tr("Select detail"), tr("Select detail"), &MainWindow::ClosedDialogDuplicateDetail);
&MainWindow::ClosedDialogDuplicateDetail);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -1371,7 +1368,7 @@ void MainWindow::ToolGroup(bool checked)
const QString tooltip = tr("Select one or more objects, hold <b>%1</b> - for multiple selection, " const QString tooltip = tr("Select one or more objects, hold <b>%1</b> - for multiple selection, "
"<b>%2</b> - finish creation") "<b>%2</b> - finish creation")
.arg(VModifierKey::Control(), VModifierKey::EnterKey()); .arg(VModifierKey::Control(), VModifierKey::EnterKey());
SetToolButton<DialogGroup>(checked, Tool::Group, QStringLiteral(":/cursor/group_plus_cursor.png"), tooltip, SetToolButton<DialogGroup>(checked, Tool::Group, QStringLiteral("group_plus_cursor.png"), tooltip,
&MainWindow::ClosedDialogGroup); &MainWindow::ClosedDialogGroup);
} }
@ -1382,8 +1379,8 @@ void MainWindow::ToolRotation(bool checked)
const QString tooltip = tr("Select one or more objects, hold <b>%1</b> - for multiple selection, " const QString tooltip = tr("Select one or more objects, hold <b>%1</b> - for multiple selection, "
"<b>%2</b> - confirm selection") "<b>%2</b> - confirm selection")
.arg(VModifierKey::Control(), VModifierKey::EnterKey()); .arg(VModifierKey::Control(), VModifierKey::EnterKey());
SetToolButtonWithApply<DialogRotation>(checked, Tool::Rotation, QStringLiteral(":/cursor/rotation_cursor.png"), SetToolButtonWithApply<DialogRotation>(checked, Tool::Rotation, QStringLiteral("rotation_cursor.png"), tooltip,
tooltip, &MainWindow::ClosedDrawDialogWithApply<VToolRotation>, &MainWindow::ClosedDrawDialogWithApply<VToolRotation>,
&MainWindow::ApplyDrawDialog<VToolRotation>); &MainWindow::ApplyDrawDialog<VToolRotation>);
} }
@ -1395,7 +1392,7 @@ void MainWindow::ToolFlippingByLine(bool checked)
"<b>%2</b> - confirm selection") "<b>%2</b> - confirm selection")
.arg(VModifierKey::Control(), VModifierKey::EnterKey()); .arg(VModifierKey::Control(), VModifierKey::EnterKey());
SetToolButtonWithApply<DialogFlippingByLine>( SetToolButtonWithApply<DialogFlippingByLine>(
checked, Tool::FlippingByLine, QStringLiteral(":/cursor/flipping_line_cursor.png"), tooltip, checked, Tool::FlippingByLine, QStringLiteral("flipping_line_cursor.png"), tooltip,
&MainWindow::ClosedDrawDialogWithApply<VToolFlippingByLine>, &MainWindow::ApplyDrawDialog<VToolFlippingByLine>); &MainWindow::ClosedDrawDialogWithApply<VToolFlippingByLine>, &MainWindow::ApplyDrawDialog<VToolFlippingByLine>);
} }
@ -1407,7 +1404,7 @@ void MainWindow::ToolFlippingByAxis(bool checked)
"<b>%2</b> - confirm selection") "<b>%2</b> - confirm selection")
.arg(VModifierKey::Control(), VModifierKey::EnterKey()); .arg(VModifierKey::Control(), VModifierKey::EnterKey());
SetToolButtonWithApply<DialogFlippingByAxis>( SetToolButtonWithApply<DialogFlippingByAxis>(
checked, Tool::FlippingByAxis, QStringLiteral(":/cursor/flipping_axis_cursor.png"), tooltip, checked, Tool::FlippingByAxis, QStringLiteral("flipping_axis_cursor.png"), tooltip,
&MainWindow::ClosedDrawDialogWithApply<VToolFlippingByAxis>, &MainWindow::ApplyDrawDialog<VToolFlippingByAxis>); &MainWindow::ClosedDrawDialogWithApply<VToolFlippingByAxis>, &MainWindow::ApplyDrawDialog<VToolFlippingByAxis>);
} }
@ -1418,7 +1415,7 @@ void MainWindow::ToolMove(bool checked)
const QString tooltip = tr("Select one or more objects, hold <b>%1</b> - for multiple selection, " const QString tooltip = tr("Select one or more objects, hold <b>%1</b> - for multiple selection, "
"<b>%2</b> - confirm selection") "<b>%2</b> - confirm selection")
.arg(VModifierKey::Control(), VModifierKey::EnterKey()); .arg(VModifierKey::Control(), VModifierKey::EnterKey());
SetToolButtonWithApply<DialogMove>(checked, Tool::Move, QStringLiteral(":/cursor/move_cursor.png"), tooltip, SetToolButtonWithApply<DialogMove>(checked, Tool::Move, QStringLiteral("move_cursor.png"), tooltip,
&MainWindow::ClosedDrawDialogWithApply<VToolMove>, &MainWindow::ClosedDrawDialogWithApply<VToolMove>,
&MainWindow::ApplyDrawDialog<VToolMove>); &MainWindow::ApplyDrawDialog<VToolMove>);
} }
@ -1572,8 +1569,8 @@ void MainWindow::RemoveBackgroundImage(const QUuid &id)
void MainWindow::ToolCutArc(bool checked) void MainWindow::ToolCutArc(bool checked)
{ {
ToolSelectArc(); ToolSelectArc();
SetToolButtonWithApply<DialogCutArc>(checked, Tool::CutArc, QStringLiteral(":/cursor/arc_cut_cursor.png"), SetToolButtonWithApply<DialogCutArc>(checked, Tool::CutArc, QStringLiteral("arc_cut_cursor.png"), tr("Select arc"),
tr("Select arc"), &MainWindow::ClosedDrawDialogWithApply<VToolCutArc>, &MainWindow::ClosedDrawDialogWithApply<VToolCutArc>,
&MainWindow::ApplyDrawDialog<VToolCutArc>); &MainWindow::ApplyDrawDialog<VToolCutArc>);
} }
@ -1582,7 +1579,7 @@ void MainWindow::ToolLineIntersectAxis(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogLineIntersectAxis>( SetToolButtonWithApply<DialogLineIntersectAxis>(
checked, Tool::LineIntersectAxis, QStringLiteral(":/cursor/line_intersect_axis_cursor.png"), checked, Tool::LineIntersectAxis, QStringLiteral("line_intersect_axis_cursor.png"),
tr("Select first point of line"), &MainWindow::ClosedDrawDialogWithApply<VToolLineIntersectAxis>, tr("Select first point of line"), &MainWindow::ClosedDrawDialogWithApply<VToolLineIntersectAxis>,
&MainWindow::ApplyDrawDialog<VToolLineIntersectAxis>); &MainWindow::ApplyDrawDialog<VToolLineIntersectAxis>);
} }
@ -1592,8 +1589,8 @@ void MainWindow::ToolCurveIntersectAxis(bool checked)
{ {
ToolSelectAllDrawObjects(); ToolSelectAllDrawObjects();
SetToolButtonWithApply<DialogCurveIntersectAxis>( SetToolButtonWithApply<DialogCurveIntersectAxis>(
checked, Tool::CurveIntersectAxis, QStringLiteral(":/cursor/curve_intersect_axis_cursor.png"), checked, Tool::CurveIntersectAxis, QStringLiteral("curve_intersect_axis_cursor.png"), tr("Select curve"),
tr("Select curve"), &MainWindow::ClosedDrawDialogWithApply<VToolCurveIntersectAxis>, &MainWindow::ClosedDrawDialogWithApply<VToolCurveIntersectAxis>,
&MainWindow::ApplyDrawDialog<VToolCurveIntersectAxis>); &MainWindow::ApplyDrawDialog<VToolCurveIntersectAxis>);
} }
@ -1602,8 +1599,8 @@ void MainWindow::ToolArcIntersectAxis(bool checked)
{ {
ToolSelectAllDrawObjects(); ToolSelectAllDrawObjects();
// Reuse ToolCurveIntersectAxis but with different cursor and tool tip // Reuse ToolCurveIntersectAxis but with different cursor and tool tip
SetToolButtonWithApply<DialogCurveIntersectAxis>( SetToolButtonWithApply<DialogCurveIntersectAxis>(checked, Tool::ArcIntersectAxis,
checked, Tool::ArcIntersectAxis, QStringLiteral(":/cursor/arc_intersect_axis_cursor.png"), tr("Select arc"), QStringLiteral("arc_intersect_axis_cursor.png"), tr("Select arc"),
&MainWindow::ClosedDrawDialogWithApply<VToolCurveIntersectAxis>, &MainWindow::ClosedDrawDialogWithApply<VToolCurveIntersectAxis>,
&MainWindow::ApplyDrawDialog<VToolCurveIntersectAxis>); &MainWindow::ApplyDrawDialog<VToolCurveIntersectAxis>);
} }
@ -1613,7 +1610,7 @@ void MainWindow::ToolPointOfIntersectionArcs(bool checked)
{ {
ToolSelectArc(); ToolSelectArc();
SetToolButtonWithApply<DialogPointOfIntersectionArcs>( SetToolButtonWithApply<DialogPointOfIntersectionArcs>(
checked, Tool::PointOfIntersectionArcs, QStringLiteral("://cursor/point_of_intersection_arcs.png"), checked, Tool::PointOfIntersectionArcs, QStringLiteral("point_of_intersection_arcs.png"),
tr("Select first an arc"), &MainWindow::ClosedDrawDialogWithApply<VToolPointOfIntersectionArcs>, tr("Select first an arc"), &MainWindow::ClosedDrawDialogWithApply<VToolPointOfIntersectionArcs>,
&MainWindow::ApplyDrawDialog<VToolPointOfIntersectionArcs>); &MainWindow::ApplyDrawDialog<VToolPointOfIntersectionArcs>);
} }
@ -1623,7 +1620,7 @@ void MainWindow::ToolPointOfIntersectionCircles(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogPointOfIntersectionCircles>( SetToolButtonWithApply<DialogPointOfIntersectionCircles>(
checked, Tool::PointOfIntersectionCircles, QStringLiteral("://cursor/point_of_intersection_circles.png"), checked, Tool::PointOfIntersectionCircles, QStringLiteral("point_of_intersection_circles.png"),
tr("Select first circle center"), &MainWindow::ClosedDrawDialogWithApply<VToolPointOfIntersectionCircles>, tr("Select first circle center"), &MainWindow::ClosedDrawDialogWithApply<VToolPointOfIntersectionCircles>,
&MainWindow::ApplyDrawDialog<VToolPointOfIntersectionCircles>); &MainWindow::ApplyDrawDialog<VToolPointOfIntersectionCircles>);
} }
@ -1633,7 +1630,7 @@ void MainWindow::ToolPointOfIntersectionCurves(bool checked)
{ {
ToolSelectCurve(); ToolSelectCurve();
SetToolButtonWithApply<DialogPointOfIntersectionCurves>( SetToolButtonWithApply<DialogPointOfIntersectionCurves>(
checked, Tool::PointOfIntersectionCurves, QStringLiteral("://cursor/intersection_curves_cursor.png"), checked, Tool::PointOfIntersectionCurves, QStringLiteral("intersection_curves_cursor.png"),
tr("Select first curve"), &MainWindow::ClosedDrawDialogWithApply<VToolPointOfIntersectionCurves>, tr("Select first curve"), &MainWindow::ClosedDrawDialogWithApply<VToolPointOfIntersectionCurves>,
&MainWindow::ApplyDrawDialog<VToolPointOfIntersectionCurves>); &MainWindow::ApplyDrawDialog<VToolPointOfIntersectionCurves>);
} }
@ -1643,7 +1640,7 @@ void MainWindow::ToolPointFromCircleAndTangent(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogPointFromCircleAndTangent>( SetToolButtonWithApply<DialogPointFromCircleAndTangent>(
checked, Tool::PointFromCircleAndTangent, QStringLiteral("://cursor/point_from_circle_and_tangent_cursor.png"), checked, Tool::PointFromCircleAndTangent, QStringLiteral("point_from_circle_and_tangent_cursor.png"),
tr("Select point on tangent"), &MainWindow::ClosedDrawDialogWithApply<VToolPointFromCircleAndTangent>, tr("Select point on tangent"), &MainWindow::ClosedDrawDialogWithApply<VToolPointFromCircleAndTangent>,
&MainWindow::ApplyDrawDialog<VToolPointFromCircleAndTangent>); &MainWindow::ApplyDrawDialog<VToolPointFromCircleAndTangent>);
} }
@ -1653,7 +1650,7 @@ void MainWindow::ToolPointFromArcAndTangent(bool checked)
{ {
ToolSelectPointArc(); ToolSelectPointArc();
SetToolButtonWithApply<DialogPointFromArcAndTangent>( SetToolButtonWithApply<DialogPointFromArcAndTangent>(
checked, Tool::PointFromArcAndTangent, QStringLiteral("://cursor/point_from_arc_and_tangent_cursor.png"), checked, Tool::PointFromArcAndTangent, QStringLiteral("point_from_arc_and_tangent_cursor.png"),
tr("Select point on tangent"), &MainWindow::ClosedDrawDialogWithApply<VToolPointFromArcAndTangent>, tr("Select point on tangent"), &MainWindow::ClosedDrawDialogWithApply<VToolPointFromArcAndTangent>,
&MainWindow::ApplyDrawDialog<VToolPointFromArcAndTangent>); &MainWindow::ApplyDrawDialog<VToolPointFromArcAndTangent>);
} }
@ -1663,7 +1660,7 @@ void MainWindow::ToolArcWithLength(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogArcWithLength>( SetToolButtonWithApply<DialogArcWithLength>(
checked, Tool::ArcWithLength, QStringLiteral("://cursor/arc_with_length_cursor.png"), checked, Tool::ArcWithLength, QStringLiteral("arc_with_length_cursor.png"),
tr("Select point of the center of the arc"), &MainWindow::ClosedDrawDialogWithApply<VToolArcWithLength>, tr("Select point of the center of the arc"), &MainWindow::ClosedDrawDialogWithApply<VToolArcWithLength>,
&MainWindow::ApplyDrawDialog<VToolArcWithLength>); &MainWindow::ApplyDrawDialog<VToolArcWithLength>);
} }
@ -1672,10 +1669,9 @@ void MainWindow::ToolArcWithLength(bool checked)
void MainWindow::ToolTrueDarts(bool checked) void MainWindow::ToolTrueDarts(bool checked)
{ {
ToolSelectPointByRelease(); ToolSelectPointByRelease();
SetToolButtonWithApply<DialogTrueDarts>(checked, Tool::TrueDarts, QStringLiteral("://cursor/true_darts_cursor.png"), SetToolButtonWithApply<DialogTrueDarts>(
tr("Select the first base line point"), checked, Tool::TrueDarts, QStringLiteral("true_darts_cursor.png"), tr("Select the first base line point"),
&MainWindow::ClosedDrawDialogWithApply<VToolTrueDarts>, &MainWindow::ClosedDrawDialogWithApply<VToolTrueDarts>, &MainWindow::ApplyDrawDialog<VToolTrueDarts>);
&MainWindow::ApplyDrawDialog<VToolTrueDarts>);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -1685,8 +1681,8 @@ void MainWindow::ToolInsertNode(bool checked)
const QString tooltip = tr("Select one or more objects, hold <b>%1</b> - for multiple selection, " const QString tooltip = tr("Select one or more objects, hold <b>%1</b> - for multiple selection, "
"<b>%2</b> - finish creation") "<b>%2</b> - finish creation")
.arg(VModifierKey::Control(), VModifierKey::EnterKey()); .arg(VModifierKey::Control(), VModifierKey::EnterKey());
SetToolButton<DialogInsertNode>(checked, Tool::InsertNode, QStringLiteral("://cursor/insert_node_cursor.png"), SetToolButton<DialogInsertNode>(checked, Tool::InsertNode, QStringLiteral("insert_node_cursor.png"), tooltip,
tooltip, &MainWindow::ClosedDialogInsertNode); &MainWindow::ClosedDialogInsertNode);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -1773,6 +1769,12 @@ void MainWindow::changeEvent(QEvent *event)
UpdateWindowTitle(); UpdateWindowTitle();
emit m_sceneDetails->LanguageChanged(); emit m_sceneDetails->LanguageChanged();
} }
if (event->type() == QEvent::PaletteChange)
{
SetupDrawToolsIcons();
}
// remember to call base class implementation // remember to call base class implementation
QMainWindow::changeEvent(event); QMainWindow::changeEvent(event);
} }
@ -3040,6 +3042,8 @@ void MainWindow::ToolBarTools()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void MainWindow::ToolBarDrawTools() void MainWindow::ToolBarDrawTools()
{ {
SetupDrawToolsIcons();
// Point tools // Point tools
{ {
auto *linePointToolMenu = new QMenu(this); auto *linePointToolMenu = new QMenu(this);
@ -3491,6 +3495,66 @@ void MainWindow::CancelTool()
redoAction->setEnabled(VAbstractApplication::VApp()->getUndoStack()->canRedo()); redoAction->setEnabled(VAbstractApplication::VApp()->getUndoStack()->canRedo());
} }
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::SetupDrawToolsIcons()
{
const QString resource = QStringLiteral("toolicon");
ui->actionLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("line.png")));
ui->actionEndLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("segment.png")));
ui->actionAlongLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("along_line.png")));
ui->actionMidpointTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("midpoint.png")));
ui->actionNormalTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("normal.png")));
ui->actionBisectorTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("bisector.png")));
ui->actionHeightTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("height.png")));
ui->actionPointOfIntersectionTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("point_of_intersection.png")));
ui->actionLineIntersectTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("intersect.png")));
ui->actionShoulderPointTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("shoulder.png")));
ui->actionTriangleTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("triangle.png")));
ui->actionLineIntersectAxisTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("line_intersect_axis.png")));
ui->actionCurveIntersectAxisTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("curve_intersect_axis.png")));
ui->actionArcIntersectAxisTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("arc_intersect_axis.png")));
ui->actionSplineCutPointTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("spline_cut_point.png")));
ui->actionSplinePathCutPointTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("splinePath_cut_point.png")));
ui->actionArcCutPointTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("arc_cut.png")));
ui->actionIntersectionCurvesTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("intersection_curves.png")));
ui->actionPointOfIntersectionArcsTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("point_of_intersection_arcs.png")));
ui->actionPointOfIntersectionCirclesTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("point_of_intersection_circles.png")));
ui->actionPointFromArcAndTangentTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("point_from_arc_and_tangent.png")));
ui->actionPointFromCircleAndTangentTool->setIcon(
VTheme::GetIconResource(resource, QStringLiteral("point_from_circle_and_tangent.png")));
ui->actionPointOfContactTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("point_of_contact.png")));
ui->actionSplineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("spline.png")));
ui->actionCubicBezierTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("cubic_bezier.png")));
ui->actionSplinePathTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("splinePath.png")));
ui->actionCubicBezierPathTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("cubic_bezier_path.png")));
ui->actionArcTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("arc.png")));
ui->actionArcWithLengthTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("arc_with_length.png")));
ui->actionEllipticalArcTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("el_arc.png")));
ui->actionGroupTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("group_plus.png")));
ui->actionFlippingByAxisTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("flipping_axis.png")));
ui->actionFlippingByLineTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("flipping_line.png")));
ui->actionRotationTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("rotation.png")));
ui->actionMoveTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("move.png")));
ui->actionTrueDartsTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("true_darts.png")));
ui->actionNewDetailTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("new_detail.png")));
ui->actionUnionDetailsTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("union.png")));
ui->actionDuplicateDetailTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("duplicate_detail.png")));
ui->actionInternalPathTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("path.png")));
ui->actionPinTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("pin.png")));
ui->actionInsertNodeTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("insert_node.png")));
ui->actionPlaceLabelTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("place_label.png")));
}
QT_WARNING_POP QT_WARNING_POP
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -352,6 +352,8 @@ private:
void InitToolButtons(); void InitToolButtons();
void CancelTool(); void CancelTool();
void SetupDrawToolsIcons();
void SetEnableWidgets(bool enable); void SetEnableWidgets(bool enable);
void SetEnableTool(bool enable); void SetEnableTool(bool enable);
void SetLayoutModeActions(); void SetLayoutModeActions();

View File

@ -418,7 +418,7 @@
<string>Clear all messages</string> <string>Clear all messages</string>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">...</string> <string notr="true"/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../libs/vmisc/share/resources/icon.qrc"> <iconset resource="../../libs/vmisc/share/resources/icon.qrc">
@ -432,7 +432,7 @@
<string>Auto refresh the list with each parse</string> <string>Auto refresh the list with each parse</string>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">...</string> <string notr="true"/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="view-refresh"> <iconset theme="view-refresh">
@ -474,7 +474,7 @@
<string>Zoom in</string> <string>Zoom in</string>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">...</string> <string notr="true"/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="zoom-in"> <iconset theme="zoom-in">
@ -488,12 +488,18 @@
<string>Zoom out</string> <string>Zoom out</string>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">...</string> <string notr="true"/>
</property> </property>
<property name="icon"> <property name="icon">
<iconset theme="zoom-out"> <iconset theme="zoom-out">
<normaloff>.</normaloff>.</iconset> <normaloff>.</normaloff>.</iconset>
</property> </property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -543,6 +549,12 @@
<property name="toolTip"> <property name="toolTip">
<string>Tools for creating points</string> <string>Tools for creating points</string>
</property> </property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<attribute name="toolBarArea"> <attribute name="toolBarArea">
<enum>LeftToolBarArea</enum> <enum>LeftToolBarArea</enum>
</attribute> </attribute>
@ -554,6 +566,12 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Selecting tools</string> <string>Selecting tools</string>
</property> </property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle"> <property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum> <enum>Qt::ToolButtonIconOnly</enum>
</property> </property>
@ -572,6 +590,12 @@
<property name="toolTip"> <property name="toolTip">
<string>Tools for creating segments</string> <string>Tools for creating segments</string>
</property> </property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<attribute name="toolBarArea"> <attribute name="toolBarArea">
<enum>LeftToolBarArea</enum> <enum>LeftToolBarArea</enum>
</attribute> </attribute>
@ -587,6 +611,12 @@
<property name="toolTip"> <property name="toolTip">
<string>Tools for creating curves</string> <string>Tools for creating curves</string>
</property> </property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<attribute name="toolBarArea"> <attribute name="toolBarArea">
<enum>LeftToolBarArea</enum> <enum>LeftToolBarArea</enum>
</attribute> </attribute>
@ -598,6 +628,12 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Operation tools</string> <string>Operation tools</string>
</property> </property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<attribute name="toolBarArea"> <attribute name="toolBarArea">
<enum>LeftToolBarArea</enum> <enum>LeftToolBarArea</enum>
</attribute> </attribute>
@ -612,6 +648,12 @@
<property name="toolTip"> <property name="toolTip">
<string>Tools for creating detail</string> <string>Tools for creating detail</string>
</property> </property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<attribute name="toolBarArea"> <attribute name="toolBarArea">
<enum>LeftToolBarArea</enum> <enum>LeftToolBarArea</enum>
</attribute> </attribute>
@ -626,6 +668,12 @@
<property name="toolTip"> <property name="toolTip">
<string/> <string/>
</property> </property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<attribute name="toolBarArea"> <attribute name="toolBarArea">
<enum>LeftToolBarArea</enum> <enum>LeftToolBarArea</enum>
</attribute> </attribute>
@ -1726,7 +1774,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/segment.png</normaloff>:/toolicon/32x32/segment.png</iconset> <normaloff>:/toolicon/light/segment.png</normaloff>:/toolicon/light/segment.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point at distance and angle</string> <string>Point at distance and angle</string>
@ -1744,7 +1792,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/point_of_intersection_arcs.png</normaloff>:/toolicon/32x32/point_of_intersection_arcs.png</iconset> <normaloff>:/toolicon/light/point_of_intersection_arcs.png</normaloff>:/toolicon/light/point_of_intersection_arcs.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point of intersection arcs</string> <string>Point of intersection arcs</string>
@ -1762,7 +1810,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/arc_intersect_axis.png</normaloff>:/toolicon/32x32/arc_intersect_axis.png</iconset> <normaloff>:/toolicon/light/arc_intersect_axis.png</normaloff>:/toolicon/light/arc_intersect_axis.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point of intersection arc and axis</string> <string>Point of intersection arc and axis</string>
@ -1780,7 +1828,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/arc_cut.png</normaloff>:/toolicon/32x32/arc_cut.png</iconset> <normaloff>:/toolicon/light/arc_cut.png</normaloff>:/toolicon/light/arc_cut.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Segment an arc</string> <string>Segment an arc</string>
@ -1798,7 +1846,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/arc.png</normaloff>:/toolicon/32x32/arc.png</iconset> <normaloff>:/toolicon/light/arc.png</normaloff>:/toolicon/light/arc.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Arc</string> <string>Arc</string>
@ -1816,7 +1864,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/curve_intersect_axis.png</normaloff>:/toolicon/32x32/curve_intersect_axis.png</iconset> <normaloff>:/toolicon/light/curve_intersect_axis.png</normaloff>:/toolicon/light/curve_intersect_axis.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point intersect curve and axis</string> <string>Point intersect curve and axis</string>
@ -1834,7 +1882,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/intersection_curves.png</normaloff>:/toolicon/32x32/intersection_curves.png</iconset> <normaloff>:/toolicon/light/intersection_curves.png</normaloff>:/toolicon/light/intersection_curves.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point intersection curves</string> <string>Point intersection curves</string>
@ -1852,7 +1900,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/cubic_bezier_path.png</normaloff>:/toolicon/32x32/cubic_bezier_path.png</iconset> <normaloff>:/toolicon/light/cubic_bezier_path.png</normaloff>:/toolicon/light/cubic_bezier_path.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Curved path tool which uses point as control handle</string> <string>Curved path tool which uses point as control handle</string>
@ -1870,7 +1918,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/splinePath_cut_point.png</normaloff>:/toolicon/32x32/splinePath_cut_point.png</iconset> <normaloff>:/toolicon/light/splinePath_cut_point.png</normaloff>:/toolicon/light/splinePath_cut_point.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Segment a curved path</string> <string>Segment a curved path</string>
@ -1888,7 +1936,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/along_line.png</normaloff>:/toolicon/32x32/along_line.png</iconset> <normaloff>:/toolicon/light/along_line.png</normaloff>:/toolicon/light/along_line.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point at distance along line</string> <string>Point at distance along line</string>
@ -1906,7 +1954,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/normal.png</normaloff>:/toolicon/32x32/normal.png</iconset> <normaloff>:/toolicon/light/normal.png</normaloff>:/toolicon/light/normal.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point along perpendicular</string> <string>Point along perpendicular</string>
@ -1924,7 +1972,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/bisector.png</normaloff>:/toolicon/32x32/bisector.png</iconset> <normaloff>:/toolicon/light/bisector.png</normaloff>:/toolicon/light/bisector.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point along bisector</string> <string>Point along bisector</string>
@ -1942,7 +1990,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/shoulder.png</normaloff>:/toolicon/32x32/shoulder.png</iconset> <normaloff>:/toolicon/light/shoulder.png</normaloff>:/toolicon/light/shoulder.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Special point on shoulder</string> <string>Special point on shoulder</string>
@ -1960,7 +2008,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/triangle.png</normaloff>:/toolicon/32x32/triangle.png</iconset> <normaloff>:/toolicon/light/triangle.png</normaloff>:/toolicon/light/triangle.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Triangle tool</string> <string>Triangle tool</string>
@ -1978,7 +2026,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/point_of_intersection.png</normaloff>:/toolicon/32x32/point_of_intersection.png</iconset> <normaloff>:/toolicon/light/point_of_intersection.png</normaloff>:/toolicon/light/point_of_intersection.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point from X and Y of two other points</string> <string>Point from X and Y of two other points</string>
@ -1996,7 +2044,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/height.png</normaloff>:/toolicon/32x32/height.png</iconset> <normaloff>:/toolicon/light/height.png</normaloff>:/toolicon/light/height.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Perpendicular point along line</string> <string>Perpendicular point along line</string>
@ -2014,7 +2062,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/line_intersect_axis.png</normaloff>:/toolicon/32x32/line_intersect_axis.png</iconset> <normaloff>:/toolicon/light/line_intersect_axis.png</normaloff>:/toolicon/light/line_intersect_axis.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point intersect line and axis</string> <string>Point intersect line and axis</string>
@ -2032,7 +2080,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/midpoint.png</normaloff>:/toolicon/32x32/midpoint.png</iconset> <normaloff>:/toolicon/light/midpoint.png</normaloff>:/toolicon/light/midpoint.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Midpoint between two points</string> <string>Midpoint between two points</string>
@ -2050,7 +2098,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/intersect.png</normaloff>:/toolicon/32x32/intersect.png</iconset> <normaloff>:/toolicon/light/intersect.png</normaloff>:/toolicon/light/intersect.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point at line intersection</string> <string>Point at line intersection</string>
@ -2068,7 +2116,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/line.png</normaloff>:/toolicon/32x32/line.png</iconset> <normaloff>:/toolicon/light/line.png</normaloff>:/toolicon/light/line.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Line between points</string> <string>Line between points</string>
@ -2086,7 +2134,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/spline.png</normaloff>:/toolicon/32x32/spline.png</iconset> <normaloff>:/toolicon/light/spline.png</normaloff>:/toolicon/light/spline.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Simple curve</string> <string>Simple curve</string>
@ -2104,7 +2152,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/spline_cut_point.png</normaloff>:/toolicon/32x32/spline_cut_point.png</iconset> <normaloff>:/toolicon/light/spline_cut_point.png</normaloff>:/toolicon/light/spline_cut_point.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Segmenting a simple curve</string> <string>Segmenting a simple curve</string>
@ -2122,7 +2170,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/cubic_bezier.png</normaloff>:/toolicon/32x32/cubic_bezier.png</iconset> <normaloff>:/toolicon/light/cubic_bezier.png</normaloff>:/toolicon/light/cubic_bezier.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Curve tool which uses point as control handle</string> <string>Curve tool which uses point as control handle</string>
@ -2140,7 +2188,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/splinePath.png</normaloff>:/toolicon/32x32/splinePath.png</iconset> <normaloff>:/toolicon/light/splinePath.png</normaloff>:/toolicon/light/splinePath.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Curved path</string> <string>Curved path</string>
@ -2158,7 +2206,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/el_arc.png</normaloff>:/toolicon/32x32/el_arc.png</iconset> <normaloff>:/toolicon/light/el_arc.png</normaloff>:/toolicon/light/el_arc.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Elliptical Arc</string> <string>Elliptical Arc</string>
@ -2176,7 +2224,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/arc_with_length.png</normaloff>:/toolicon/32x32/arc_with_length.png</iconset> <normaloff>:/toolicon/light/arc_with_length.png</normaloff>:/toolicon/light/arc_with_length.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Arc with given length</string> <string>Arc with given length</string>
@ -2194,7 +2242,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/point_of_intersection_circles.png</normaloff>:/toolicon/32x32/point_of_intersection_circles.png</iconset> <normaloff>:/toolicon/light/point_of_intersection_circles.png</normaloff>:/toolicon/light/point_of_intersection_circles.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point of intersection circles</string> <string>Point of intersection circles</string>
@ -2212,7 +2260,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/point_from_arc_and_tangent.png</normaloff>:/toolicon/32x32/point_from_arc_and_tangent.png</iconset> <normaloff>:/toolicon/light/point_from_arc_and_tangent.png</normaloff>:/toolicon/light/point_from_arc_and_tangent.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point from arc and tangent</string> <string>Point from arc and tangent</string>
@ -2230,7 +2278,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/point_from_circle_and_tangent.png</normaloff>:/toolicon/32x32/point_from_circle_and_tangent.png</iconset> <normaloff>:/toolicon/light/point_from_circle_and_tangent.png</normaloff>:/toolicon/light/point_from_circle_and_tangent.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point from circle and tangent</string> <string>Point from circle and tangent</string>
@ -2248,7 +2296,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/point_of_contact.png</normaloff>:/toolicon/32x32/point_of_contact.png</iconset> <normaloff>:/toolicon/light/point_of_contact.png</normaloff>:/toolicon/light/point_of_contact.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Point of intersection circle and segment</string> <string>Point of intersection circle and segment</string>
@ -2266,7 +2314,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/flipping_axis.png</normaloff>:/toolicon/32x32/flipping_axis.png</iconset> <normaloff>:/toolicon/light/flipping_axis.png</normaloff>:/toolicon/light/flipping_axis.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Flipping objects by axis</string> <string>Flipping objects by axis</string>
@ -2284,7 +2332,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/flipping_line.png</normaloff>:/toolicon/32x32/flipping_line.png</iconset> <normaloff>:/toolicon/light/flipping_line.png</normaloff>:/toolicon/light/flipping_line.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Flipping objects by line</string> <string>Flipping objects by line</string>
@ -2302,7 +2350,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/rotation.png</normaloff>:/toolicon/32x32/rotation.png</iconset> <normaloff>:/toolicon/light/rotation.png</normaloff>:/toolicon/light/rotation.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Rotate objects</string> <string>Rotate objects</string>
@ -2320,7 +2368,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/move.png</normaloff>:/toolicon/32x32/move.png</iconset> <normaloff>:/toolicon/light/move.png</normaloff>:/toolicon/light/move.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Move objects</string> <string>Move objects</string>
@ -2338,7 +2386,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/group_plus.png</normaloff>:/toolicon/32x32/group_plus.png</iconset> <normaloff>:/toolicon/light/group_plus.png</normaloff>:/toolicon/light/group_plus.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Visibility group</string> <string>Visibility group</string>
@ -2356,7 +2404,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/true_darts.png</normaloff>:/toolicon/32x32/true_darts.png</iconset> <normaloff>:/toolicon/light/true_darts.png</normaloff>:/toolicon/light/true_darts.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>True darts</string> <string>True darts</string>
@ -2392,7 +2440,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/new_detail.png</normaloff>:/toolicon/32x32/new_detail.png</iconset> <normaloff>:/toolicon/light/new_detail.png</normaloff>:/toolicon/light/new_detail.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Workpiece tool</string> <string>Workpiece tool</string>
@ -2410,7 +2458,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/union.png</normaloff>:/toolicon/32x32/union.png</iconset> <normaloff>:/toolicon/light/union.png</normaloff>:/toolicon/light/union.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Union tool</string> <string>Union tool</string>
@ -2428,7 +2476,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/duplicate_detail.png</normaloff>:/toolicon/32x32/duplicate_detail.png</iconset> <normaloff>:/toolicon/light/duplicate_detail.png</normaloff>:/toolicon/light/duplicate_detail.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Duplicate detail tool</string> <string>Duplicate detail tool</string>
@ -2446,7 +2494,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/path.png</normaloff>:/toolicon/32x32/path.png</iconset> <normaloff>:/toolicon/light/path.png</normaloff>:/toolicon/light/path.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Internal path tool</string> <string>Internal path tool</string>
@ -2464,7 +2512,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/pin.png</normaloff>:/toolicon/32x32/pin.png</iconset> <normaloff>:/toolicon/light/pin.png</normaloff>:/toolicon/light/pin.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Pin tool</string> <string>Pin tool</string>
@ -2482,7 +2530,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/insert_node.png</normaloff>:/toolicon/32x32/insert_node.png</iconset> <normaloff>:/toolicon/light/insert_node.png</normaloff>:/toolicon/light/insert_node.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Insert node tool</string> <string>Insert node tool</string>
@ -2500,7 +2548,7 @@
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="share/resources/toolicon.qrc"> <iconset resource="share/resources/toolicon.qrc">
<normaloff>:/toolicon/32x32/place_label.png</normaloff>:/toolicon/32x32/place_label.png</iconset> <normaloff>:/toolicon/light/place_label.png</normaloff>:/toolicon/light/place_label.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Place label tool</string> <string>Place label tool</string>
@ -2530,6 +2578,11 @@
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<customwidgets> <customwidgets>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header>../vwidgets/vplaintextedit.h</header>
</customwidget>
<customwidget> <customwidget>
<class>VMainGraphicsView</class> <class>VMainGraphicsView</class>
<extends>QGraphicsView</extends> <extends>QGraphicsView</extends>
@ -2540,11 +2593,6 @@
<extends>QLineEdit</extends> <extends>QLineEdit</extends>
<header>../vwidgets/vlineedit.h</header> <header>../vwidgets/vlineedit.h</header>
</customwidget> </customwidget>
<customwidget>
<class>VPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header>../vwidgets/vplaintextedit.h</header>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="share/resources/toolicon.qrc"/> <include location="share/resources/toolicon.qrc"/>

View File

@ -1,92 +1,178 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>cursor/endline_cursor.png</file>
<file>cursor/endline_cursor@2x.png</file>
<file>cursor/line_cursor.png</file>
<file>cursor/line_cursor@2x.png</file>
<file>cursor/alongline_cursor.png</file>
<file>cursor/alongline_cursor@2x.png</file>
<file>cursor/shoulder_cursor.png</file>
<file>cursor/shoulder_cursor@2x.png</file>
<file>cursor/normal_cursor.png</file>
<file>cursor/normal_cursor@2x.png</file>
<file>cursor/bisector_cursor.png</file>
<file>cursor/bisector_cursor@2x.png</file>
<file>cursor/intersect_cursor.png</file>
<file>cursor/intersect_cursor@2x.png</file>
<file>cursor/spline_cursor.png</file>
<file>cursor/spline_cursor@2x.png</file>
<file>cursor/arc_cursor.png</file>
<file>cursor/arc_cursor@2x.png</file>
<file>cursor/splinepath_cursor.png</file>
<file>cursor/splinepath_cursor@2x.png</file>
<file>cursor/pointcontact_cursor.png</file>
<file>cursor/pointcontact_cursor@2x.png</file>
<file>cursor/new_detail_cursor.png</file>
<file>cursor/new_detail_cursor@2x.png</file>
<file>cursor/height_cursor.png</file>
<file>cursor/height_cursor@2x.png</file>
<file>cursor/triangle_cursor.png</file>
<file>cursor/triangle_cursor@2x.png</file>
<file>cursor/pointofintersect_cursor.png</file>
<file>cursor/pointofintersect_cursor@2x.png</file>
<file>cursor/spline_cut_point_cursor.png</file>
<file>cursor/spline_cut_point_cursor@2x.png</file>
<file>cursor/splinepath_cut_point_cursor.png</file>
<file>cursor/splinepath_cut_point_cursor@2x.png</file>
<file>cursor/union_cursor.png</file>
<file>cursor/union_cursor@2x.png</file>
<file>cursor/arc_cut_cursor.png</file>
<file>cursor/arc_cut_cursor@2x.png</file>
<file>cursor/cursor-arrow-closehand.png</file> <file>cursor/cursor-arrow-closehand.png</file>
<file>cursor/cursor-arrow-openhand.png</file> <file>cursor/cursor-arrow-openhand.png</file>
<file>cursor/line_intersect_axis_cursor.png</file> <file>cursor/light/segment_cursor.png</file>
<file>cursor/line_intersect_axis_cursor@2x.png</file> <file>cursor/light/segment_cursor@2x.png</file>
<file>cursor/arc_intersect_axis_cursor.png</file> <file>cursor/light/line_cursor.png</file>
<file>cursor/arc_intersect_axis_cursor@2x.png</file> <file>cursor/light/line_cursor@2x.png</file>
<file>cursor/curve_intersect_axis_cursor.png</file> <file>cursor/light/along_line_cursor.png</file>
<file>cursor/curve_intersect_axis_cursor@2x.png</file> <file>cursor/light/along_line_cursor@2x.png</file>
<file>cursor/point_of_intersection_arcs.png</file> <file>cursor/light/shoulder_cursor.png</file>
<file>cursor/point_of_intersection_arcs@2x.png</file> <file>cursor/light/shoulder_cursor@2x.png</file>
<file>cursor/point_of_intersection_circles.png</file> <file>cursor/light/normal_cursor.png</file>
<file>cursor/point_of_intersection_circles@2x.png</file> <file>cursor/light/normal_cursor@2x.png</file>
<file>cursor/point_from_circle_and_tangent_cursor.png</file> <file>cursor/light/bisector_cursor.png</file>
<file>cursor/point_from_circle_and_tangent_cursor@2x.png</file> <file>cursor/light/bisector_cursor@2x.png</file>
<file>cursor/point_from_arc_and_tangent_cursor.png</file> <file>cursor/light/intersect_cursor.png</file>
<file>cursor/point_from_arc_and_tangent_cursor@2x.png</file> <file>cursor/light/intersect_cursor@2x.png</file>
<file>cursor/arc_with_length_cursor.png</file> <file>cursor/light/spline_cursor.png</file>
<file>cursor/arc_with_length_cursor@2x.png</file> <file>cursor/light/spline_cursor@2x.png</file>
<file>cursor/true_darts_cursor.png</file> <file>cursor/light/arc_cursor.png</file>
<file>cursor/true_darts_cursor@2x.png</file> <file>cursor/light/arc_cursor@2x.png</file>
<file>cursor/intersection_curves_cursor.png</file> <file>cursor/light/splinePath_cursor.png</file>
<file>cursor/intersection_curves_cursor@2x.png</file> <file>cursor/light/splinePath_cursor@2x.png</file>
<file>cursor/cubic_bezier_cursor.png</file> <file>cursor/light/point_of_contact_cursor.png</file>
<file>cursor/cubic_bezier_cursor@2x.png</file> <file>cursor/light/point_of_contact_cursor@2x.png</file>
<file>cursor/cubic_bezier_path_cursor.png</file> <file>cursor/light/new_detail_cursor.png</file>
<file>cursor/cubic_bezier_path_cursor@2x.png</file> <file>cursor/light/new_detail_cursor@2x.png</file>
<file>cursor/group_plus_cursor.png</file> <file>cursor/light/height_cursor.png</file>
<file>cursor/group_plus_cursor@2x.png</file> <file>cursor/light/height_cursor@2x.png</file>
<file>cursor/rotation_cursor.png</file> <file>cursor/light/triangle_cursor.png</file>
<file>cursor/rotation_cursor@2x.png</file> <file>cursor/light/triangle_cursor@2x.png</file>
<file>cursor/midpoint_cursor.png</file> <file>cursor/light/point_of_intersection_cursor.png</file>
<file>cursor/midpoint_cursor@2x.png</file> <file>cursor/light/point_of_intersection_cursor@2x.png</file>
<file>cursor/flipping_line_cursor@2x.png</file> <file>cursor/light/spline_cut_point_cursor.png</file>
<file>cursor/flipping_line_cursor.png</file> <file>cursor/light/spline_cut_point_cursor@2x.png</file>
<file>cursor/flipping_axis_cursor.png</file> <file>cursor/light/splinePath_cut_point_cursor.png</file>
<file>cursor/flipping_axis_cursor@2x.png</file> <file>cursor/light/splinePath_cut_point_cursor@2x.png</file>
<file>cursor/move_cursor.png</file> <file>cursor/light/union_cursor.png</file>
<file>cursor/move_cursor@2x.png</file> <file>cursor/light/union_cursor@2x.png</file>
<file>cursor/el_arc_cursor.png</file> <file>cursor/light/arc_cut_cursor.png</file>
<file>cursor/el_arc_cursor@2x.png</file> <file>cursor/light/arc_cut_cursor@2x.png</file>
<file>cursor/path_cursor.png</file> <file>cursor/light/line_intersect_axis_cursor.png</file>
<file>cursor/path_cursor@2x.png</file> <file>cursor/light/line_intersect_axis_cursor@2x.png</file>
<file>cursor/pin_cursor.png</file> <file>cursor/light/arc_intersect_axis_cursor.png</file>
<file>cursor/pin_cursor@2x.png</file> <file>cursor/light/arc_intersect_axis_cursor@2x.png</file>
<file>cursor/insert_node_cursor.png</file> <file>cursor/light/curve_intersect_axis_cursor.png</file>
<file>cursor/insert_node_cursor@2x.png</file> <file>cursor/light/curve_intersect_axis_cursor@2x.png</file>
<file>cursor/place_label_cursor@2x.png</file> <file>cursor/light/point_of_intersection_arcs_cursor.png</file>
<file>cursor/place_label_cursor.png</file> <file>cursor/light/point_of_intersection_arcs_cursor@2x.png</file>
<file>cursor/duplicate_detail_cursor.png</file> <file>cursor/light/point_of_intersection_circles_cursor.png</file>
<file>cursor/duplicate_detail_cursor@2x.png</file> <file>cursor/light/point_of_intersection_circles_cursor@2x.png</file>
<file>cursor/light/point_from_circle_and_tangent_cursor.png</file>
<file>cursor/light/point_from_circle_and_tangent_cursor@2x.png</file>
<file>cursor/light/point_from_arc_and_tangent_cursor.png</file>
<file>cursor/light/point_from_arc_and_tangent_cursor@2x.png</file>
<file>cursor/light/arc_with_length_cursor.png</file>
<file>cursor/light/arc_with_length_cursor@2x.png</file>
<file>cursor/light/true_darts_cursor.png</file>
<file>cursor/light/true_darts_cursor@2x.png</file>
<file>cursor/light/intersection_curves_cursor.png</file>
<file>cursor/light/intersection_curves_cursor@2x.png</file>
<file>cursor/light/cubic_bezier_cursor.png</file>
<file>cursor/light/cubic_bezier_cursor@2x.png</file>
<file>cursor/light/cubic_bezier_path_cursor.png</file>
<file>cursor/light/cubic_bezier_path_cursor@2x.png</file>
<file>cursor/light/group_plus_cursor.png</file>
<file>cursor/light/group_plus_cursor@2x.png</file>
<file>cursor/light/rotation_cursor.png</file>
<file>cursor/light/rotation_cursor@2x.png</file>
<file>cursor/light/midpoint_cursor.png</file>
<file>cursor/light/midpoint_cursor@2x.png</file>
<file>cursor/light/flipping_line_cursor@2x.png</file>
<file>cursor/light/flipping_line_cursor.png</file>
<file>cursor/light/flipping_axis_cursor.png</file>
<file>cursor/light/flipping_axis_cursor@2x.png</file>
<file>cursor/light/move_cursor.png</file>
<file>cursor/light/move_cursor@2x.png</file>
<file>cursor/light/el_arc_cursor.png</file>
<file>cursor/light/el_arc_cursor@2x.png</file>
<file>cursor/light/path_cursor.png</file>
<file>cursor/light/path_cursor@2x.png</file>
<file>cursor/light/pin_cursor.png</file>
<file>cursor/light/pin_cursor@2x.png</file>
<file>cursor/light/insert_node_cursor.png</file>
<file>cursor/light/insert_node_cursor@2x.png</file>
<file>cursor/light/place_label_cursor@2x.png</file>
<file>cursor/light/place_label_cursor.png</file>
<file>cursor/light/duplicate_detail_cursor.png</file>
<file>cursor/light/duplicate_detail_cursor@2x.png</file>
<file>cursor/dark/union_cursor.png</file>
<file>cursor/dark/union_cursor@2x.png</file>
<file>cursor/dark/true_darts_cursor.png</file>
<file>cursor/dark/true_darts_cursor@2x.png</file>
<file>cursor/dark/triangle_cursor.png</file>
<file>cursor/dark/triangle_cursor@2x.png</file>
<file>cursor/dark/splinePath_cut_point_cursor.png</file>
<file>cursor/dark/splinePath_cut_point_cursor@2x.png</file>
<file>cursor/dark/splinePath_cursor.png</file>
<file>cursor/dark/splinePath_cursor@2x.png</file>
<file>cursor/dark/spline_cut_point_cursor.png</file>
<file>cursor/dark/spline_cut_point_cursor@2x.png</file>
<file>cursor/dark/spline_cursor.png</file>
<file>cursor/dark/spline_cursor@2x.png</file>
<file>cursor/dark/shoulder_cursor.png</file>
<file>cursor/dark/shoulder_cursor@2x.png</file>
<file>cursor/dark/segment_cursor.png</file>
<file>cursor/dark/segment_cursor@2x.png</file>
<file>cursor/dark/rotation_cursor.png</file>
<file>cursor/dark/rotation_cursor@2x.png</file>
<file>cursor/dark/point_of_intersection_circles_cursor.png</file>
<file>cursor/dark/point_of_intersection_circles_cursor@2x.png</file>
<file>cursor/dark/point_of_intersection_arcs_cursor.png</file>
<file>cursor/dark/point_of_intersection_arcs_cursor@2x.png</file>
<file>cursor/dark/point_of_intersection_cursor.png</file>
<file>cursor/dark/point_of_intersection_cursor@2x.png</file>
<file>cursor/dark/point_of_contact_cursor.png</file>
<file>cursor/dark/point_of_contact_cursor@2x.png</file>
<file>cursor/dark/point_from_circle_and_tangent_cursor.png</file>
<file>cursor/dark/point_from_circle_and_tangent_cursor@2x.png</file>
<file>cursor/dark/point_from_arc_and_tangent_cursor.png</file>
<file>cursor/dark/point_from_arc_and_tangent_cursor@2x.png</file>
<file>cursor/dark/place_label_cursor.png</file>
<file>cursor/dark/place_label_cursor@2x.png</file>
<file>cursor/dark/pin_cursor.png</file>
<file>cursor/dark/pin_cursor@2x.png</file>
<file>cursor/dark/path_cursor.png</file>
<file>cursor/dark/path_cursor@2x.png</file>
<file>cursor/dark/normal_cursor.png</file>
<file>cursor/dark/normal_cursor@2x.png</file>
<file>cursor/dark/new_detail_cursor.png</file>
<file>cursor/dark/new_detail_cursor@2x.png</file>
<file>cursor/dark/move_cursor.png</file>
<file>cursor/dark/move_cursor@2x.png</file>
<file>cursor/dark/midpoint_cursor.png</file>
<file>cursor/dark/midpoint_cursor@2x.png</file>
<file>cursor/dark/line_intersect_axis_cursor.png</file>
<file>cursor/dark/line_intersect_axis_cursor@2x.png</file>
<file>cursor/dark/line_cursor.png</file>
<file>cursor/dark/line_cursor@2x.png</file>
<file>cursor/dark/intersection_curves_cursor.png</file>
<file>cursor/dark/intersection_curves_cursor@2x.png</file>
<file>cursor/dark/intersect_cursor.png</file>
<file>cursor/dark/intersect_cursor@2x.png</file>
<file>cursor/dark/insert_node_cursor.png</file>
<file>cursor/dark/insert_node_cursor@2x.png</file>
<file>cursor/dark/height_cursor.png</file>
<file>cursor/dark/height_cursor@2x.png</file>
<file>cursor/dark/group_plus_cursor.png</file>
<file>cursor/dark/group_plus_cursor@2x.png</file>
<file>cursor/dark/flipping_line_cursor.png</file>
<file>cursor/dark/flipping_line_cursor@2x.png</file>
<file>cursor/dark/flipping_axis_cursor.png</file>
<file>cursor/dark/flipping_axis_cursor@2x.png</file>
<file>cursor/dark/el_arc_cursor.png</file>
<file>cursor/dark/el_arc_cursor@2x.png</file>
<file>cursor/dark/duplicate_detail_cursor.png</file>
<file>cursor/dark/duplicate_detail_cursor@2x.png</file>
<file>cursor/dark/curve_intersect_axis_cursor.png</file>
<file>cursor/dark/curve_intersect_axis_cursor@2x.png</file>
<file>cursor/dark/cubic_bezier_path_cursor.png</file>
<file>cursor/dark/cubic_bezier_path_cursor@2x.png</file>
<file>cursor/dark/cubic_bezier_cursor.png</file>
<file>cursor/dark/cubic_bezier_cursor@2x.png</file>
<file>cursor/dark/bisector_cursor.png</file>
<file>cursor/dark/bisector_cursor@2x.png</file>
<file>cursor/dark/arc_with_length_cursor.png</file>
<file>cursor/dark/arc_with_length_cursor@2x.png</file>
<file>cursor/dark/arc_intersect_axis_cursor.png</file>
<file>cursor/dark/arc_intersect_axis_cursor@2x.png</file>
<file>cursor/dark/arc_cut_cursor.png</file>
<file>cursor/dark/arc_cut_cursor@2x.png</file>
<file>cursor/dark/arc_cursor.png</file>
<file>cursor/dark/arc_cursor@2x.png</file>
<file>cursor/dark/along_line_cursor.png</file>
<file>cursor/dark/along_line_cursor@2x.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1011 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 929 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 729 B

Some files were not shown because too many files have changed in this diff Show More