Added initial dark mode theme using https://github.com/ColinDuquesnoy/

QDarkStyleSheet

--HG--
branch : develop
This commit is contained in:
Emmanuel Nyachoke 2018-10-29 15:05:49 +03:00
parent 0e9d789d90
commit 6d9105729f
54 changed files with 1668 additions and 252 deletions

View file

@ -53,6 +53,9 @@ TapePreferencesConfigurationPage::TapePreferencesConfigurationPage(QWidget *pare
//-------------------- Decimal separator setup
ui->osOptionCheck->setChecked(qApp->TapeSettings()->GetOsSeparator());
// Theme
ui->darkModeCheck->setChecked(qApp->TapeSettings()->GetDarkMode());
//---------------------- Pattern making system
ui->systemBookValueLabel->setFixedHeight(4 * QFontMetrics(ui->systemBookValueLabel->font()).lineSpacing());
connect(ui->systemCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]()
@ -122,6 +125,8 @@ void TapePreferencesConfigurationPage::Apply()
settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked());
settings->SetDarkMode(ui->darkModeCheck->isChecked());
if (m_langChanged || m_systemChanged)
{
const QString locale = qvariant_cast<QString>(ui->langCombo->currentData());

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>501</width>
<height>550</height>
<height>726</height>
</rect>
</property>
<property name="windowTitle">
@ -156,10 +156,10 @@
<string>Default height and size</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="2">
<widget class="QLabel" name="labelHeightUnit">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string notr="true">Height unit</string>
<string>Default height:</string>
</property>
</widget>
</item>
@ -173,10 +173,10 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="0" column="2">
<widget class="QLabel" name="labelHeightUnit">
<property name="text">
<string>Default height:</string>
<string notr="true">Height unit</string>
</property>
</widget>
</item>
@ -234,17 +234,24 @@
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>User Interface</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
<widget class="QCheckBox" name="darkModeCheck">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>351</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Activate dark mode(Restart required)</string>
</property>
</widget>
</widget>
</item>
</layout>
</widget>

View file

@ -40,6 +40,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(icon);
Q_INIT_RESOURCE(schema);
Q_INIT_RESOURCE(flags);
Q_INIT_RESOURCE(style);
QT_REQUIRE_VERSION(argc, argv, "5.2.0")// clazy:exclude=qstring-arg

View file

@ -409,9 +409,30 @@ void MApplication::InitOptions()
//This does not happen under GNOME or KDE
QIcon::setThemeName("win.icon.theme");
}
ActivateDarkMode();
QResource::registerResource(diagramsPath());
}
// Dark mode
void MApplication::ActivateDarkMode()
{
VTapeSettings *settings = qApp->TapeSettings();
if (settings->GetDarkMode())
{
QFile f(":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());
}
}
}
//---------------------------------------------------------------------------------------------------------------------
void MApplication::InitTrVars()

View file

@ -68,6 +68,7 @@ public:
virtual void OpenSettings() override;
VTapeSettings *TapeSettings();
void ActivateDarkMode();
QString diagramsPath() const;

View file

@ -276,7 +276,6 @@ VApplication::VApplication(int &argc, char **argv)
setOrganizationDomain(VER_COMPANYDOMAIN_STR);
// Setting the Application version
setApplicationVersion(APP_VERSION_STR);
// making sure will create new instance...just in case we will ever do 2 objects of VApplication
VCommandLine::Reset();
VCommandLine::Get(*this);
@ -407,6 +406,27 @@ bool VApplication::notify(QObject *receiver, QEvent *event)
return false;
}
void VApplication::ActivateDarkMode()
{
VSettings *settings = qApp->ValentinaSettings();
if (settings->GetDarkMode())
{
QFile f(":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());
}
}
}
//---------------------------------------------------------------------------------------------------------------------
QString VApplication::TapeFilePath() const
{
@ -596,6 +616,7 @@ void VApplication::InitOptions()
//This does not happen under GNOME or KDE
QIcon::setThemeName("win.icon.theme");
}
ActivateDarkMode();
}
//---------------------------------------------------------------------------------------------------------------------

View file

@ -66,6 +66,7 @@ public:
static QStringList LabelLanguages();
void StartLogging();
void ActivateDarkMode();
QTextStream *LogFile();
virtual const VTranslateVars *TrVars() override;

View file

@ -124,6 +124,9 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
//----------------------- Toolbar
ui->toolBarStyleCheck->setChecked(settings->GetToolBarStyle());
// Theme
ui->darkModeCheck->setChecked(settings->GetDarkMode());
// Tab Scrolling
ui->spinBoxDuration->setMinimum(VSettings::scrollingDurationMin);
ui->spinBoxDuration->setMaximum(VSettings::scrollingDurationMax);
@ -168,6 +171,7 @@ QStringList PreferencesConfigurationPage::Apply()
settings->SetOsSeparator(ui->osOptionCheck->isChecked());
settings->SetToolBarStyle(ui->toolBarStyleCheck->isChecked());
settings->SetDarkMode(ui->darkModeCheck->isChecked());
settings->SetFreeCurveMode(ui->checkBoxFreeCurve->isChecked());
settings->SetDoubleClickZoomFitBestCurrentPP(ui->checkBoxZoomFitBestCurrentPP->isChecked());

View file

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>516</width>
<height>691</height>
<height>751</height>
</rect>
</property>
<property name="windowTitle">
@ -23,239 +23,279 @@
<attribute name="title">
<string>General</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="saveGroup">
<property name="title">
<string>Save</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="autoSaveCheck">
<property name="text">
<string>Auto-save modified pattern</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Interval:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="autoTime">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="suffix">
<string>min</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>60</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Language</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
<widget class="QGroupBox" name="saveGroup">
<property name="geometry">
<rect>
<x>20</x>
<y>0</y>
<width>441</width>
<height>70</height>
</rect>
</property>
<property name="title">
<string>Save</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="autoSaveCheck">
<property name="text">
<string>Auto-save modified pattern</string>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>GUI language:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="langCombo"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Decimal separator parts:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="osOptionCheck">
<property name="text">
<string notr="true">&lt; With OS options &gt;</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Default unit:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Label language:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="unitCombo"/>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="labelCombo"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Pattern making system</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
<property name="checked">
<bool>true</bool>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Pattern making system:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="systemCombo"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Author:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="systemAuthorValueLabel">
<property name="text">
<string notr="true">author</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Book:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPlainTextEdit" name="systemBookValueLabel">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Pattern editing</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QPushButton" name="resetWarningsButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Reset warnings</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxFreeCurve">
<property name="toolTip">
<string>Update a pattern only after a curve release</string>
</property>
<property name="text">
<string>Free curve mode</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxZoomFitBestCurrentPP">
<property name="text">
<string>Double click calls Zoom fit best for current pattern piece</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_6">
<property name="title">
<string>Toolbar</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="toolBarStyleCheck">
<property name="text">
<string>The text appears under the icon (recommended for beginners).</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Interval:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="autoTime">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="suffix">
<string>min</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>60</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>441</width>
<height>173</height>
</rect>
</property>
<property name="title">
<string>Language</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>GUI language:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="langCombo"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Decimal separator parts:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="osOptionCheck">
<property name="text">
<string notr="true">&lt; With OS options &gt;</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Default unit:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Label language:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="unitCombo"/>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="labelCombo"/>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_3">
<property name="geometry">
<rect>
<x>20</x>
<y>243</y>
<width>446</width>
<height>185</height>
</rect>
</property>
<property name="title">
<string>Pattern making system</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Pattern making system:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="systemCombo"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Author:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="systemAuthorValueLabel">
<property name="text">
<string notr="true">author</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Book:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPlainTextEdit" name="systemBookValueLabel">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_5">
<property name="geometry">
<rect>
<x>20</x>
<y>428</y>
<width>451</width>
<height>131</height>
</rect>
</property>
<property name="title">
<string>Pattern editing</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QPushButton" name="resetWarningsButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Reset warnings</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxFreeCurve">
<property name="toolTip">
<string>Update a pattern only after a curve release</string>
</property>
<property name="text">
<string>Free curve mode</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxZoomFitBestCurrentPP">
<property name="text">
<string>Double click calls Zoom fit best for current pattern piece</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_6">
<property name="geometry">
<rect>
<x>20</x>
<y>560</y>
<width>451</width>
<height>71</height>
</rect>
</property>
<property name="title">
<string>Toolbar</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="toolBarStyleCheck">
<property name="text">
<string>The text appears under the icon (recommended for beginners).</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_8">
<property name="geometry">
<rect>
<x>20</x>
<y>630</y>
<width>446</width>
<height>71</height>
</rect>
</property>
<property name="title">
<string>User Interface</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QCheckBox" name="darkModeCheck">
<property name="text">
<string>Activate dark mode(Restart required)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="tabScrolling">
<attribute name="title">

View file

@ -45,6 +45,7 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(flags);
Q_INIT_RESOURCE(icons);
Q_INIT_RESOURCE(toolicon);
Q_INIT_RESOURCE(style);
QT_REQUIRE_VERSION(argc, argv, "5.2.0")// clazy:exclude=qstring-arg,qstring-allocations

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

View file

@ -0,0 +1,46 @@
<RCC>
<qresource prefix="qss_icons">
<file>rc/up_arrow_disabled.png</file>
<file>rc/Hmovetoolbar.png</file>
<file>rc/stylesheet-branch-end.png</file>
<file>rc/branch_closed-on.png</file>
<file>rc/stylesheet-vline.png</file>
<file>rc/branch_closed.png</file>
<file>rc/branch_open-on.png</file>
<file>rc/transparent.png</file>
<file>rc/right_arrow_disabled.png</file>
<file>rc/sizegrip.png</file>
<file>rc/close.png</file>
<file>rc/close-hover.png</file>
<file>rc/close-pressed.png</file>
<file>rc/down_arrow.png</file>
<file>rc/Vmovetoolbar.png</file>
<file>rc/left_arrow.png</file>
<file>rc/stylesheet-branch-more.png</file>
<file>rc/up_arrow.png</file>
<file>rc/right_arrow.png</file>
<file>rc/left_arrow_disabled.png</file>
<file>rc/Hsepartoolbar.png</file>
<file>rc/branch_open.png</file>
<file>rc/Vsepartoolbar.png</file>
<file>rc/down_arrow_disabled.png</file>
<file>rc/undock.png</file>
<file>rc/checkbox_checked_disabled.png</file>
<file>rc/checkbox_checked_focus.png</file>
<file>rc/checkbox_checked.png</file>
<file>rc/checkbox_indeterminate.png</file>
<file>rc/checkbox_indeterminate_focus.png</file>
<file>rc/checkbox_unchecked_disabled.png</file>
<file>rc/checkbox_unchecked_focus.png</file>
<file>rc/checkbox_unchecked.png</file>
<file>rc/radio_checked_disabled.png</file>
<file>rc/radio_checked_focus.png</file>
<file>rc/radio_checked.png</file>
<file>rc/radio_unchecked_disabled.png</file>
<file>rc/radio_unchecked_focus.png</file>
<file>rc/radio_unchecked.png</file>
</qresource>
<qresource prefix="qdarkstyle">
<file>style.qss</file>
</qresource>
</RCC>

File diff suppressed because it is too large Load diff

View file

@ -81,6 +81,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingGeneralRestoreFileList, (QLatin1
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingGeneralGeometry, (QLatin1String("geometry")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingGeneralWindowState, (QLatin1String("windowState")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingGeneralToolbarsState, (QLatin1String("toolbarsState")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingConfigurationDarkMode, (QLatin1String("configuration/dark_mode")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingPreferenceDialogSize, (QLatin1String("preferenceDialogSize")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingToolSeamAllowanceDialogSize, (QLatin1String("toolSeamAllowanceDialogSize")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingIncrementsDialogSize, (QLatin1String("toolIncrementsDialogSize")))
@ -513,6 +514,19 @@ void VCommonSettings::SetToolBarStyle(const bool &value)
setValue(*settingConfigurationToolBarStyle, value);
}
//---------------------------------------------------------------------------------------------------------------------
bool VCommonSettings::GetDarkMode() const
{
return value(*settingConfigurationDarkMode, 1).toBool();
}
//---------------------------------------------------------------------------------------------------------------------
void VCommonSettings::SetDarkMode(const bool &value)
{
setValue(*settingConfigurationDarkMode, value);
}
//---------------------------------------------------------------------------------------------------------------------
bool VCommonSettings::IsFreeCurveMode() const
{

View file

@ -99,6 +99,9 @@ public:
bool GetToolBarStyle() const;
void SetToolBarStyle(const bool &value);
bool GetDarkMode() const;
void SetDarkMode(const bool &value);
bool IsFreeCurveMode() const;
void SetFreeCurveMode(bool value);

View file

@ -49,7 +49,8 @@ include(vmisc.pri)
RESOURCES += \
share/resources/theme.qrc \ # Windows theme icons.
share/resources/icon.qrc \ # All other icons except cursors and Windows theme.
share/resources/flags.qrc
share/resources/flags.qrc \
share/resources/qdarkstyle/style.qrc
# This is static library so no need in "make install"