diff --git a/src/app/tape/tmainwindow.ui b/src/app/tape/tmainwindow.ui
index 34db69408..c1d8773b4 100644
--- a/src/app/tape/tmainwindow.ui
+++ b/src/app/tape/tmainwindow.ui
@@ -824,8 +824,8 @@
-
- :/tapeicon/16x16/info.png:/tapeicon/16x16/info.png
+
+ ..
Information
diff --git a/src/app/valentina/dialogs/vwidgetdetails.cpp b/src/app/valentina/dialogs/vwidgetdetails.cpp
index d3d54b0e0..57a165a8b 100644
--- a/src/app/valentina/dialogs/vwidgetdetails.cpp
+++ b/src/app/valentina/dialogs/vwidgetdetails.cpp
@@ -28,6 +28,7 @@
#include "vwidgetdetails.h"
#include "../ifc/xml/vabstractpattern.h"
+#include "../vmisc/theme/vtheme.h"
#include "../vmisc/vabstractapplication.h"
#include "../vpatterndb/vcontainer.h"
#include "../vtools/tools/vtoolseamallowance.h"
@@ -61,14 +62,6 @@ enum PieceColumn
InLayout = 0,
PieceName = 1
};
-
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_CLANG("-Wunused-member-function")
-
-Q_GLOBAL_STATIC_WITH_ARGS(const QString, allowDetailIcon, (QLatin1String("://icon/16x16/allow_detail.png"))) // NOLINT
-Q_GLOBAL_STATIC_WITH_ARGS(const QString, forbidDetailIcon, (QLatin1String("://icon/16x16/forbid_detail.png"))) // NOLINT
-
-QT_WARNING_POP
} // namespace
//---------------------------------------------------------------------------------------------------------------------
@@ -148,6 +141,7 @@ void VWidgetDetails::changeEvent(QEvent *event)
{
ui->retranslateUi(this);
}
+
// remember to call base class implementation
QWidget::changeEvent(event);
}
@@ -235,7 +229,18 @@ void VWidgetDetails::ToggledPieceItem(QTableWidgetItem *item)
if (details->contains(id))
{
const bool inLayout = details->value(id).IsInLayout();
- inLayout ? item->setIcon(QIcon(*allowDetailIcon)) : item->setIcon(QIcon(*forbidDetailIcon));
+ if (inLayout)
+ {
+ item->setIcon(
+ QIcon::fromTheme(QStringLiteral("gtk-ok"),
+ VTheme::GetFallbackThemeIcon(QStringLiteral("16/actions/gtk-ok"), QSize(16, 16))));
+ }
+ else
+ {
+ item->setIcon(
+ QIcon::fromTheme(QStringLiteral("gtk-no"),
+ VTheme::GetFallbackThemeIcon(QStringLiteral("16/actions/gtk-no"), QSize(16, 16))));
+ }
VToolSeamAllowance *tool = nullptr;
try
@@ -255,7 +260,20 @@ auto VWidgetDetails::PrepareInLayoutColumnCell(const VPiece &det, quint32 id) ->
{
auto *item = new QTableWidgetItem();
item->setTextAlignment(Qt::AlignHCenter);
- item->setIcon(det.IsInLayout() ? QIcon(*allowDetailIcon) : QIcon(*forbidDetailIcon));
+
+ if (det.IsInLayout())
+ {
+ item->setIcon(
+ QIcon::fromTheme(QStringLiteral("gtk-ok"),
+ VTheme::GetFallbackThemeIcon(QStringLiteral("16/actions/gtk-ok"), QSize(16, 16))));
+ }
+ else
+ {
+ item->setIcon(
+ QIcon::fromTheme(QStringLiteral("gtk-no"),
+ VTheme::GetFallbackThemeIcon(QStringLiteral("16/actions/gtk-no"), QSize(16, 16))));
+ }
+
item->setData(Qt::UserRole, id);
// set the item non-editable (view only), and non-selectable
diff --git a/src/app/valentina/dialogs/vwidgetdetails.ui b/src/app/valentina/dialogs/vwidgetdetails.ui
index dbee6c673..81cc807ef 100644
--- a/src/app/valentina/dialogs/vwidgetdetails.ui
+++ b/src/app/valentina/dialogs/vwidgetdetails.ui
@@ -56,12 +56,12 @@
false
-
- false
-
10
+
+ false
+
diff --git a/src/app/valentina/mainwindow.ui b/src/app/valentina/mainwindow.ui
index 581ebd7d3..8e8629423 100644
--- a/src/app/valentina/mainwindow.ui
+++ b/src/app/valentina/mainwindow.ui
@@ -421,8 +421,8 @@
-
- :/icon/16x16/broom@2x.png:/icon/16x16/broom@2x.png
+
+ ..
diff --git a/src/libs/vmisc/share/resources/icon.qrc b/src/libs/vmisc/share/resources/icon.qrc
index c7a6d3e20..f1a503361 100644
--- a/src/libs/vmisc/share/resources/icon.qrc
+++ b/src/libs/vmisc/share/resources/icon.qrc
@@ -24,7 +24,6 @@
icon/32x32/arrowLeftUp.png
icon/32x32/putHereLeft.png
icon/path_config.png
- icon/16x16/info.png
icon/16x16/measurement.png
icon/16x16/landscape.png
icon/16x16/portrait.png
@@ -36,10 +35,6 @@
icon/32x32/syncM.png
icon/16x16/operations.png
icon/16x16/operations@2x.png
- icon/16x16/allow_detail.png
- icon/16x16/allow_detail@2x.png
- icon/16x16/forbid_detail.png
- icon/16x16/forbid_detail@2x.png
icon/32x32/grainline.png
icon/32x32/grainline@2x.png
icon/32x32/labels.png
@@ -52,8 +47,6 @@
icon/32x32/passmark@2x.png
icon/32x32/button.png
icon/32x32/button@2x.png
- icon/16x16/broom.png
- icon/16x16/broom@2x.png
icon/16x16/font_preferences@2x.png
icon/16x16/font_preferences.png
icon/32x32/font_preferences@2x.png
diff --git a/src/libs/vmisc/share/resources/icon/16x16/allow_detail.png b/src/libs/vmisc/share/resources/icon/16x16/allow_detail.png
deleted file mode 100644
index a472d28c7..000000000
Binary files a/src/libs/vmisc/share/resources/icon/16x16/allow_detail.png and /dev/null differ
diff --git a/src/libs/vmisc/share/resources/icon/16x16/allow_detail@2x.png b/src/libs/vmisc/share/resources/icon/16x16/allow_detail@2x.png
deleted file mode 100644
index d4c3f64fb..000000000
Binary files a/src/libs/vmisc/share/resources/icon/16x16/allow_detail@2x.png and /dev/null differ
diff --git a/src/libs/vmisc/share/resources/icon/16x16/broom.png b/src/libs/vmisc/share/resources/icon/16x16/broom.png
deleted file mode 100644
index 02a4f3048..000000000
Binary files a/src/libs/vmisc/share/resources/icon/16x16/broom.png and /dev/null differ
diff --git a/src/libs/vmisc/share/resources/icon/16x16/broom@2x.png b/src/libs/vmisc/share/resources/icon/16x16/broom@2x.png
deleted file mode 100644
index b9fd1b499..000000000
Binary files a/src/libs/vmisc/share/resources/icon/16x16/broom@2x.png and /dev/null differ
diff --git a/src/libs/vmisc/share/resources/icon/16x16/forbid_detail.png b/src/libs/vmisc/share/resources/icon/16x16/forbid_detail.png
deleted file mode 100644
index 7f24813ad..000000000
Binary files a/src/libs/vmisc/share/resources/icon/16x16/forbid_detail.png and /dev/null differ
diff --git a/src/libs/vmisc/share/resources/icon/16x16/forbid_detail@2x.png b/src/libs/vmisc/share/resources/icon/16x16/forbid_detail@2x.png
deleted file mode 100644
index b9dfd3f0b..000000000
Binary files a/src/libs/vmisc/share/resources/icon/16x16/forbid_detail@2x.png and /dev/null differ
diff --git a/src/libs/vmisc/share/resources/icon/16x16/info.png b/src/libs/vmisc/share/resources/icon/16x16/info.png
deleted file mode 100644
index d8a62e7df..000000000
Binary files a/src/libs/vmisc/share/resources/icon/16x16/info.png and /dev/null differ
diff --git a/src/libs/vmisc/share/resources/icons/La-Sierra-Light/actions/22x22/edit-clear-all.svg b/src/libs/vmisc/share/resources/icons/La-Sierra-Light/actions/22x22/edit-clear-all.svg
index 9daad9868..24f6786d3 100644
--- a/src/libs/vmisc/share/resources/icons/La-Sierra-Light/actions/22x22/edit-clear-all.svg
+++ b/src/libs/vmisc/share/resources/icons/La-Sierra-Light/actions/22x22/edit-clear-all.svg
@@ -1 +1,13 @@
-
\ No newline at end of file
+
diff --git a/src/libs/vmisc/share/resources/icons/La-Sierra-Light/actions/22x22/edit-clear-history.svg b/src/libs/vmisc/share/resources/icons/La-Sierra-Light/actions/22x22/edit-clear-history.svg
index 9daad9868..24f6786d3 100644
--- a/src/libs/vmisc/share/resources/icons/La-Sierra-Light/actions/22x22/edit-clear-history.svg
+++ b/src/libs/vmisc/share/resources/icons/La-Sierra-Light/actions/22x22/edit-clear-history.svg
@@ -1 +1,13 @@
-
\ No newline at end of file
+
diff --git a/src/libs/vmisc/theme/vtheme.cpp b/src/libs/vmisc/theme/vtheme.cpp
index 07c2150fc..3e81b5944 100644
--- a/src/libs/vmisc/theme/vtheme.cpp
+++ b/src/libs/vmisc/theme/vtheme.cpp
@@ -68,6 +68,8 @@ using namespace bpstd::literals::chrono_literals;
#include "../vabstractapplication.h"
#include "vscenestylesheet.h"
+#include
+
namespace
{
#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0)
@@ -336,11 +338,21 @@ auto VTheme::ColorSheme() -> VColorSheme
}
//---------------------------------------------------------------------------------------------------------------------
-void VTheme::SetIconTheme()
+auto VTheme::DefaultThemeName() -> QString
{
VColorSheme colorScheme = ColorSheme();
QString themePrefix = (colorScheme == VColorSheme::Light ? QStringLiteral("Light") : QStringLiteral("Dark"));
+#if defined(Q_OS_MACX)
+ return QStringLiteral("La-Sierra-%1").arg(themePrefix);
+#else
+ return QStringLiteral("Eleven-%1").arg(themePrefix);
+#endif
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VTheme::SetIconTheme()
+{
static const char *GENERIC_ICON_TO_CHECK = "document-open";
if (not QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK))
{
@@ -348,12 +360,7 @@ void VTheme::SetIconTheme()
// 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
-
-#if defined(Q_OS_MACX)
- QIcon::setThemeName(QStringLiteral("La-Sierra-%1").arg(themePrefix));
-#else
- QIcon::setThemeName(QStringLiteral("Eleven-%1").arg(themePrefix));
-#endif
+ QIcon::setThemeName(DefaultThemeName());
}
else
{
@@ -362,7 +369,7 @@ void VTheme::SetIconTheme()
if ((themeMode == VThemeMode::Dark && !ShouldApplyDarkTheme()) ||
(themeMode == VThemeMode::Light && ShouldApplyDarkTheme()))
{
- QIcon::setThemeName(QStringLiteral("Eleven-%1").arg(themePrefix));
+ QIcon::setThemeName(DefaultThemeName());
}
}
}
@@ -506,6 +513,18 @@ void VTheme::ResetThemeSettings() const
emit Instance()->ThemeSettingsChanged();
}
+//---------------------------------------------------------------------------------------------------------------------
+auto VTheme::GetFallbackThemeIcon(const QString &iconName, QSize iconSize) -> QIcon
+{
+ QString filePath = QStringLiteral(":icons/%1/%2.svg").arg(DefaultThemeName(), iconName);
+
+ QIcon icon;
+ icon.addFile(filePath, iconSize, QIcon::Normal, QIcon::On);
+ iconSize *= 2;
+ icon.addFile(filePath, iconSize, QIcon::Normal, QIcon::On);
+ return icon;
+}
+
//---------------------------------------------------------------------------------------------------------------------
auto VTheme::GetIconResource(const QString &root, const QString &iconName) -> QIcon
{
diff --git a/src/libs/vmisc/theme/vtheme.h b/src/libs/vmisc/theme/vtheme.h
index 5df569ec6..34812247d 100644
--- a/src/libs/vmisc/theme/vtheme.h
+++ b/src/libs/vmisc/theme/vtheme.h
@@ -56,6 +56,7 @@ public:
void SetToAutoTheme() const;
void ResetThemeSettings() const;
+ static auto GetFallbackThemeIcon(const QString &iconName, QSize iconSize) -> QIcon;
static auto GetIconResource(const QString &root, const QString &iconName) -> QIcon;
static auto GetPixmapResource(const QString &root, const QString &iconName) -> QPixmap;
static auto GetResourceName(const QString &root, const QString &iconName) -> QString;
@@ -64,6 +65,7 @@ public:
static auto IsInDarkTheme() -> bool;
static auto ShouldApplyDarkTheme() -> bool;
static auto ColorSheme() -> VColorSheme;
+ static auto DefaultThemeName() -> QString;
static void SetIconTheme();
static void InitThemeMode();
static auto ThemeStylesheet() -> QString;