Replace application icons with Material Design icons.

Use the following to run KeePassXC with the icons from the
source code, ignoring the operating system's Qt icon theme:

```
KEEPASSXC_IGNORE_ICON_THEME=1 keepassxc
```

The patch further adds a script `makeicons.sh` that re-creates KeePassXC
icons from the Material Design icon set and can be used for easily
updating icons in the future. Instructions are in the script.

Fixes #475
This commit is contained in:
Wolfram Rösler 2019-12-26 21:32:12 +01:00 committed by Janek Bevendorff
parent 470838f21c
commit 36f92b7649
238 changed files with 306 additions and 9562 deletions

View file

@ -143,7 +143,7 @@ QIcon FilePath::icon(const QString& category, const QString& name, bool fromThem
return icon;
}
if (fromTheme) {
if (fromTheme && !getenv("KEEPASSXC_IGNORE_ICON_THEME")) {
icon = QIcon::fromTheme(name);
}

View file

@ -30,16 +30,19 @@ LineEdit::LineEdit(QWidget* parent)
{
m_clearButton->setObjectName("clearButton");
QIcon icon;
QString iconNameDirected =
QString("edit-clear-locationbar-").append((layoutDirection() == Qt::LeftToRight) ? "rtl" : "ltr");
icon = QIcon::fromTheme(iconNameDirected);
if (icon.isNull()) {
icon = QIcon::fromTheme("edit-clear");
QIcon icon;
if (!getenv("KEEPASSXC_IGNORE_ICON_THEME")) {
icon = QIcon::fromTheme(iconNameDirected);
if (icon.isNull()) {
icon = filePath()->icon("actions", iconNameDirected);
icon = QIcon::fromTheme("edit-clear");
}
}
if (icon.isNull()) {
icon = filePath()->icon("actions", iconNameDirected);
}
m_clearButton->setIcon(icon);
m_clearButton->setCursor(Qt::ArrowCursor);

View file

@ -315,6 +315,7 @@ MainWindow::MainWindow()
m_ui->actionChangeMasterKey->setIcon(filePath()->icon("actions", "database-change-key"));
m_ui->actionLockDatabases->setIcon(filePath()->icon("actions", "database-lock"));
m_ui->actionQuit->setIcon(filePath()->icon("actions", "application-exit"));
m_ui->actionDatabaseMerge->setIcon(filePath()->icon("actions", "database-merge"));
m_ui->actionEntryNew->setIcon(filePath()->icon("actions", "entry-new"));
m_ui->actionEntryClone->setIcon(filePath()->icon("actions", "entry-clone"));
@ -325,17 +326,26 @@ MainWindow::MainWindow()
m_ui->actionEntryCopyPassword->setIcon(filePath()->icon("actions", "password-copy"));
m_ui->actionEntryCopyURL->setIcon(filePath()->icon("actions", "url-copy"));
m_ui->actionEntryDownloadIcon->setIcon(filePath()->icon("actions", "favicon-download"));
m_ui->actionGroupSortAsc->setIcon(filePath()->icon("actions", "sort-alphabetical-ascending"));
m_ui->actionGroupSortDesc->setIcon(filePath()->icon("actions", "sort-alphabetical-descending"));
m_ui->actionGroupNew->setIcon(filePath()->icon("actions", "group-new"));
m_ui->actionGroupEdit->setIcon(filePath()->icon("actions", "group-edit"));
m_ui->actionGroupDelete->setIcon(filePath()->icon("actions", "group-delete"));
m_ui->actionGroupEmptyRecycleBin->setIcon(filePath()->icon("actions", "group-empty-trash"));
m_ui->actionEntryOpenUrl->setIcon(filePath()->icon("actions", "web"));
m_ui->actionGroupDownloadFavicons->setIcon(filePath()->icon("actions", "favicon-download"));
m_ui->actionSettings->setIcon(filePath()->icon("actions", "configure"));
m_ui->actionPasswordGenerator->setIcon(filePath()->icon("actions", "password-generator"));
m_ui->actionAbout->setIcon(filePath()->icon("actions", "help-about"));
m_ui->actionDonate->setIcon(filePath()->icon("actions", "donate"));
m_ui->actionBugReport->setIcon(filePath()->icon("actions", "bugreport"));
m_ui->actionGettingStarted->setIcon(filePath()->icon("actions", "getting-started"));
m_ui->actionUserGuide->setIcon(filePath()->icon("actions", "user-guide"));
m_ui->actionOnlineHelp->setIcon(filePath()->icon("actions", "system-help"));
m_ui->actionKeyboardShortcuts->setIcon(filePath()->icon("actions", "keyboard-shortcuts"));
m_ui->actionCheckForUpdates->setIcon(filePath()->icon("actions", "system-software-update"));
m_actionMultiplexer.connect(

View file

@ -346,8 +346,8 @@
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
<width>32</width>
<height>32</height>
</size>
</property>
<attribute name="toolBarArea">