mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 23:39:45 -05:00
Set application window icon.
This commit is contained in:
parent
34d7b841c0
commit
55c94e6166
@ -20,4 +20,7 @@ install(FILES ${DATABASE_ICONS} DESTINATION ${DATA_INSTALL_DIR}/icons/database)
|
|||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
install(DIRECTORY icons/application/ DESTINATION share/icons/hicolor
|
install(DIRECTORY icons/application/ DESTINATION share/icons/hicolor
|
||||||
FILES_MATCHING PATTERN "*.png" PATTERN "*.svg")
|
FILES_MATCHING PATTERN "*.png" PATTERN "*.svg")
|
||||||
|
else(UNIX AND NOT APPLE)
|
||||||
|
install(DIRECTORY icons/application/ DESTINATION ${DATA_INSTALL_DIR}/icons/application
|
||||||
|
FILES_MATCHING PATTERN "*.png" PATTERN "*.svg")
|
||||||
endif(UNIX AND NOT APPLE)
|
endif(UNIX AND NOT APPLE)
|
||||||
|
@ -33,6 +33,28 @@ QString DataPath::getPath(const QString& name)
|
|||||||
return m_instance->m_basePath + name;
|
return m_instance->m_basePath + name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QIcon DataPath::applicationIcon()
|
||||||
|
{
|
||||||
|
if (!m_instance) {
|
||||||
|
m_instance = new DataPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
QIcon icon = QIcon::fromTheme("keepassx");
|
||||||
|
|
||||||
|
#if defined(QT_DEBUG) || defined(Q_WS_MAC) || defined(Q_WS_WIN)
|
||||||
|
if (icon.isNull()) {
|
||||||
|
QStringList pngSizes;
|
||||||
|
pngSizes << "16" << "24" << "32" << "48" << "64" << "128";
|
||||||
|
Q_FOREACH (const QString& size, pngSizes) {
|
||||||
|
icon.addFile(QString("%1/icons/application/%2x%2/apps/keepassx.png").arg(m_instance->m_basePath, size));
|
||||||
|
}
|
||||||
|
icon.addFile(QString("%1/icons/application/scalable/apps/keepassx.svg").arg(m_instance->m_basePath));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
DataPath::DataPath()
|
DataPath::DataPath()
|
||||||
{
|
{
|
||||||
if (false) {
|
if (false) {
|
||||||
|
@ -19,11 +19,13 @@
|
|||||||
#define KEEPASSX_DATAPATH_H
|
#define KEEPASSX_DATAPATH_H
|
||||||
|
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
|
#include <QtGui/QIcon>
|
||||||
|
|
||||||
class DataPath
|
class DataPath
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QString getPath(const QString& name);
|
static QString getPath(const QString& name);
|
||||||
|
static QIcon applicationIcon();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DataPath();
|
DataPath();
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "ui_MainWindow.h"
|
#include "ui_MainWindow.h"
|
||||||
|
|
||||||
#include "core/Database.h"
|
#include "core/Database.h"
|
||||||
|
#include "core/DataPath.h"
|
||||||
#include "core/Metadata.h"
|
#include "core/Metadata.h"
|
||||||
#include "gui/DatabaseWidget.h"
|
#include "gui/DatabaseWidget.h"
|
||||||
|
|
||||||
@ -27,6 +28,8 @@ MainWindow::MainWindow()
|
|||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
setWindowIcon(DataPath::applicationIcon());
|
||||||
|
|
||||||
connect(m_ui->tabWidget, SIGNAL(currentChanged(int)), SLOT(currentTabChanged(int)));
|
connect(m_ui->tabWidget, SIGNAL(currentChanged(int)), SLOT(currentTabChanged(int)));
|
||||||
connect(m_ui->tabWidget, SIGNAL(entrySelectionChanged(bool)), m_ui->actionEntryEdit, SLOT(setEnabled(bool)));
|
connect(m_ui->tabWidget, SIGNAL(entrySelectionChanged(bool)), m_ui->actionEntryEdit, SLOT(setEnabled(bool)));
|
||||||
connect(m_ui->tabWidget, SIGNAL(entrySelectionChanged(bool)), m_ui->actionEntryDelete, SLOT(setEnabled(bool)));
|
connect(m_ui->tabWidget, SIGNAL(entrySelectionChanged(bool)), m_ui->actionEntryDelete, SLOT(setEnabled(bool)));
|
||||||
|
Loading…
Reference in New Issue
Block a user