mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-24 08:43:29 -05:00
Add iconScaledPixmap() convenience functions.
This commit is contained in:
parent
1f33e6f044
commit
38245aa2a9
4 changed files with 33 additions and 0 deletions
|
|
@ -123,6 +123,19 @@ QPixmap Entry::iconPixmap() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPixmap Entry::iconScaledPixmap() const
|
||||||
|
{
|
||||||
|
if (m_data.customIcon.isNull()) {
|
||||||
|
// built-in icons are 16x16 so don't need to be scaled
|
||||||
|
return databaseIcons()->iconPixmap(m_data.iconNumber);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Q_ASSERT(database());
|
||||||
|
|
||||||
|
return database()->metadata()->customIconScaledPixmap(m_data.customIcon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int Entry::iconNumber() const
|
int Entry::iconNumber() const
|
||||||
{
|
{
|
||||||
return m_data.iconNumber;
|
return m_data.iconNumber;
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ public:
|
||||||
Uuid uuid() const;
|
Uuid uuid() const;
|
||||||
QImage icon() const;
|
QImage icon() const;
|
||||||
QPixmap iconPixmap() const;
|
QPixmap iconPixmap() const;
|
||||||
|
QPixmap iconScaledPixmap() const;
|
||||||
int iconNumber() const;
|
int iconNumber() const;
|
||||||
Uuid iconUuid() const;
|
Uuid iconUuid() const;
|
||||||
QColor foregroundColor() const;
|
QColor foregroundColor() const;
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,24 @@ QPixmap Group::iconPixmap() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPixmap Group::iconScaledPixmap() const
|
||||||
|
{
|
||||||
|
if (m_data.customIcon.isNull()) {
|
||||||
|
// built-in icons are 16x16 so don't need to be scaled
|
||||||
|
return databaseIcons()->iconPixmap(m_data.iconNumber);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Q_ASSERT(m_db);
|
||||||
|
|
||||||
|
if (m_db) {
|
||||||
|
return m_db->metadata()->customIconScaledPixmap(m_data.customIcon);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return QPixmap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int Group::iconNumber() const
|
int Group::iconNumber() const
|
||||||
{
|
{
|
||||||
return m_data.iconNumber;
|
return m_data.iconNumber;
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ public:
|
||||||
QString notes() const;
|
QString notes() const;
|
||||||
QImage icon() const;
|
QImage icon() const;
|
||||||
QPixmap iconPixmap() const;
|
QPixmap iconPixmap() const;
|
||||||
|
QPixmap iconScaledPixmap() const;
|
||||||
int iconNumber() const;
|
int iconNumber() const;
|
||||||
Uuid iconUuid() const;
|
Uuid iconUuid() const;
|
||||||
TimeInfo timeInfo() const;
|
TimeInfo timeInfo() const;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue