Browse Source

Use material icons for lock and state-info

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Claudio Cambra 3 years ago
parent
commit
719a8f38bf

+ 1 - 2
src/gui/accountsettings.cpp

@@ -249,9 +249,8 @@ void AccountSettings::slotE2eEncryptionMnemonicReady()
 
     _ui->encryptionMessage->setMessageType(KMessageWidget::Positive);
     _ui->encryptionMessage->setText(tr("End-to-End encryption has been enabled for this account"));
-    _ui->encryptionMessage->setIcon(Theme::createIconFromSvgResource(QStringLiteral(":/client/theme/colored/state-ok.svg")));
+    _ui->encryptionMessage->setIcon(Theme::createColorAwareIcon(QStringLiteral(":/client/theme/lock.svg")));
     _ui->encryptionMessage->show();
-
 }
 
 void AccountSettings::slotE2eEncryptionGenerateKeys()

+ 0 - 15
src/libsync/theme.cpp

@@ -870,21 +870,6 @@ QPixmap Theme::createColorAwarePixmap(const QString &name)
     return createColorAwarePixmap(name, QGuiApplication::palette());
 }
 
-QIcon Theme::createIconFromSvgResource(const QString &resourcePath)
-{
-    QSvgRenderer renderer(resourcePath);
-
-    QImage img(64, 64, QImage::Format_ARGB32);
-    img.fill(Qt::GlobalColor::transparent);
-
-    QPainter imgPainter(&img);
-    renderer.render(&imgPainter);
-
-    QIcon icon(QPixmap::fromImage(img));
-
-    return icon;
-}
-
 bool Theme::showVirtualFilesOption() const
 {
     const auto vfsMode = bestAvailableVfsMode();

+ 0 - 2
src/libsync/theme.h

@@ -567,8 +567,6 @@ public:
      */
     static QPixmap createColorAwarePixmap(const QString &name);
 
-    static QIcon createIconFromSvgResource(const QString &resourcePath);
-
     /**
      * @brief Whether to show the option to create folders using "virtual files".
      *

+ 1 - 0
theme.qrc.in

@@ -209,6 +209,7 @@
         <file>theme/more.svg</file>
         <file>theme/change.svg</file>
         <file>theme/colored/change-bordered.svg</file>
+        <file>theme/lock.svg</file>
         <file>theme/lock-http.svg</file>
         <file>theme/lock-https.svg</file>
         <file>theme/lock-broken.svg</file>

File diff suppressed because it is too large
+ 0 - 0
theme/black/state-info.svg


+ 51 - 1
theme/lock-broken.svg

@@ -1 +1,51 @@
-<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg"><path d="m32 4c-9.276 0-15.868 7.4576-16 16v10h-6v18.914l-6 6 5.6562 5.6562 50.914-50.914-5.6562-5.6562-8.7266 8.7266c-2.6278-5.2025-7.9771-8.6518-14.188-8.7266zm0 8c4.5949 0 7.4656 3.2614 7.9062 7.0078l-10.992 10.992h-4.9141v-10c0-4.696 2.988-8 8-8zm16.227 18-30 30h35.773v-30z" fill="#c13030"/></svg>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   enable-background="new 0 0 24 24"
+   height="24px"
+   viewBox="0 0 24 24"
+   width="24px"
+   fill="#000000"
+   version="1.1"
+   id="svg832"
+   sodipodi:docname="no_encryption_gmailerrorred_black_24dp.svg"
+   inkscape:version="1.1.2 (b8e25be8, 2022-02-05)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <defs
+     id="defs836" />
+  <sodipodi:namedview
+     id="namedview834"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     showgrid="false"
+     inkscape:zoom="29.791667"
+     inkscape:cx="12"
+     inkscape:cy="12"
+     inkscape:window-width="2560"
+     inkscape:window-height="937"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg832" />
+  <g
+     id="g826">
+    <path
+       d="M0,0h24v24H0V0z"
+       fill="none"
+       id="path824" />
+  </g>
+  <g
+     id="g830"
+     style="fill:#aa0000">
+    <path
+       d="M8.9,6c0-1.71,1.39-3.1,3.1-3.1s3.1,1.39,3.1,3.1v2h-4.27L20,17.17V10c0-1.1-0.9-2-2-2h-1V6c0-2.76-2.24-5-5-5 C9.79,1,7.93,2.45,7.27,4.44L8.9,6.07V6z M2.1,2.1L0.69,3.51L5.3,8.13C4.55,8.42,4,9.15,4,10v10c0,1.1,0.9,2,2,2h12 c0.34,0,0.65-0.09,0.93-0.24l1.56,1.56l1.41-1.41L2.1,2.1z M12,17c-1.1,0-2-0.9-2-2c0-0.59,0.27-1.12,0.68-1.49l2.81,2.81 C13.12,16.73,12.59,17,12,17z"
+       id="path828"
+       style="fill:#aa0000" />
+  </g>
+</svg>

+ 61 - 1
theme/lock-http.svg

@@ -1 +1,61 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1"><path fill="#909090" d="m32 6c-8.284 0-15 6.716-15 15v10h-5v28h40v-28h-5v-10c0-8.284-6.716-15-15-15zm0 6c4.9706 0 9 4.0294 9 9v10h-18v-10c0-4.9706 4.0294-9 9-9z"/><path d="m26 45h36l-18-30z" fill="#dfae19"/></svg>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   enable-background="new 0 0 24 24"
+   height="24px"
+   viewBox="0 0 24 24"
+   width="24px"
+   fill="#000000"
+   version="1.1"
+   id="svg836"
+   sodipodi:docname="lock-http.svg"
+   inkscape:version="1.1.2 (b8e25be8, 2022-02-05)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <defs
+     id="defs840" />
+  <sodipodi:namedview
+     id="namedview838"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     showgrid="false"
+     inkscape:zoom="29.791667"
+     inkscape:cx="12"
+     inkscape:cy="12"
+     inkscape:window-width="2560"
+     inkscape:window-height="937"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg836" />
+  <g
+     id="g826">
+    <rect
+       fill="none"
+       height="24"
+       width="24"
+       x="0"
+       id="rect824" />
+  </g>
+  <g
+     id="g834"
+     style="fill:#d4aa00">
+    <g
+       id="g832"
+       style="fill:#d4aa00">
+      <g
+         id="g830"
+         style="fill:#d4aa00">
+        <path
+           d="M12,17c1.1,0,2-0.9,2-2s-0.9-2-2-2s-2,0.9-2,2S10.9,17,12,17z M18,8h-1V6c0-2.76-2.24-5-5-5S7,3.24,7,6v2H6 c-1.1,0-2,0.9-2,2v10c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V10C20,8.9,19.1,8,18,8z M8.9,6c0-1.71,1.39-3.1,3.1-3.1 s3.1,1.39,3.1,3.1v2H8.9V6z M18,20H6V10h12V20z"
+           id="path828"
+           style="fill:#d4aa00" />
+      </g>
+    </g>
+  </g>
+</svg>

+ 43 - 1
theme/lock-https.svg

@@ -1 +1,43 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="64" width="64" version="1.1"><path fill="#60a149" d="m32 6c-8.284 0-15 6.716-15 15v10h-5v28h40v-28h-5v-10c0-8.284-6.716-15-15-15zm0 6c4.9706 0 9 4.0294 9 9v10h-18v-10c0-4.9706 4.0294-9 9-9z"/></svg>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   height="24px"
+   viewBox="0 0 24 24"
+   width="24px"
+   fill="#000000"
+   version="1.1"
+   id="svg828"
+   sodipodi:docname="lock-https.svg"
+   inkscape:version="1.1.2 (b8e25be8, 2022-02-05)"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <defs
+     id="defs832" />
+  <sodipodi:namedview
+     id="namedview830"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0.0"
+     inkscape:pagecheckerboard="0"
+     showgrid="false"
+     inkscape:zoom="29.791667"
+     inkscape:cx="12"
+     inkscape:cy="12"
+     inkscape:window-width="1296"
+     inkscape:window-height="937"
+     inkscape:window-x="256"
+     inkscape:window-y="25"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg828" />
+  <path
+     d="M0 0h24v24H0z"
+     fill="none"
+     id="path824" />
+  <path
+     d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"
+     id="path826"
+     style="fill:#338000" />
+</svg>

+ 1 - 0
theme/lock.svg

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>

File diff suppressed because it is too large
+ 0 - 0
theme/white/state-info.svg


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