MCPcopy Create free account
hub / github.com/KDE/kdiff3 / initPixmaps

Function initPixmaps

src/PixMapUtils.cpp:74–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void initPixmaps(const QColor& newest, const QColor& oldest, const QColor& middle, const QColor& notThere)
75{
76 if(s_pm_dir == nullptr || s_pm_file == nullptr)
77 {
78#include "xpm/file.xpm"
79#include "xpm/folder.xpm"
80 const qint32 smallIcon = qApp->style()->pixelMetric(QStyle::PM_SmallIconSize);
81 s_pm_dir = new QPixmap(QIcon::fromTheme(QStringLiteral("folder")).pixmap(smallIcon));
82 if(s_pm_dir->size() != QSize(16, 16))
83 {
84 delete s_pm_dir;
85 s_pm_dir = new QPixmap(folder_pm);
86 }
87 s_pm_file = new QPixmap(file_pm);
88 }
89
90 if(pmNew == nullptr)
91 {
92#include "xpm/link_arrow.xpm"
93
94 pmNotThere = new QPixmap;
95 pmNew = new QPixmap;
96 pmOld = new QPixmap;
97 pmMiddle = new QPixmap;
98
99 pmLink = new QPixmap(link_arrow);
100
101 pmDirLink = new QPixmap;
102 pmFileLink = new QPixmap;
103
104 pmNewLink = new QPixmap;
105 pmOldLink = new QPixmap;
106 pmMiddleLink = new QPixmap;
107
108 pmNewDir = new QPixmap;
109 pmMiddleDir = new QPixmap;
110 pmOldDir = new QPixmap;
111
112 pmNewDirLink = new QPixmap;
113 pmMiddleDirLink = new QPixmap;
114 pmOldDirLink = new QPixmap;
115 }
116
117 *pmNotThere = colorToPixmap(notThere);
118 *pmNew = colorToPixmap(newest);
119 *pmOld = colorToPixmap(oldest);
120 *pmMiddle = colorToPixmap(middle);
121
122 *pmDirLink = pixCombiner(s_pm_dir, pmLink);
123 *pmFileLink = pixCombiner(s_pm_file, pmLink);
124
125 *pmNewLink = pixCombiner(pmNew, pmLink);
126 *pmOldLink = pixCombiner(pmOld, pmLink);
127 *pmMiddleLink = pixCombiner(pmMiddle, pmLink);
128
129 *pmNewDir = pixCombiner(pmNew, s_pm_dir, 0.5);
130 *pmMiddleDir = pixCombiner(pmMiddle, s_pm_dir, 0.5);
131 *pmOldDir = pixCombiner(pmOld, s_pm_dir, 0.5);

Callers 1

prepareListViewMethod · 0.85

Calls 4

QSizeClass · 0.85
colorToPixmapFunction · 0.85
pixCombinerFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected