From b5554e05d82f752bbffb54b417960186d16024ca Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 23 May 2020 11:05:44 -0400 Subject: [PATCH] Improve application icons * Add icons for Database Import, Database Export, and Recent Databases * Change app exit icon to be distinct from export icon * Updated and ran makeappicons.sh --- COPYING | 3 ++ .../scalable/actions/application-exit.svg | 2 +- .../scalable/actions/clipboard-text.svg | 2 +- .../scalable/actions/configure.svg | 2 +- .../scalable/actions/document-export.svg | 1 + .../scalable/actions/document-import.svg | 1 + .../scalable/actions/document-open-recent.svg | 1 + .../scalable/actions/entry-clone.svg | 2 +- .../scalable/actions/entry-delete.svg | 2 +- .../scalable/actions/entry-edit.svg | 2 +- .../scalable/actions/entry-new.svg | 2 +- .../scalable/actions/move-down.svg | 2 +- .../application/scalable/actions/move-up.svg | 2 +- .../application/scalable/actions/refresh.svg | 2 +- .../actions/sort-alphabetical-ascending.svg | 2 +- .../actions/sort-alphabetical-descending.svg | 2 +- .../scalable/status/dialog-error.svg | 2 +- share/icons/icons.qrc | 5 +- src/gui/MainWindow.cpp | 3 ++ utils/makeappicons.sh | 48 +++++++++++-------- 20 files changed, 55 insertions(+), 33 deletions(-) create mode 100644 share/icons/application/scalable/actions/document-export.svg create mode 100644 share/icons/application/scalable/actions/document-import.svg create mode 100644 share/icons/application/scalable/actions/document-open-recent.svg diff --git a/COPYING b/COPYING index 11f5ee0b7..174848e46 100644 --- a/COPYING +++ b/COPYING @@ -142,8 +142,11 @@ License: MIT Files: share/icons/application/scalable/actions/document-close.svg share/icons/application/scalable/actions/document-edit.svg + share/icons/application/scalable/actions/document-export.svg + share/icons/application/scalable/actions/document-import.svg share/icons/application/scalable/actions/document-new.svg share/icons/application/scalable/actions/document-open.svg + share/icons/application/scalable/actions/document-open-recent.svg share/icons/application/scalable/actions/document-properties.svg share/icons/application/scalable/actions/document-save.svg share/icons/application/scalable/actions/document-save-as.svg diff --git a/share/icons/application/scalable/actions/application-exit.svg b/share/icons/application/scalable/actions/application-exit.svg index aea8b16ad..0c820cf06 100644 --- a/share/icons/application/scalable/actions/application-exit.svg +++ b/share/icons/application/scalable/actions/application-exit.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/clipboard-text.svg b/share/icons/application/scalable/actions/clipboard-text.svg index 88e025e02..a6ad04e2e 100644 --- a/share/icons/application/scalable/actions/clipboard-text.svg +++ b/share/icons/application/scalable/actions/clipboard-text.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/configure.svg b/share/icons/application/scalable/actions/configure.svg index 6ab8c5e7c..5cacc6ff7 100644 --- a/share/icons/application/scalable/actions/configure.svg +++ b/share/icons/application/scalable/actions/configure.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/document-export.svg b/share/icons/application/scalable/actions/document-export.svg new file mode 100644 index 000000000..8b7a6504e --- /dev/null +++ b/share/icons/application/scalable/actions/document-export.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/document-import.svg b/share/icons/application/scalable/actions/document-import.svg new file mode 100644 index 000000000..6cbea2f72 --- /dev/null +++ b/share/icons/application/scalable/actions/document-import.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/document-open-recent.svg b/share/icons/application/scalable/actions/document-open-recent.svg new file mode 100644 index 000000000..c1f209520 --- /dev/null +++ b/share/icons/application/scalable/actions/document-open-recent.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/entry-clone.svg b/share/icons/application/scalable/actions/entry-clone.svg index 001d98242..5cac2bbec 100644 --- a/share/icons/application/scalable/actions/entry-clone.svg +++ b/share/icons/application/scalable/actions/entry-clone.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/entry-delete.svg b/share/icons/application/scalable/actions/entry-delete.svg index dad58cf89..66ae96f1b 100644 --- a/share/icons/application/scalable/actions/entry-delete.svg +++ b/share/icons/application/scalable/actions/entry-delete.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/entry-edit.svg b/share/icons/application/scalable/actions/entry-edit.svg index 6e0b0afa8..174a1abce 100644 --- a/share/icons/application/scalable/actions/entry-edit.svg +++ b/share/icons/application/scalable/actions/entry-edit.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/entry-new.svg b/share/icons/application/scalable/actions/entry-new.svg index 3fe6bec7e..eec7f0724 100644 --- a/share/icons/application/scalable/actions/entry-new.svg +++ b/share/icons/application/scalable/actions/entry-new.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/move-down.svg b/share/icons/application/scalable/actions/move-down.svg index edcf11814..bc5edfb07 100644 --- a/share/icons/application/scalable/actions/move-down.svg +++ b/share/icons/application/scalable/actions/move-down.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/move-up.svg b/share/icons/application/scalable/actions/move-up.svg index 7ba0a9f13..ac6f52c17 100644 --- a/share/icons/application/scalable/actions/move-up.svg +++ b/share/icons/application/scalable/actions/move-up.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/refresh.svg b/share/icons/application/scalable/actions/refresh.svg index ebe3f16e7..767162cb6 100644 --- a/share/icons/application/scalable/actions/refresh.svg +++ b/share/icons/application/scalable/actions/refresh.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/sort-alphabetical-ascending.svg b/share/icons/application/scalable/actions/sort-alphabetical-ascending.svg index 50d98a418..754e90a28 100644 --- a/share/icons/application/scalable/actions/sort-alphabetical-ascending.svg +++ b/share/icons/application/scalable/actions/sort-alphabetical-ascending.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/actions/sort-alphabetical-descending.svg b/share/icons/application/scalable/actions/sort-alphabetical-descending.svg index 602ea069d..4dbaadbe2 100644 --- a/share/icons/application/scalable/actions/sort-alphabetical-descending.svg +++ b/share/icons/application/scalable/actions/sort-alphabetical-descending.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/application/scalable/status/dialog-error.svg b/share/icons/application/scalable/status/dialog-error.svg index 4cec1e30d..0a6c3e674 100644 --- a/share/icons/application/scalable/status/dialog-error.svg +++ b/share/icons/application/scalable/status/dialog-error.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/share/icons/icons.qrc b/share/icons/icons.qrc index c1d74ba84..a02106d21 100644 --- a/share/icons/icons.qrc +++ b/share/icons/icons.qrc @@ -18,8 +18,11 @@ application/scalable/actions/dialog-ok.svg application/scalable/actions/document-close.svg application/scalable/actions/document-edit.svg + application/scalable/actions/document-export.svg + application/scalable/actions/document-import.svg application/scalable/actions/document-new.svg application/scalable/actions/document-open.svg + application/scalable/actions/document-open-recent.svg application/scalable/actions/document-properties.svg application/scalable/actions/document-save.svg application/scalable/actions/document-save-as.svg @@ -53,7 +56,7 @@ application/scalable/actions/password-generator.svg application/scalable/actions/password-show-off.svg application/scalable/actions/password-show-on.svg - application/scalable/actions/refresh.svg + application/scalable/actions/refresh.svg application/scalable/actions/reports.svg application/scalable/actions/reports-exclude.svg application/scalable/actions/sort-alphabetical-ascending.svg diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index eed3a903a..1cf4d46f0 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -327,6 +327,7 @@ MainWindow::MainWindow() m_ui->actionDatabaseNew->setIcon(resources()->icon("document-new")); m_ui->actionDatabaseOpen->setIcon(resources()->icon("document-open")); + m_ui->menuRecentDatabases->setIcon(resources()->icon("document-open-recent")); m_ui->actionDatabaseSave->setIcon(resources()->icon("document-save")); m_ui->actionDatabaseSaveAs->setIcon(resources()->icon("document-save-as")); m_ui->actionDatabaseSaveBackup->setIcon(resources()->icon("document-save-copy")); @@ -337,6 +338,8 @@ MainWindow::MainWindow() m_ui->actionLockDatabases->setIcon(resources()->icon("database-lock")); m_ui->actionQuit->setIcon(resources()->icon("application-exit")); m_ui->actionDatabaseMerge->setIcon(resources()->icon("database-merge")); + m_ui->menuImport->setIcon(resources()->icon("document-import")); + m_ui->menuExport->setIcon(resources()->icon("document-export")); m_ui->actionEntryNew->setIcon(resources()->icon("entry-new")); m_ui->actionEntryClone->setIcon(resources()->icon("entry-clone")); diff --git a/utils/makeappicons.sh b/utils/makeappicons.sh index feb2d25fe..707a24b21 100644 --- a/utils/makeappicons.sh +++ b/utils/makeappicons.sh @@ -38,22 +38,27 @@ # # Material icons: https://materialdesignicons.com/ +NC='\033[0m' +RED='\033[0;31m' +YELLOW='\033[0;33m' + if [ $# != 1 ];then echo "Usage: $0 MATERIAL" - echo "MATERIAL is the check-out directory of the material icons repository" + echo "MATERIAL is the directory containing the material icons repository" echo "(git clone https://github.com/Templarian/MaterialDesign.git)". exit fi MATERIAL="$1" if [ ! -d "$MATERIAL" ];then - echo "Material check-out directory doesn't exist: $MATERIAL" + echo -e "${RED}Material Icons directory does not exist: ${MATERIAL}${NC}" exit 1 fi -if [ ! -d application ];then - echo "Please run this script from within the share/icons directory" - echo "of the KeePassXC source distribution." +# Check destination dir +DSTDIR=share/icons/application +if [ ! -d "$DSTDIR" ];then + echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}" exit 1 fi @@ -65,24 +70,28 @@ fi # If the icon name is unknown, outputs nothing. map() { case "$1" in - application-exit) echo exit-to-app ;; + application-exit) echo exit-run ;; auto-type) echo keyboard-variant ;; bugreport) echo bug-outline ;; chronometer) echo clock-outline ;; - configure) echo settings-outline ;; + clipboard-text) echo clipboard-text-outline ;; + configure) echo cog-outline ;; database-change-key) echo key ;; database-close) echo close ;; database-lock) echo lock-outline ;; database-merge) echo merge ;; dialog-close) echo close ;; - dialog-error) echo alert-octagon ;; + dialog-error) echo alert-circle-outline ;; dialog-information) echo information-outline ;; dialog-ok) echo checkbox-marked-circle ;; dialog-warning) echo alert-outline ;; document-close) echo close ;; document-edit) echo pencil ;; + document-export) echo export ;; + document-import) echo import ;; document-new) echo plus ;; document-open) echo folder-open-outline ;; + document-open-recent) echo folder-clock-outline ;; document-properties) echo file-edit-outline ;; document-save) echo content-save-outline ;; document-save-as) echo content-save-all-outline ;; @@ -90,12 +99,11 @@ map() { donate) echo gift-outline ;; edit-clear-locationbar-ltr) echo backspace-reverse-outline ;; edit-clear-locationbar-rtl) echo backspace-outline ;; - entry-clone) echo comment-multiple-outline ;; - entry-delete) echo comment-remove-outline ;; - entry-edit) echo comment-edit-outline ;; - entry-new) echo comment-plus-outline ;; + entry-clone) echo plus-circle-multiple-outline ;; + entry-delete) echo close-circle-outline ;; + entry-edit) echo pencil-circle-outline ;; + entry-new) echo plus-circle-outline ;; favicon-download) echo download ;; - freedesktop) echo freedesktop-dot-org ;; getting-started) echo lightbulb-on-outline ;; group-delete) echo folder-remove-outline ;; group-edit) echo folder-edit-outline ;; @@ -104,8 +112,8 @@ map() { health) echo heart-pulse ;; help-about) echo information-outline ;; internet-web-browser) echo web ;; - key-enter) echo keyboard-variant ;; keyboard-shortcuts) echo apple-keyboard-command ;; + key-enter) echo keyboard-variant ;; message-close) echo close ;; move-down) echo chevron-double-down ;; move-up) echo chevron-double-up ;; @@ -117,9 +125,10 @@ map() { password-generator) echo dice-3-outline ;; password-show-off) echo eye-off-outline ;; password-show-on) echo eye-outline ;; - preferences-other) echo file-document-edit-outline ;; preferences-desktop-icons) echo emoticon-happy-outline ;; + preferences-other) echo file-document-edit-outline ;; preferences-system-network-sharing) echo lan ;; + refresh) echo refresh ;; reports) echo lightbulb-on-outline ;; reports-exclude) echo lightbulb-off-outline ;; security-high) echo shield-outline ;; @@ -139,7 +148,7 @@ map() { } # Now do the actual work -find application -type f -name "*.svg" | while read -r DST;do +find $DSTDIR -type f -name "*.svg" | while read -r DST;do # Find the icon name (base name without extender) NAME=$(basename $DST .svg) @@ -147,18 +156,19 @@ find application -type f -name "*.svg" | while read -r DST;do # Find the base name of the svg file for this icon MAT=$(map $NAME) if [[ -z $MAT ]];then - echo "Warning: Don't know about $NAME" + echo -e "${YELLOW}Warning: No MaterialDesign mapping for ${NAME}${NC}" continue fi # So the source file is: SRC="$MATERIAL/svg/$MAT.svg" if [ ! -f "$SRC" ];then - echo "Error: Source for $NAME doesn't exist: $SRC" - exit 1 + echo -e "${RED}Error: Source for ${NAME} doesn't exist: ${SRC}${NC}" + continue fi # Replace the icon file with the source file cp "$SRC" "$DST" || exit + echo "Copied icon for ${NAME}" done