From 18e3c2e661293b5a40dd41e0ce02064c896f40a6 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Mon, 26 Jul 2021 14:26:45 +0200
Subject: [PATCH] UI: Force dark theme icons for now, don't fix the QFileDialog
 in this commit

---
 src/UI/AboutWindow.cc                            |  1 +
 src/UI/MainWindow.cc                             | 12 ++++++------
 src/VivyApplication.hh                           |  8 +++++++-
 utils/rsc/VivyRessources.qrc                     | 16 ++++++++++++++++
 utils/rsc/icons/breeze-dark/document-new.svg     | 13 +++++++++++++
 utils/rsc/icons/breeze-dark/document-open.svg    | 13 +++++++++++++
 utils/rsc/icons/breeze-dark/document-save-as.svg | 13 +++++++++++++
 utils/rsc/icons/breeze-dark/document-save.svg    | 13 +++++++++++++
 utils/rsc/icons/breeze-dark/help-about.svg       | 12 ++++++++++++
 utils/rsc/icons/breeze-light/document-new.svg    | 13 +++++++++++++
 utils/rsc/icons/breeze-light/document-open.svg   | 13 +++++++++++++
 .../rsc/icons/breeze-light/document-save-as.svg  | 13 +++++++++++++
 utils/rsc/icons/breeze-light/document-save.svg   | 13 +++++++++++++
 utils/rsc/icons/breeze-light/help-about.svg      | 12 ++++++++++++
 14 files changed, 158 insertions(+), 7 deletions(-)
 create mode 100644 utils/rsc/icons/breeze-dark/document-new.svg
 create mode 100644 utils/rsc/icons/breeze-dark/document-open.svg
 create mode 100644 utils/rsc/icons/breeze-dark/document-save-as.svg
 create mode 100644 utils/rsc/icons/breeze-dark/document-save.svg
 create mode 100644 utils/rsc/icons/breeze-dark/help-about.svg
 create mode 100644 utils/rsc/icons/breeze-light/document-new.svg
 create mode 100644 utils/rsc/icons/breeze-light/document-open.svg
 create mode 100644 utils/rsc/icons/breeze-light/document-save-as.svg
 create mode 100644 utils/rsc/icons/breeze-light/document-save.svg
 create mode 100644 utils/rsc/icons/breeze-light/help-about.svg

diff --git a/src/UI/AboutWindow.cc b/src/UI/AboutWindow.cc
index 9027ca32..42ba502a 100644
--- a/src/UI/AboutWindow.cc
+++ b/src/UI/AboutWindow.cc
@@ -32,6 +32,7 @@ static const char *libContent =
     "  <ul>"
     "    <li><a href=https://github.com/tonsky/FiraCode>FiraCode</a> &copy; <i>Nikita Prokopov. (OFL-1.1)</i></li>"
     "    <li><a href=https://fonts.google.com/specimen/Noto+Sans>NotoSans</a> &copy; <i>Google. (APACHE-2.0)</i>"
+    "    <li><a href=https://github.com/KDE/breeze-icons>The breeze icon theme</a> &copy; <i>The KDE Visual Design Group. (LGPL-V3)</i></li>"
     "    <li><a href=https://github.com/ColinDuquesnoy/QDarkStyleSheet>QDarkStyleSheet</a> &copy; <i>Colin Duquesnoy, Daniel Cosmo Pizetta. (MIT + CCAI-4.0)</i></li>"
     "  </ul>"
     "</body>";
diff --git a/src/UI/MainWindow.cc b/src/UI/MainWindow.cc
index 02dc1218..2353683b 100644
--- a/src/UI/MainWindow.cc
+++ b/src/UI/MainWindow.cc
@@ -32,7 +32,7 @@
     menu##Menu->addAction(method##Act);                                                            \
     connect(method##Act, &QAction::triggered, this, &MainWindow::method);
 
-#define ACTION_ADD_ICON(action, icon) action##Act->setIcon(QIcon::fromTheme(icon));
+#define ACTION_ADD_ICON(action, icon) action##Act->setIcon(QIcon(icon));
 
 #define ACTION_ADD_SHORTCUT(action, shortcut) action##Act->setShortcut(shortcut);
 
@@ -66,11 +66,11 @@ MainWindow::MainWindow() noexcept
 
     DCL_ACTION(openDialogHelp, "&About", "Open the help dialog", help);
 
-    ACTION_ADD_ICON(newDocument, "document-new");
-    ACTION_ADD_ICON(openDocument, "document-open");
-    ACTION_ADD_ICON(saveFile, "document-save");
-    ACTION_ADD_ICON(saveFileAs, "document-save-as");
-    ACTION_ADD_ICON(openDialogHelp, "help-about");
+    ACTION_ADD_ICON(newDocument, VIVY_ICON_NEW);
+    ACTION_ADD_ICON(openDocument, VIVY_ICON_OPEN);
+    ACTION_ADD_ICON(saveFile, VIVY_ICON_SAVE);
+    ACTION_ADD_ICON(saveFileAs, VIVY_ICON_SAVE_AS);
+    ACTION_ADD_ICON(openDialogHelp, VIVY_ICON_ABOUT);
 
     ACTION_ADD_SHORTCUT(newDocument, QKeySequence::New);
     ACTION_ADD_SHORTCUT(openDocument, QKeySequence::Open);
diff --git a/src/VivyApplication.hh b/src/VivyApplication.hh
index cdae52b4..86c5f89d 100644
--- a/src/VivyApplication.hh
+++ b/src/VivyApplication.hh
@@ -6,7 +6,13 @@
 
 #define vivyApp static_cast<VivyApplication *>(QApplication::instance())
 
-#define VIVY_ICON_APP ":icons/vivy.png"
+// Only support dark theme for now
+#define VIVY_ICON_APP     ":icons/vivy.png"
+#define VIVY_ICON_OPEN    ":icons/dark/document-open.svg"
+#define VIVY_ICON_NEW     ":icons/dark/document-new.svg"
+#define VIVY_ICON_SAVE    ":icons/dark/document-save.svg"
+#define VIVY_ICON_SAVE_AS ":icons/dark/document-save-as.svg"
+#define VIVY_ICON_ABOUT   ":icons/dark/help-about.svg"
 
 #include <QApplication>
 #include <QPixmap>
diff --git a/utils/rsc/VivyRessources.qrc b/utils/rsc/VivyRessources.qrc
index 99e577f4..bf6947e9 100644
--- a/utils/rsc/VivyRessources.qrc
+++ b/utils/rsc/VivyRessources.qrc
@@ -18,6 +18,22 @@
     <file>licence/CCAI-4.0</file>
 </qresource>
 
+<!-- Breeze icons, LGPL-3.0 Licence -->
+<qresource prefix="icons/dark">
+    <file alias="document-new.svg">icons/breeze-dark/document-new.svg</file>
+    <file alias="document-open.svg">icons/breeze-dark/document-open.svg</file>
+    <file alias="document-save.svg">icons/breeze-dark/document-save.svg</file>
+    <file alias="document-save-as.svg">icons/breeze-dark/document-save-as.svg</file>
+    <file alias="help-about.svg">icons/breeze-dark/help-about.svg</file>
+</qresource>
+<qresource prefix="icons/light">
+    <file alias="document-new.svg">icons/breeze-light/document-new.svg</file>
+    <file alias="document-open.svg">icons/breeze-light/document-open.svg</file>
+    <file alias="document-save.svg">icons/breeze-light/document-save.svg</file>
+    <file alias="document-save-as.svg">icons/breeze-light/document-save-as.svg</file>
+    <file alias="help-about.svg">icons/breeze-light/help-about.svg</file>
+</qresource>
+
 <!-- QDarkStyle style sheet, MIT Licence -->
 <qresource prefix="qdarkstyle/dark">  <file alias="style.qss">qdarkstyle_dark.qss</file>  </qresource>
 <qresource prefix="qdarkstyle/light"> <file alias="style.qss">qdarkstyle_light.qss</file> </qresource>
diff --git a/utils/rsc/icons/breeze-dark/document-new.svg b/utils/rsc/icons/breeze-dark/document-new.svg
new file mode 100644
index 00000000..31601727
--- /dev/null
+++ b/utils/rsc/icons/breeze-dark/document-new.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <defs id="defs3051">
+    <style type="text/css" id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#eff0f1;
+      }
+      </style>
+  </defs>
+  <path style="fill:currentColor;fill-opacity:1;stroke:none" 
+     d="M 3 2 L 3 14 L 8 14 L 8 13 L 4 13 L 4 3 L 9 3 L 9 6 L 12 6 L 12 9 L 13 9 L 13 6 L 13 5 L 10 2 L 9 2 L 3 2 z M 10 9 L 10 11 L 8 11 L 8 12 L 10 12 L 10 14 L 11 14 L 11 12 L 13 12 L 13 11 L 11 11 L 11 9 L 10 9 z "
+     class="ColorScheme-Text"
+     />
+</svg>
diff --git a/utils/rsc/icons/breeze-dark/document-open.svg b/utils/rsc/icons/breeze-dark/document-open.svg
new file mode 100644
index 00000000..4e0f9c47
--- /dev/null
+++ b/utils/rsc/icons/breeze-dark/document-open.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <defs id="defs3051">
+    <style type="text/css" id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#eff0f1;
+      }
+      </style>
+  </defs>
+ <path style="fill:currentColor;fill-opacity:1;stroke:none" 
+     d="M 2 2 L 2 3 L 2 6 L 2 7 L 2 13 L 2 14 L 14 14 L 14 13 L 14 6 L 14 5 L 14 4 L 9.0078125 4 L 7.0078125 2 L 7 2.0078125 L 7 2 L 3 2 L 2 2 z M 3 3 L 6.5917969 3 L 7.59375 4 L 7 4 L 7 4.0078125 L 6.9921875 4 L 4.9921875 6 L 3 6 L 3 3 z M 3 7 L 13 7 L 13 13 L 3 13 L 3 7 z "
+     class="ColorScheme-Text"
+     />
+</svg>
diff --git a/utils/rsc/icons/breeze-dark/document-save-as.svg b/utils/rsc/icons/breeze-dark/document-save-as.svg
new file mode 100644
index 00000000..7aa06852
--- /dev/null
+++ b/utils/rsc/icons/breeze-dark/document-save-as.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <defs id="defs3051">
+    <style type="text/css" id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#eff0f1;
+      }
+      </style>
+  </defs>
+ <path style="fill:currentColor;fill-opacity:1;stroke:none" 
+     d="M 2 2 L 2 14 L 3 14 L 4 14 L 7 14 L 7 13 L 6 13 L 5 13 L 5 10 L 6 10 L 7 10 L 8 10 L 8 9 L 7 9 L 5 9 L 3.96875 9 L 3.96875 13 L 3 13 L 3 3 L 4 3 L 5 3 L 5 6 L 5 7 L 7 7 L 11 7 L 11 6 L 11 3 L 11.28125 3 L 13 4.71875 L 13 5 L 13 7 L 14 7 L 14 4.28125 L 11.71875 2 L 11.6875 2 L 11 2 L 4 2 L 3 2 L 2 2 z M 6 3 L 7.90625 3 L 7.90625 6 L 6 6 L 6 3 z M 12 8 L 11 9 L 10 10 L 8 12 L 8 13 L 8 14 L 10 14 L 11 13 L 12 12 L 13 11 L 14 10 L 12 8 z M 11.689453 9.6894531 L 12.28125 10.28125 L 10.59375 11.96875 L 10.59375 11.984375 L 9.3125 13.28125 L 8.71875 12.6875 L 11.689453 9.6894531 z "
+     class="ColorScheme-Text"
+     />
+</svg>
diff --git a/utils/rsc/icons/breeze-dark/document-save.svg b/utils/rsc/icons/breeze-dark/document-save.svg
new file mode 100644
index 00000000..1484379e
--- /dev/null
+++ b/utils/rsc/icons/breeze-dark/document-save.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <defs id="defs3051">
+    <style type="text/css" id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#eff0f1;
+      }
+      </style>
+  </defs>
+ <path style="fill:currentColor;fill-opacity:1;stroke:none" 
+     d="M 2 2 L 2 14 L 3 14 L 4 14 L 10 14 L 11 14 L 12 14 L 14 14 L 14 4.28125 L 11.71875 2 L 11.6875 2 L 11 2 L 4 2 L 3 2 L 2 2 z M 3 3 L 4 3 L 5 3 L 5 6 L 5 7 L 11 7 L 11 6 L 11 3 L 11.28125 3 L 13 4.71875 L 13 5 L 13 13 L 12 13 L 12 9 L 11 9 L 5 9 L 3.96875 9 L 3.96875 13 L 3 13 L 3 3 z M 6 3 L 7.90625 3 L 7.90625 6 L 6 6 L 6 3 z M 5 10 L 6 10 L 10 10 L 11 10 L 11 13 L 10 13 L 6 13 L 5 13 L 5 10 z "
+     class="ColorScheme-Text"
+     />
+</svg>
diff --git a/utils/rsc/icons/breeze-dark/help-about.svg b/utils/rsc/icons/breeze-dark/help-about.svg
new file mode 100644
index 00000000..856d1b2b
--- /dev/null
+++ b/utils/rsc/icons/breeze-dark/help-about.svg
@@ -0,0 +1,12 @@
+<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+    <style type="text/css" id="current-color-scheme">
+        .ColorScheme-Text {
+            color:#eff0f1;
+        }
+    </style>
+    <g class="ColorScheme-Text" fill="currentColor" fill-rule="evenodd">
+        <path d="m8 2a6 6 0 0 0 -6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0 -6-6zm0 1a5 5 0 0 1 5 5 5 5 0 0 1 -5 5 5 5 0 0 1 -5-5 5 5 0 0 1 5-5z"/>
+        <path d="m7 4h2v2h-2z"/>
+        <path d="m7 7h2v5h-2z"/>
+    </g>
+</svg>
diff --git a/utils/rsc/icons/breeze-light/document-new.svg b/utils/rsc/icons/breeze-light/document-new.svg
new file mode 100644
index 00000000..6434a18e
--- /dev/null
+++ b/utils/rsc/icons/breeze-light/document-new.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <defs id="defs3051">
+    <style type="text/css" id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#232629;
+      }
+      </style>
+  </defs>
+  <path style="fill:currentColor;fill-opacity:1;stroke:none" 
+     d="M 3 2 L 3 14 L 8 14 L 8 13 L 4 13 L 4 3 L 9 3 L 9 6 L 12 6 L 12 9 L 13 9 L 13 6 L 13 5 L 10 2 L 9 2 L 3 2 z M 10 9 L 10 11 L 8 11 L 8 12 L 10 12 L 10 14 L 11 14 L 11 12 L 13 12 L 13 11 L 11 11 L 11 9 L 10 9 z "
+     class="ColorScheme-Text"
+     />
+</svg>
diff --git a/utils/rsc/icons/breeze-light/document-open.svg b/utils/rsc/icons/breeze-light/document-open.svg
new file mode 100644
index 00000000..4d2b8389
--- /dev/null
+++ b/utils/rsc/icons/breeze-light/document-open.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <defs id="defs3051">
+    <style type="text/css" id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#232629;
+      }
+      </style>
+  </defs>
+ <path style="fill:currentColor;fill-opacity:1;stroke:none" 
+     d="M 2 2 L 2 3 L 2 6 L 2 7 L 2 13 L 2 14 L 14 14 L 14 13 L 14 6 L 14 5 L 14 4 L 9.0078125 4 L 7.0078125 2 L 7 2.0078125 L 7 2 L 3 2 L 2 2 z M 3 3 L 6.5917969 3 L 7.59375 4 L 7 4 L 7 4.0078125 L 6.9921875 4 L 4.9921875 6 L 3 6 L 3 3 z M 3 7 L 13 7 L 13 13 L 3 13 L 3 7 z "
+     class="ColorScheme-Text"
+     />
+</svg>
diff --git a/utils/rsc/icons/breeze-light/document-save-as.svg b/utils/rsc/icons/breeze-light/document-save-as.svg
new file mode 100644
index 00000000..b8ad9683
--- /dev/null
+++ b/utils/rsc/icons/breeze-light/document-save-as.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <defs id="defs3051">
+    <style type="text/css" id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#232629;
+      }
+      </style>
+  </defs>
+ <path style="fill:currentColor;fill-opacity:1;stroke:none" 
+     d="M 2 2 L 2 14 L 3 14 L 4 14 L 7 14 L 7 13 L 6 13 L 5 13 L 5 10 L 6 10 L 7 10 L 8 10 L 8 9 L 7 9 L 5 9 L 3.96875 9 L 3.96875 13 L 3 13 L 3 3 L 4 3 L 5 3 L 5 6 L 5 7 L 7 7 L 11 7 L 11 6 L 11 3 L 11.28125 3 L 13 4.71875 L 13 5 L 13 7 L 14 7 L 14 4.28125 L 11.71875 2 L 11.6875 2 L 11 2 L 4 2 L 3 2 L 2 2 z M 6 3 L 7.90625 3 L 7.90625 6 L 6 6 L 6 3 z M 12 8 L 11 9 L 10 10 L 8 12 L 8 13 L 8 14 L 10 14 L 11 13 L 12 12 L 13 11 L 14 10 L 12 8 z M 11.689453 9.6894531 L 12.28125 10.28125 L 10.59375 11.96875 L 10.59375 11.984375 L 9.3125 13.28125 L 8.71875 12.6875 L 11.689453 9.6894531 z "
+     class="ColorScheme-Text"
+     />
+</svg>
diff --git a/utils/rsc/icons/breeze-light/document-save.svg b/utils/rsc/icons/breeze-light/document-save.svg
new file mode 100644
index 00000000..cd2db5ad
--- /dev/null
+++ b/utils/rsc/icons/breeze-light/document-save.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <defs id="defs3051">
+    <style type="text/css" id="current-color-scheme">
+      .ColorScheme-Text {
+        color:#232629;
+      }
+      </style>
+  </defs>
+ <path style="fill:currentColor;fill-opacity:1;stroke:none" 
+     d="M 2 2 L 2 14 L 3 14 L 4 14 L 10 14 L 11 14 L 12 14 L 14 14 L 14 4.28125 L 11.71875 2 L 11.6875 2 L 11 2 L 4 2 L 3 2 L 2 2 z M 3 3 L 4 3 L 5 3 L 5 6 L 5 7 L 11 7 L 11 6 L 11 3 L 11.28125 3 L 13 4.71875 L 13 5 L 13 13 L 12 13 L 12 9 L 11 9 L 5 9 L 3.96875 9 L 3.96875 13 L 3 13 L 3 3 z M 6 3 L 7.90625 3 L 7.90625 6 L 6 6 L 6 3 z M 5 10 L 6 10 L 10 10 L 11 10 L 11 13 L 10 13 L 6 13 L 5 13 L 5 10 z "
+     class="ColorScheme-Text"
+     />
+</svg>
diff --git a/utils/rsc/icons/breeze-light/help-about.svg b/utils/rsc/icons/breeze-light/help-about.svg
new file mode 100644
index 00000000..ea1dc02c
--- /dev/null
+++ b/utils/rsc/icons/breeze-light/help-about.svg
@@ -0,0 +1,12 @@
+<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+    <style type="text/css" id="current-color-scheme">
+        .ColorScheme-Text {
+            color:#232629;
+        }
+    </style>
+    <g class="ColorScheme-Text" fill="currentColor" fill-rule="evenodd">
+        <path d="m8 2a6 6 0 0 0 -6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0 -6-6zm0 1a5 5 0 0 1 5 5 5 5 0 0 1 -5 5 5 5 0 0 1 -5-5 5 5 0 0 1 5-5z"/>
+        <path d="m7 4h2v2h-2z"/>
+        <path d="m7 7h2v5h-2z"/>
+    </g>
+</svg>
-- 
GitLab